Skip to content

Commit fc4c250

Browse files
authored
Feat/decimals apr (#591)
* fix: decimals * fix: dec * fix: decimals
1 parent fcf0b65 commit fc4c250

File tree

4 files changed

+35
-109
lines changed

4 files changed

+35
-109
lines changed

packages/contract-helpers/CHANGELOG.md

Lines changed: 16 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,67 @@
11
# Change Log
22

3-
All notable changes to this project will be documented in this file.
4-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
3+
All notable changes to this project will be documented in this file. See
4+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

66
## 1.30.1 (2024-08-26)
77

88
**Note:** Version bump only for package @aave/contract-helpers
99

10-
11-
12-
13-
1410
# 1.30.0 (2024-08-20)
1511

16-
1712
### Features
1813

19-
* add zksync ([#587](https://github.com/aave/aave-utilities/issues/587)) ([f256271](https://github.com/aave/aave-utilities/commit/f25627193eede933a63c09ae1c3dbbb5705d22fa))
20-
21-
22-
23-
14+
- add zksync ([#587](https://github.com/aave/aave-utilities/issues/587))
15+
([f256271](https://github.com/aave/aave-utilities/commit/f25627193eede933a63c09ae1c3dbbb5705d22fa))
2416

2517
## 1.29.1 (2024-07-27)
2618

2719
**Note:** Version bump only for package @aave/contract-helpers
2820

29-
30-
31-
32-
3321
# 1.29.0 (2024-07-26)
3422

35-
3623
### Features
3724

38-
* v3.1 upgrade ([#585](https://github.com/aave/aave-utilities/issues/585)) ([c65037e](https://github.com/aave/aave-utilities/commit/c65037e5ba24c6ed910a07012f28d8a9b914eb81))
39-
40-
41-
42-
25+
- v3.1 upgrade ([#585](https://github.com/aave/aave-utilities/issues/585))
26+
([c65037e](https://github.com/aave/aave-utilities/commit/c65037e5ba24c6ed910a07012f28d8a9b914eb81))
4327

4428
## 1.28.2 (2024-05-31)
4529

4630
**Note:** Version bump only for package @aave/contract-helpers
4731

48-
49-
50-
51-
5232
## 1.28.1 (2024-05-08)
5333

5434
**Note:** Version bump only for package @aave/contract-helpers
5535

56-
57-
58-
59-
6036
# 1.28.0 (2024-03-19)
6137

62-
6338
### Features
6439

65-
* add gas limit for staking migrate ([#577](https://github.com/aave/aave-utilities/issues/577)) ([004602a](https://github.com/aave/aave-utilities/commit/004602a79642b101162de98e2b91c9cd964554fe))
66-
67-
68-
69-
40+
- add gas limit for staking migrate
41+
([#577](https://github.com/aave/aave-utilities/issues/577))
42+
([004602a](https://github.com/aave/aave-utilities/commit/004602a79642b101162de98e2b91c9cd964554fe))
7043

7144
# 1.27.0 (2024-03-11)
7245

73-
7446
### Features
7547

76-
* testnet updates ([#576](https://github.com/aave/aave-utilities/issues/576)) ([7334f68](https://github.com/aave/aave-utilities/commit/7334f68e3702fd5d47808b1f374423c1a0d2153b))
77-
78-
79-
80-
48+
- testnet updates ([#576](https://github.com/aave/aave-utilities/issues/576))
49+
([7334f68](https://github.com/aave/aave-utilities/commit/7334f68e3702fd5d47808b1f374423c1a0d2153b))
8150

8251
# 1.26.0 (2024-03-11)
8352

84-
8553
### Features
8654

87-
* add arbitrum sepolia chainId ([#574](https://github.com/aave/aave-utilities/issues/574)) ([433974f](https://github.com/aave/aave-utilities/commit/433974fc1f0e40bdfad21fbab625280c757f1f73))
88-
89-
90-
91-
55+
- add arbitrum sepolia chainId
56+
([#574](https://github.com/aave/aave-utilities/issues/574))
57+
([433974f](https://github.com/aave/aave-utilities/commit/433974fc1f0e40bdfad21fbab625280c757f1f73))
9258

9359
# 1.25.0 (2024-02-22)
9460

95-
9661
### Features
9762

98-
* sdai token wrapper ([#561](https://github.com/aave/aave-utilities/issues/561)) ([c772112](https://github.com/aave/aave-utilities/commit/c77211216fbcf86d71718c5450bc9aab5ec5a002))
99-
100-
101-
102-
63+
- sdai token wrapper ([#561](https://github.com/aave/aave-utilities/issues/561))
64+
([c772112](https://github.com/aave/aave-utilities/commit/c77211216fbcf86d71718c5450bc9aab5ec5a002))
10365

10466
# Change Log
10567

packages/math-utils/CHANGELOG.md

Lines changed: 16 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,67 @@
11
# Change Log
22

3-
All notable changes to this project will be documented in this file.
4-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
3+
All notable changes to this project will be documented in this file. See
4+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

66
## 1.30.1 (2024-08-26)
77

88
**Note:** Version bump only for package @aave/math-utils
99

10-
11-
12-
13-
1410
# 1.30.0 (2024-08-20)
1511

16-
1712
### Features
1813

19-
* add zksync ([#587](https://github.com/aave/aave-utilities/issues/587)) ([f256271](https://github.com/aave/aave-utilities/commit/f25627193eede933a63c09ae1c3dbbb5705d22fa))
20-
21-
22-
23-
14+
- add zksync ([#587](https://github.com/aave/aave-utilities/issues/587))
15+
([f256271](https://github.com/aave/aave-utilities/commit/f25627193eede933a63c09ae1c3dbbb5705d22fa))
2416

2517
## 1.29.1 (2024-07-27)
2618

2719
**Note:** Version bump only for package @aave/math-utils
2820

29-
30-
31-
32-
3321
# 1.29.0 (2024-07-26)
3422

35-
3623
### Features
3724

38-
* v3.1 upgrade ([#585](https://github.com/aave/aave-utilities/issues/585)) ([c65037e](https://github.com/aave/aave-utilities/commit/c65037e5ba24c6ed910a07012f28d8a9b914eb81))
39-
40-
41-
42-
25+
- v3.1 upgrade ([#585](https://github.com/aave/aave-utilities/issues/585))
26+
([c65037e](https://github.com/aave/aave-utilities/commit/c65037e5ba24c6ed910a07012f28d8a9b914eb81))
4327

4428
## 1.28.2 (2024-05-31)
4529

4630
**Note:** Version bump only for package @aave/math-utils
4731

48-
49-
50-
51-
5232
## 1.28.1 (2024-05-08)
5333

5434
**Note:** Version bump only for package @aave/math-utils
5535

56-
57-
58-
59-
6036
# 1.28.0 (2024-03-19)
6137

62-
6338
### Features
6439

65-
* add gas limit for staking migrate ([#577](https://github.com/aave/aave-utilities/issues/577)) ([004602a](https://github.com/aave/aave-utilities/commit/004602a79642b101162de98e2b91c9cd964554fe))
66-
67-
68-
69-
40+
- add gas limit for staking migrate
41+
([#577](https://github.com/aave/aave-utilities/issues/577))
42+
([004602a](https://github.com/aave/aave-utilities/commit/004602a79642b101162de98e2b91c9cd964554fe))
7043

7144
# 1.27.0 (2024-03-11)
7245

73-
7446
### Features
7547

76-
* testnet updates ([#576](https://github.com/aave/aave-utilities/issues/576)) ([7334f68](https://github.com/aave/aave-utilities/commit/7334f68e3702fd5d47808b1f374423c1a0d2153b))
77-
78-
79-
80-
48+
- testnet updates ([#576](https://github.com/aave/aave-utilities/issues/576))
49+
([7334f68](https://github.com/aave/aave-utilities/commit/7334f68e3702fd5d47808b1f374423c1a0d2153b))
8150

8251
# 1.26.0 (2024-03-11)
8352

84-
8553
### Features
8654

87-
* add arbitrum sepolia chainId ([#574](https://github.com/aave/aave-utilities/issues/574)) ([433974f](https://github.com/aave/aave-utilities/commit/433974fc1f0e40bdfad21fbab625280c757f1f73))
88-
89-
90-
91-
55+
- add arbitrum sepolia chainId
56+
([#574](https://github.com/aave/aave-utilities/issues/574))
57+
([433974f](https://github.com/aave/aave-utilities/commit/433974fc1f0e40bdfad21fbab625280c757f1f73))
9258

9359
# 1.25.0 (2024-02-22)
9460

95-
9661
### Features
9762

98-
* sdai token wrapper ([#561](https://github.com/aave/aave-utilities/issues/561)) ([c772112](https://github.com/aave/aave-utilities/commit/c77211216fbcf86d71718c5450bc9aab5ec5a002))
99-
100-
101-
102-
63+
- sdai token wrapper ([#561](https://github.com/aave/aave-utilities/issues/561))
64+
([c772112](https://github.com/aave/aave-utilities/commit/c77211216fbcf86d71718c5450bc9aab5ec5a002))
10365

10466
# Change Log
10567

packages/math-utils/src/formatters/incentive/calculate-incentive-apr.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ export function calculateIncentiveAPR({
1616
rewardTokenPriceInMarketReferenceCurrency,
1717
priceInMarketReferenceCurrency,
1818
totalTokenSupply,
19+
rewardTokenDecimals,
1920
decimals,
2021
}: CalculateIncentiveAPRRequest): string {
2122
const emissionPerSecondNormalized = normalizeBN(
2223
emissionPerSecond,
23-
decimals,
24+
rewardTokenDecimals,
2425
).multipliedBy(rewardTokenPriceInMarketReferenceCurrency);
2526

2627
if (emissionPerSecondNormalized.eq(0)) {

packages/math-utils/src/formatters/reserve/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ export function formatReservesAndIncentives<T extends ReserveDataWithPrice>({
454454
marketReferenceCurrencyDecimals,
455455
marketReferencePriceInUsd,
456456
});
457+
457458
return formattedReserves.map(reserve => {
458459
const reserveIncentive = reserveIncentives.find(
459460
reserveIncentive =>

0 commit comments

Comments
 (0)