@gearbox-protocol/sdk 3.0.0-next.209 → 3.0.0-next.210
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.
- package/lib/core/pool.d.ts +6 -3
- package/lib/core/pool.js +7 -6
- package/lib/payload/pool.d.ts +22 -17
- package/package.json +1 -1
package/lib/core/pool.d.ts
CHANGED
|
@@ -125,7 +125,6 @@ export declare class UserPoolData {
|
|
|
125
125
|
readonly underlyingToken: Address;
|
|
126
126
|
readonly depositAPY: number;
|
|
127
127
|
readonly depositAPYRay: bigint;
|
|
128
|
-
readonly lmAPY: number;
|
|
129
128
|
readonly lmRewardAll: Array<{
|
|
130
129
|
apy: number;
|
|
131
130
|
token: Address;
|
|
@@ -134,8 +133,12 @@ export declare class UserPoolData {
|
|
|
134
133
|
readonly providedLiquidityInUSD: number;
|
|
135
134
|
readonly dieselBalance: bigint;
|
|
136
135
|
readonly dieselBalanceInUSD: number;
|
|
137
|
-
readonly
|
|
138
|
-
|
|
136
|
+
readonly userRewards: Array<{
|
|
137
|
+
token: Address;
|
|
138
|
+
pool: Address;
|
|
139
|
+
lmRewards: bigint;
|
|
140
|
+
lmRewardsInUSD: number;
|
|
141
|
+
}>;
|
|
139
142
|
readonly pnlInNativeToken: number;
|
|
140
143
|
readonly pnlInUSD: number;
|
|
141
144
|
readonly addedLiq: number;
|
package/lib/core/pool.js
CHANGED
|
@@ -277,14 +277,12 @@ class UserPoolData {
|
|
|
277
277
|
underlyingToken;
|
|
278
278
|
depositAPY;
|
|
279
279
|
depositAPYRay;
|
|
280
|
-
lmAPY;
|
|
281
280
|
lmRewardAll;
|
|
282
281
|
providedLiquidity;
|
|
283
282
|
providedLiquidityInUSD;
|
|
284
283
|
dieselBalance;
|
|
285
284
|
dieselBalanceInUSD;
|
|
286
|
-
|
|
287
|
-
lmRewardsInUSD;
|
|
285
|
+
userRewards;
|
|
288
286
|
pnlInNativeToken;
|
|
289
287
|
pnlInUSD;
|
|
290
288
|
addedLiq;
|
|
@@ -299,7 +297,6 @@ class UserPoolData {
|
|
|
299
297
|
this.depositAPY =
|
|
300
298
|
(0, formatter_1.rayToNumber)(payload.depositAPY_RAY || 0) * Number(sdk_gov_1.PERCENTAGE_DECIMALS);
|
|
301
299
|
this.depositAPYRay = (0, sdk_gov_1.toBigInt)(payload.depositAPY_RAY || 0);
|
|
302
|
-
this.lmAPY = (payload.lmAPY || 0) / Number(sdk_gov_1.PERCENTAGE_DECIMALS || 0);
|
|
303
300
|
this.lmRewardAll = (payload.lmRewardAll || []).map(r => ({
|
|
304
301
|
apy: (r.apy || 0) / Number(sdk_gov_1.PERCENTAGE_DECIMALS),
|
|
305
302
|
token: (r.token || "").toLowerCase(),
|
|
@@ -308,8 +305,12 @@ class UserPoolData {
|
|
|
308
305
|
this.providedLiquidityInUSD = payload.liqValueInUSD;
|
|
309
306
|
this.dieselBalance = (0, sdk_gov_1.toBigInt)(payload.dieselBalanceBI || 0);
|
|
310
307
|
this.dieselBalanceInUSD = payload.dieselBalance;
|
|
311
|
-
this.
|
|
312
|
-
|
|
308
|
+
this.userRewards = (payload.userRewards || []).map(r => ({
|
|
309
|
+
token: (r.rewardToken || "").toLowerCase(),
|
|
310
|
+
pool: (r.pool || "").toLowerCase(),
|
|
311
|
+
lmRewards: (0, sdk_gov_1.toBigInt)(r.lmRewards || 0),
|
|
312
|
+
lmRewardsInUSD: r.lmRewardsInUSD,
|
|
313
|
+
}));
|
|
313
314
|
this.pnlInNativeToken = payload.liqPnlInNativeToken;
|
|
314
315
|
this.pnlInUSD = payload.liqPnlInUSD;
|
|
315
316
|
this.addedLiq = payload.addedLiq;
|
package/lib/payload/pool.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Address } from "viem";
|
|
2
|
-
import { BigNumberish } from "../utils/formatter";
|
|
3
2
|
export interface PoolDataPayload {
|
|
4
3
|
addr: Address;
|
|
5
4
|
underlying: Address;
|
|
@@ -78,9 +77,9 @@ export interface ChartsPoolDataPayload {
|
|
|
78
77
|
isWETH: boolean;
|
|
79
78
|
version: number;
|
|
80
79
|
name: string;
|
|
81
|
-
borrowAPY_RAY:
|
|
82
|
-
depositAPY_RAY:
|
|
83
|
-
dieselRate_RAY:
|
|
80
|
+
borrowAPY_RAY: string;
|
|
81
|
+
depositAPY_RAY: string;
|
|
82
|
+
dieselRate_RAY: string;
|
|
84
83
|
lmAPY: number;
|
|
85
84
|
lmRewardAll: Array<{
|
|
86
85
|
apy: number;
|
|
@@ -88,29 +87,29 @@ export interface ChartsPoolDataPayload {
|
|
|
88
87
|
}>;
|
|
89
88
|
earned7D: number;
|
|
90
89
|
earned7DInUSD: number;
|
|
91
|
-
availableLiquidity:
|
|
92
|
-
availableLiquidityOld:
|
|
90
|
+
availableLiquidity: string;
|
|
91
|
+
availableLiquidityOld: string;
|
|
93
92
|
availableLiquidity10kBasis: number;
|
|
94
93
|
availableLiquidityInUSD: number;
|
|
95
94
|
expectedLiqWeekAgo: number;
|
|
96
|
-
expectedLiquidity:
|
|
97
|
-
expectedLiquidityOld:
|
|
95
|
+
expectedLiquidity: string;
|
|
96
|
+
expectedLiquidityOld: string;
|
|
98
97
|
expectedLiquidity10kBasis: number;
|
|
99
98
|
expectedLiquidityInUSD: number;
|
|
100
|
-
expectedLiquidityLimit:
|
|
99
|
+
expectedLiquidityLimit: string;
|
|
101
100
|
expectedLiquidityLimitInUSD: number;
|
|
102
101
|
caLockedValue: number;
|
|
103
102
|
caLockedValueOld: number;
|
|
104
103
|
caLockedValue10kBasis: number;
|
|
105
104
|
caLockedValueUSD: number;
|
|
106
|
-
totalBorrowed:
|
|
107
|
-
totalBorrowedOld:
|
|
105
|
+
totalBorrowed: string;
|
|
106
|
+
totalBorrowedOld: string;
|
|
108
107
|
totalBorrowed10kBasis: number;
|
|
109
108
|
totalBorrowedInUSD: number;
|
|
110
|
-
debtWithInterest:
|
|
109
|
+
debtWithInterest: string;
|
|
111
110
|
debtWithInterest10kBasis: number;
|
|
112
111
|
debtWithInterestInUSD: number;
|
|
113
|
-
debtWithInterestOld:
|
|
112
|
+
debtWithInterestOld: string;
|
|
114
113
|
withdrawFee: number;
|
|
115
114
|
addLiqCount: number;
|
|
116
115
|
addedLiquidity: number;
|
|
@@ -146,19 +145,25 @@ export interface UserPoolPayload {
|
|
|
146
145
|
dieselSym: string;
|
|
147
146
|
dieselToken: Address;
|
|
148
147
|
underlyingToken: Address;
|
|
149
|
-
liqValue:
|
|
148
|
+
liqValue: string;
|
|
150
149
|
liqValueInUSD: number;
|
|
151
150
|
dieselBalance: number;
|
|
152
|
-
dieselBalanceBI:
|
|
153
|
-
lmRewards:
|
|
151
|
+
dieselBalanceBI: string;
|
|
152
|
+
lmRewards: string;
|
|
154
153
|
lmRewardsInUSD: number;
|
|
154
|
+
userRewards: Array<{
|
|
155
|
+
lmRewards: string;
|
|
156
|
+
lmRewardsInUSD: number;
|
|
157
|
+
pool: Address;
|
|
158
|
+
rewardToken: Address;
|
|
159
|
+
}>;
|
|
155
160
|
liqPnlInNativeToken: number;
|
|
156
161
|
liqPnlInUSD: number;
|
|
157
162
|
addedLiq: number;
|
|
158
163
|
addLiqCount: number;
|
|
159
164
|
removeLiqCount: number;
|
|
160
165
|
removedLiq: number;
|
|
161
|
-
depositAPY_RAY:
|
|
166
|
+
depositAPY_RAY: string;
|
|
162
167
|
lmAPY: number;
|
|
163
168
|
lmRewardAll: Array<{
|
|
164
169
|
apy: number;
|