@gearbox-protocol/sdk 8.15.0 → 8.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -53,7 +53,6 @@ class GearboxRewardsApy {
|
|
|
53
53
|
rewardPoolsInfo,
|
|
54
54
|
rewardPoolsSupply,
|
|
55
55
|
tokensList,
|
|
56
|
-
currentTokenData,
|
|
57
56
|
currentTimestamp
|
|
58
57
|
}) {
|
|
59
58
|
const { underlyingToken, dieselRateRay } = pool;
|
|
@@ -61,7 +60,7 @@ class GearboxRewardsApy {
|
|
|
61
60
|
const { decimals: underlyingDecimals = 18 } = tokensList[underlyingToken] || {};
|
|
62
61
|
const underlyingPrice = prices[underlyingToken] ?? 0n;
|
|
63
62
|
const dieselPrice = underlyingPrice * dieselRateRay / import_constants.RAY;
|
|
64
|
-
const rewardAddress =
|
|
63
|
+
const rewardAddress = rewardPoolsInfo?.token || "";
|
|
65
64
|
const { decimals: rewardDecimals = 18 } = tokensList[rewardAddress] || {};
|
|
66
65
|
const rewardPrice = prices[rewardAddress] ?? 0n;
|
|
67
66
|
const r = GearboxRewardsApy.calculateAPY_V3({
|
|
@@ -140,14 +139,13 @@ class GearboxRewardsApy {
|
|
|
140
139
|
rewardInfo,
|
|
141
140
|
supply,
|
|
142
141
|
tokensList,
|
|
143
|
-
currentTokenData,
|
|
144
142
|
currentTimestamp
|
|
145
143
|
}) {
|
|
146
144
|
const { token, balance } = asset;
|
|
147
145
|
const safeSupply = supply[token] ?? 0n;
|
|
148
146
|
const { decimals: tokenDecimals = 18 } = tokensList[token] || {};
|
|
149
147
|
const tokenPrice = prices[token] ?? 0n;
|
|
150
|
-
const rewardAddress =
|
|
148
|
+
const rewardAddress = rewardInfo?.token || "";
|
|
151
149
|
const { decimals: rewardDecimals = 18 } = tokensList[rewardAddress] || {};
|
|
152
150
|
const rewardPrice = prices[rewardAddress] ?? 0n;
|
|
153
151
|
const r = GearboxRewardsApy.calculateAPY_V3({
|
|
@@ -36,7 +36,6 @@ class GearboxRewardsApy {
|
|
|
36
36
|
rewardPoolsInfo,
|
|
37
37
|
rewardPoolsSupply,
|
|
38
38
|
tokensList,
|
|
39
|
-
currentTokenData,
|
|
40
39
|
currentTimestamp
|
|
41
40
|
}) {
|
|
42
41
|
const { underlyingToken, dieselRateRay } = pool;
|
|
@@ -44,7 +43,7 @@ class GearboxRewardsApy {
|
|
|
44
43
|
const { decimals: underlyingDecimals = 18 } = tokensList[underlyingToken] || {};
|
|
45
44
|
const underlyingPrice = prices[underlyingToken] ?? 0n;
|
|
46
45
|
const dieselPrice = underlyingPrice * dieselRateRay / RAY;
|
|
47
|
-
const rewardAddress =
|
|
46
|
+
const rewardAddress = rewardPoolsInfo?.token || "";
|
|
48
47
|
const { decimals: rewardDecimals = 18 } = tokensList[rewardAddress] || {};
|
|
49
48
|
const rewardPrice = prices[rewardAddress] ?? 0n;
|
|
50
49
|
const r = GearboxRewardsApy.calculateAPY_V3({
|
|
@@ -123,14 +122,13 @@ class GearboxRewardsApy {
|
|
|
123
122
|
rewardInfo,
|
|
124
123
|
supply,
|
|
125
124
|
tokensList,
|
|
126
|
-
currentTokenData,
|
|
127
125
|
currentTimestamp
|
|
128
126
|
}) {
|
|
129
127
|
const { token, balance } = asset;
|
|
130
128
|
const safeSupply = supply[token] ?? 0n;
|
|
131
129
|
const { decimals: tokenDecimals = 18 } = tokensList[token] || {};
|
|
132
130
|
const tokenPrice = prices[token] ?? 0n;
|
|
133
|
-
const rewardAddress =
|
|
131
|
+
const rewardAddress = rewardInfo?.token || "";
|
|
134
132
|
const { decimals: rewardDecimals = 18 } = tokensList[rewardAddress] || {};
|
|
135
133
|
const rewardPrice = prices[rewardAddress] ?? 0n;
|
|
136
134
|
const r = GearboxRewardsApy.calculateAPY_V3({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { Asset } from "../../router/index.js";
|
|
3
|
-
import type { SupportedToken } from "../../sdk-gov-legacy/index.js";
|
|
4
3
|
import type { PoolData_Legacy } from "../core/pool.js";
|
|
5
4
|
import type { TokenData } from "../tokens/tokenData.js";
|
|
6
5
|
export interface FarmInfo {
|
|
@@ -9,7 +8,8 @@ export interface FarmInfo {
|
|
|
9
8
|
duration: bigint;
|
|
10
9
|
reward: bigint;
|
|
11
10
|
balance: bigint;
|
|
12
|
-
symbol:
|
|
11
|
+
symbol: string;
|
|
12
|
+
token: Address;
|
|
13
13
|
}
|
|
14
14
|
export interface ExtraRewardApy {
|
|
15
15
|
token: Address;
|
|
@@ -26,7 +26,6 @@ interface GetPoolExtraAPY_V3Props {
|
|
|
26
26
|
rewardPoolsInfo: Record<Address, Array<FarmInfo>> | Record<Address, FarmInfo>;
|
|
27
27
|
rewardPoolsSupply: Record<Address, bigint>;
|
|
28
28
|
tokensList: Record<Address, TokenData>;
|
|
29
|
-
currentTokenData: Record<SupportedToken, Address>;
|
|
30
29
|
currentTimestamp: number;
|
|
31
30
|
}
|
|
32
31
|
interface GetCAExtraAPYProps {
|
|
@@ -36,7 +35,6 @@ interface GetCAExtraAPYProps {
|
|
|
36
35
|
currentTimestamp: number;
|
|
37
36
|
prices: Record<Address, bigint>;
|
|
38
37
|
tokensList: Record<Address, TokenData>;
|
|
39
|
-
currentTokenData: Record<SupportedToken, Address>;
|
|
40
38
|
}
|
|
41
39
|
export declare class GearboxRewardsApy {
|
|
42
40
|
static getPoolExtraAPY_V3({ rewardPoolsInfo, stakedDieselToken, ...restProps }: GetPoolExtraAPY_V3Props): Array<ExtraRewardApy>;
|