@defisaver/positions-sdk 2.1.174 → 2.1.175-looping-2-dev-dev
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/cjs/aaveV2/index.d.ts +4 -4
- package/cjs/aaveV2/index.js +7 -7
- package/cjs/aaveV3/index.d.ts +5 -14
- package/cjs/aaveV3/index.js +14 -10
- package/cjs/aaveV3/merkl.d.ts +5 -1
- package/cjs/aaveV3/merkl.js +8 -3
- package/cjs/aaveV3/sgho.d.ts +2 -16
- package/cjs/aaveV4/index.d.ts +4 -3
- package/cjs/aaveV4/index.js +19 -16
- package/cjs/aaveV4/lend.d.ts +2 -43
- package/cjs/aaveV4/merkl.d.ts +10 -2
- package/cjs/aaveV4/merkl.js +15 -6
- package/cjs/claiming/aaveV3.d.ts +3 -3
- package/cjs/claiming/aaveV3.js +5 -4
- package/cjs/claiming/ethena.d.ts +2 -1
- package/cjs/claiming/king.d.ts +3 -2
- package/cjs/claiming/king.js +3 -2
- package/cjs/claiming/spark.d.ts +4 -4
- package/cjs/claiming/spark.js +8 -7
- package/cjs/claiming/uniswap.d.ts +2 -2
- package/cjs/claiming/uniswap.js +3 -2
- package/cjs/compoundV2/index.d.ts +4 -4
- package/cjs/compoundV2/index.js +9 -9
- package/cjs/compoundV3/index.d.ts +5 -4
- package/cjs/compoundV3/index.js +17 -13
- package/cjs/compoundV3/merkl.d.ts +1 -1
- package/cjs/compoundV3/merkl.js +2 -5
- package/cjs/curveUsd/index.d.ts +5 -5
- package/cjs/curveUsd/index.js +17 -17
- package/cjs/fluid/index.d.ts +23 -66
- package/cjs/fluid/index.js +75 -72
- package/cjs/fluid/merkl.d.ts +5 -3
- package/cjs/fluid/merkl.js +11 -6
- package/cjs/helpers/aaveHelpers/index.js +1 -1
- package/cjs/helpers/aaveV4Helpers/index.js +14 -2
- package/cjs/helpers/compoundHelpers/index.js +2 -2
- package/cjs/helpers/curveUsdHelpers/index.js +1 -1
- package/cjs/helpers/fluidHelpers/index.js +1 -1
- package/cjs/helpers/liquityV2Helpers/index.js +1 -1
- package/cjs/helpers/llamaLendHelpers/index.js +1 -1
- package/cjs/helpers/morphoBlueHelpers/index.js +1 -1
- package/cjs/helpers/morphoMidnightHelpers/index.js +1 -1
- package/cjs/helpers/sparkHelpers/index.js +1 -1
- package/cjs/liquity/index.d.ts +5 -15
- package/cjs/liquity/index.js +23 -23
- package/cjs/liquityV2/index.d.ts +16 -31
- package/cjs/liquityV2/index.js +96 -78
- package/cjs/llamaLend/index.d.ts +5 -5
- package/cjs/llamaLend/index.js +13 -13
- package/cjs/maker/index.d.ts +6 -6
- package/cjs/maker/index.js +16 -16
- package/cjs/moneymarket/moneymarketCommonService.js +13 -2
- package/cjs/morphoBlue/index.d.ts +7 -7
- package/cjs/morphoBlue/index.js +28 -26
- package/cjs/morphoBlue/merkl.d.ts +5 -3
- package/cjs/morphoBlue/merkl.js +6 -8
- package/cjs/morphoMidnight/index.d.ts +5 -5
- package/cjs/morphoMidnight/index.js +18 -18
- package/cjs/portfolio/customDeFiData.d.ts +3 -0
- package/cjs/portfolio/customDeFiData.js +267 -0
- package/cjs/portfolio/index.d.ts +17 -8
- package/cjs/portfolio/index.js +459 -520
- package/cjs/portfolio/lendingProtocols.d.ts +184 -0
- package/cjs/portfolio/lendingProtocols.js +196 -0
- package/cjs/savings/index.d.ts +8 -2
- package/cjs/savings/index.js +33 -4
- package/cjs/services/merkl.d.ts +46 -2
- package/cjs/services/merkl.js +190 -19
- package/cjs/services/priceService.d.ts +12 -12
- package/cjs/services/priceService.js +30 -29
- package/cjs/services/viem.d.ts +10 -2
- package/cjs/services/viem.js +27 -1
- package/cjs/spark/index.d.ts +4 -4
- package/cjs/spark/index.js +9 -9
- package/cjs/types/aave.d.ts +98 -2
- package/cjs/types/aaveV4.d.ts +45 -0
- package/cjs/types/common.d.ts +1 -0
- package/cjs/types/common.js +1 -0
- package/cjs/types/compound.d.ts +26 -2
- package/cjs/types/curveUsd.d.ts +9 -1
- package/cjs/types/fluid.d.ts +13 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/liquity.d.ts +12 -0
- package/cjs/types/liquityV2.d.ts +24 -0
- package/cjs/types/llamaLend.d.ts +12 -1
- package/cjs/types/merkl.d.ts +18 -0
- package/cjs/types/morphoBlue.d.ts +2 -0
- package/cjs/types/portfolio.d.ts +162 -5
- package/cjs/types/portfolio.js +18 -0
- package/cjs/types/savings/index.d.ts +9 -1
- package/cjs/types/spark.d.ts +21 -1
- package/cjs/umbrella/index.d.ts +3 -4
- package/cjs/umbrella/index.js +5 -4
- package/esm/aaveV2/index.d.ts +4 -4
- package/esm/aaveV2/index.js +8 -8
- package/esm/aaveV3/index.d.ts +5 -14
- package/esm/aaveV3/index.js +15 -11
- package/esm/aaveV3/merkl.d.ts +5 -1
- package/esm/aaveV3/merkl.js +9 -4
- package/esm/aaveV3/sgho.d.ts +2 -16
- package/esm/aaveV4/index.d.ts +4 -3
- package/esm/aaveV4/index.js +20 -17
- package/esm/aaveV4/lend.d.ts +2 -43
- package/esm/aaveV4/merkl.d.ts +10 -2
- package/esm/aaveV4/merkl.js +16 -7
- package/esm/claiming/aaveV3.d.ts +3 -3
- package/esm/claiming/aaveV3.js +6 -5
- package/esm/claiming/ethena.d.ts +2 -1
- package/esm/claiming/king.d.ts +3 -2
- package/esm/claiming/king.js +3 -2
- package/esm/claiming/spark.d.ts +4 -4
- package/esm/claiming/spark.js +9 -8
- package/esm/claiming/uniswap.d.ts +2 -2
- package/esm/claiming/uniswap.js +3 -2
- package/esm/compoundV2/index.d.ts +4 -4
- package/esm/compoundV2/index.js +9 -9
- package/esm/compoundV3/index.d.ts +5 -4
- package/esm/compoundV3/index.js +19 -15
- package/esm/compoundV3/merkl.d.ts +1 -1
- package/esm/compoundV3/merkl.js +3 -6
- package/esm/curveUsd/index.d.ts +5 -5
- package/esm/curveUsd/index.js +17 -17
- package/esm/fluid/index.d.ts +23 -66
- package/esm/fluid/index.js +76 -73
- package/esm/fluid/merkl.d.ts +5 -3
- package/esm/fluid/merkl.js +12 -7
- package/esm/helpers/aaveHelpers/index.js +1 -1
- package/esm/helpers/aaveV4Helpers/index.js +15 -3
- package/esm/helpers/compoundHelpers/index.js +2 -2
- package/esm/helpers/curveUsdHelpers/index.js +1 -1
- package/esm/helpers/fluidHelpers/index.js +1 -1
- package/esm/helpers/liquityV2Helpers/index.js +1 -1
- package/esm/helpers/llamaLendHelpers/index.js +1 -1
- package/esm/helpers/morphoBlueHelpers/index.js +1 -1
- package/esm/helpers/morphoMidnightHelpers/index.js +1 -1
- package/esm/helpers/sparkHelpers/index.js +1 -1
- package/esm/liquity/index.d.ts +5 -15
- package/esm/liquity/index.js +23 -23
- package/esm/liquityV2/index.d.ts +16 -31
- package/esm/liquityV2/index.js +95 -78
- package/esm/llamaLend/index.d.ts +5 -5
- package/esm/llamaLend/index.js +13 -13
- package/esm/maker/index.d.ts +6 -6
- package/esm/maker/index.js +16 -16
- package/esm/moneymarket/moneymarketCommonService.js +13 -2
- package/esm/morphoBlue/index.d.ts +7 -7
- package/esm/morphoBlue/index.js +29 -27
- package/esm/morphoBlue/merkl.d.ts +5 -3
- package/esm/morphoBlue/merkl.js +7 -9
- package/esm/morphoMidnight/index.d.ts +5 -5
- package/esm/morphoMidnight/index.js +18 -18
- package/esm/portfolio/customDeFiData.d.ts +3 -0
- package/esm/portfolio/customDeFiData.js +261 -0
- package/esm/portfolio/index.d.ts +17 -8
- package/esm/portfolio/index.js +459 -522
- package/esm/portfolio/lendingProtocols.d.ts +184 -0
- package/esm/portfolio/lendingProtocols.js +189 -0
- package/esm/savings/index.d.ts +8 -2
- package/esm/savings/index.js +31 -3
- package/esm/services/merkl.d.ts +46 -2
- package/esm/services/merkl.js +180 -18
- package/esm/services/priceService.d.ts +12 -12
- package/esm/services/priceService.js +31 -30
- package/esm/services/viem.d.ts +10 -2
- package/esm/services/viem.js +25 -0
- package/esm/spark/index.d.ts +4 -4
- package/esm/spark/index.js +10 -10
- package/esm/types/aave.d.ts +98 -2
- package/esm/types/aaveV4.d.ts +45 -0
- package/esm/types/common.d.ts +1 -0
- package/esm/types/common.js +1 -0
- package/esm/types/compound.d.ts +26 -2
- package/esm/types/curveUsd.d.ts +9 -1
- package/esm/types/fluid.d.ts +13 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/liquity.d.ts +12 -0
- package/esm/types/liquityV2.d.ts +24 -0
- package/esm/types/llamaLend.d.ts +12 -1
- package/esm/types/merkl.d.ts +18 -0
- package/esm/types/morphoBlue.d.ts +2 -0
- package/esm/types/portfolio.d.ts +162 -5
- package/esm/types/portfolio.js +17 -1
- package/esm/types/savings/index.d.ts +9 -1
- package/esm/types/spark.d.ts +21 -1
- package/esm/umbrella/index.d.ts +3 -4
- package/esm/umbrella/index.js +5 -4
- package/package.json +1 -1
- package/src/aaveV2/index.ts +7 -7
- package/src/aaveV3/index.ts +16 -11
- package/src/aaveV3/merkl.ts +9 -4
- package/src/aaveV3/sgho.ts +2 -17
- package/src/aaveV4/index.ts +19 -16
- package/src/aaveV4/lend.ts +2 -48
- package/src/aaveV4/merkl.ts +16 -7
- package/src/claiming/aaveV3.ts +9 -5
- package/src/claiming/ethena.ts +5 -5
- package/src/claiming/king.ts +8 -5
- package/src/claiming/spark.ts +15 -10
- package/src/claiming/uniswap.ts +4 -3
- package/src/compoundV2/index.ts +10 -9
- package/src/compoundV3/index.ts +20 -14
- package/src/compoundV3/merkl.ts +5 -4
- package/src/curveUsd/index.ts +19 -17
- package/src/fluid/index.ts +91 -72
- package/src/fluid/merkl.ts +12 -7
- package/src/helpers/aaveHelpers/index.ts +1 -1
- package/src/helpers/aaveV4Helpers/index.ts +16 -2
- package/src/helpers/compoundHelpers/index.ts +2 -2
- package/src/helpers/curveUsdHelpers/index.ts +1 -1
- package/src/helpers/fluidHelpers/index.ts +1 -1
- package/src/helpers/liquityV2Helpers/index.ts +1 -1
- package/src/helpers/llamaLendHelpers/index.ts +1 -1
- package/src/helpers/morphoBlueHelpers/index.ts +1 -1
- package/src/helpers/morphoMidnightHelpers/index.ts +1 -1
- package/src/helpers/sparkHelpers/index.ts +1 -1
- package/src/liquity/index.ts +24 -24
- package/src/liquityV2/index.ts +110 -76
- package/src/llamaLend/index.ts +15 -13
- package/src/maker/index.ts +19 -16
- package/src/moneymarket/moneymarketCommonService.ts +14 -2
- package/src/morphoBlue/index.ts +23 -20
- package/src/morphoBlue/merkl.ts +9 -6
- package/src/morphoMidnight/index.ts +13 -13
- package/src/portfolio/customDeFiData.ts +385 -0
- package/src/portfolio/index.ts +307 -331
- package/src/portfolio/lendingProtocols.ts +281 -0
- package/src/savings/index.ts +41 -4
- package/src/services/merkl.ts +209 -19
- package/src/services/priceService.ts +33 -30
- package/src/services/viem.ts +16 -0
- package/src/spark/index.ts +11 -8
- package/src/types/aave.ts +104 -1
- package/src/types/aaveV4.ts +50 -0
- package/src/types/common.ts +1 -0
- package/src/types/compound.ts +38 -2
- package/src/types/curveUsd.ts +17 -1
- package/src/types/fluid.ts +14 -0
- package/src/types/index.ts +1 -0
- package/src/types/liquity.ts +13 -1
- package/src/types/liquityV2.ts +26 -1
- package/src/types/llamaLend.ts +19 -1
- package/src/types/merkl.ts +20 -0
- package/src/types/morphoBlue.ts +3 -0
- package/src/types/portfolio.ts +191 -5
- package/src/types/savings/index.ts +12 -1
- package/src/types/spark.ts +25 -1
- package/src/umbrella/index.ts +7 -5
package/cjs/types/aave.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IncentiveData, LeverageType, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
1
|
+
import { EthAddress, IncentiveData, LeverageType, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
2
2
|
export declare enum AaveVersions {
|
|
3
3
|
AaveV1 = "v1",
|
|
4
4
|
AaveV2 = "v2default",
|
|
@@ -85,6 +85,8 @@ export interface AaveV3AssetData extends AaveAssetData {
|
|
|
85
85
|
liquidationBonus: string;
|
|
86
86
|
supplyIncentives: IncentiveData[];
|
|
87
87
|
borrowIncentives: IncentiveData[];
|
|
88
|
+
aTokenAddress?: EthAddress;
|
|
89
|
+
vTokenAddress?: EthAddress;
|
|
88
90
|
}
|
|
89
91
|
export type EModeCategoriesData = Record<number, EModeCategoryData>;
|
|
90
92
|
export type AaveAssetsData<T> = {
|
|
@@ -122,7 +124,12 @@ export type AaveUsedAssets<T> = {
|
|
|
122
124
|
};
|
|
123
125
|
export type AaveV2UsedAssets = AaveUsedAssets<AaveV2UsedAsset>;
|
|
124
126
|
export type AaveV3UsedAssets = AaveUsedAssets<AaveV3UsedAsset>;
|
|
125
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Fields aaveAnyGetAggregatedPositionData adds to every Aave V2/V3 position at runtime, on top of those declared
|
|
129
|
+
* below. Optional, so code that builds a position by hand keeps compiling.
|
|
130
|
+
*/
|
|
131
|
+
export type AavePositionAggregatedFields = Partial<Omit<AaveV3AggregatedPositionData, keyof MMPositionData | 'ratio' | 'collRatio' | 'safetyRatioWithLtvZeroFallback' | 'suppliedUsd' | 'borrowedUsd' | 'borrowLimitUsd' | 'suppliedCollateralUsd' | 'incentiveUsd' | 'totalInterestUsd'>>;
|
|
132
|
+
export interface AavePositionData extends MMPositionData, AavePositionAggregatedFields {
|
|
126
133
|
ratio: string;
|
|
127
134
|
minRatio: string;
|
|
128
135
|
collRatio: string;
|
|
@@ -140,6 +147,12 @@ export interface AavePositionData extends MMPositionData {
|
|
|
140
147
|
}
|
|
141
148
|
export interface AaveV2PositionData extends AavePositionData {
|
|
142
149
|
usedAssets: AaveV2UsedAssets;
|
|
150
|
+
eModeCategory?: number;
|
|
151
|
+
isInIsolationMode?: boolean;
|
|
152
|
+
isInSiloedMode?: boolean;
|
|
153
|
+
eModeCategories?: {
|
|
154
|
+
[key: number]: EModeCategoryDataMapping;
|
|
155
|
+
};
|
|
143
156
|
}
|
|
144
157
|
export interface AaveV3PositionData extends AavePositionData {
|
|
145
158
|
usedAssets: AaveV3UsedAssets;
|
|
@@ -188,3 +201,86 @@ export interface AaveHelperCommon {
|
|
|
188
201
|
selectedMarket: Partial<AaveMarketInfo>;
|
|
189
202
|
network?: NetworkNumber;
|
|
190
203
|
}
|
|
204
|
+
export interface SghoUserData {
|
|
205
|
+
shares: string;
|
|
206
|
+
balance: string;
|
|
207
|
+
maxDeposit: string;
|
|
208
|
+
maxWithdraw: string;
|
|
209
|
+
underlyingBalance: string;
|
|
210
|
+
}
|
|
211
|
+
export interface SghoData {
|
|
212
|
+
totalAssets: string;
|
|
213
|
+
totalSupply: string;
|
|
214
|
+
supplyCap: string;
|
|
215
|
+
/** Target savings rate as an APY percent (e.g. "4.25" for 4.25%). */
|
|
216
|
+
targetRate: string;
|
|
217
|
+
paused: boolean;
|
|
218
|
+
user: SghoUserData;
|
|
219
|
+
}
|
|
220
|
+
/** stkAAVE, stkGHO and sGHO of an address, from getStakeAaveData. */
|
|
221
|
+
export interface StakeAaveData {
|
|
222
|
+
activatedCooldown: string;
|
|
223
|
+
activatedCooldownAmount: string;
|
|
224
|
+
stkAaveRewardsBalance: string;
|
|
225
|
+
aaveRewardsBalance: string;
|
|
226
|
+
stkAaveBalance: string;
|
|
227
|
+
stkGhoBalance: string;
|
|
228
|
+
ghoMeritApy: string;
|
|
229
|
+
stkAaveApy: string;
|
|
230
|
+
sgho: SghoData;
|
|
231
|
+
}
|
|
232
|
+
export interface UmbrellaTokenInfo {
|
|
233
|
+
token: EthAddress;
|
|
234
|
+
/** USD, converted from the oracle's 8 decimals. */
|
|
235
|
+
price: string;
|
|
236
|
+
name: string;
|
|
237
|
+
symbol: string;
|
|
238
|
+
decimals: number;
|
|
239
|
+
}
|
|
240
|
+
export interface UmbrellaRewardTokenData {
|
|
241
|
+
rewardTokenData: UmbrellaTokenInfo;
|
|
242
|
+
maxEmissionPerSecond: bigint;
|
|
243
|
+
distributionEnd: bigint;
|
|
244
|
+
}
|
|
245
|
+
export interface UmbrellaStakingAccountData {
|
|
246
|
+
stakeUserBalance: string;
|
|
247
|
+
rewardsTokenUserData: {
|
|
248
|
+
reward: EthAddress;
|
|
249
|
+
currentReward: string;
|
|
250
|
+
}[];
|
|
251
|
+
userCooldownAmount: string;
|
|
252
|
+
userEndOfCooldown: bigint | string;
|
|
253
|
+
userWithdrawalWindow: bigint | string;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* One Umbrella stake token of an address, from getUmbrellaData: the view contracts' structs merged, with the amounts
|
|
257
|
+
* the app reads converted to decimal strings. The bigint fields are the views' raw values, as the SDK passes them.
|
|
258
|
+
*/
|
|
259
|
+
export interface UmbrellaStakingTokenData {
|
|
260
|
+
stakeTokenData: UmbrellaTokenInfo;
|
|
261
|
+
totalAssets: string;
|
|
262
|
+
targetLiquidity: string;
|
|
263
|
+
isStakeConfigured: boolean;
|
|
264
|
+
rewardsTokenData: UmbrellaRewardTokenData[];
|
|
265
|
+
stakeToken: EthAddress;
|
|
266
|
+
stakeUserBalance: bigint;
|
|
267
|
+
rewardsTokenUserData: {
|
|
268
|
+
reward: EthAddress;
|
|
269
|
+
currentReward: bigint;
|
|
270
|
+
}[];
|
|
271
|
+
stkToken: EthAddress;
|
|
272
|
+
totalShares: string;
|
|
273
|
+
stkUnderlyingToken: EthAddress;
|
|
274
|
+
aToken: EthAddress;
|
|
275
|
+
cooldownPeriod: bigint;
|
|
276
|
+
unstakeWindow: bigint;
|
|
277
|
+
stkTokenToWaTokenRate: string;
|
|
278
|
+
waTokenToATokenRate: string;
|
|
279
|
+
rewardsEmissionRates: string[];
|
|
280
|
+
userCooldownAmount: bigint;
|
|
281
|
+
userEndOfCooldown: bigint;
|
|
282
|
+
userWithdrawalWindow: bigint;
|
|
283
|
+
account: UmbrellaStakingAccountData;
|
|
284
|
+
}
|
|
285
|
+
/** Keyed by Umbrella stake (UmbrellaGHO, UmbrellaUSDC, UmbrellaUSDT, UmbrellaETH). */
|
|
286
|
+
export type UmbrellaStakingData = Record<string, UmbrellaStakingTokenData>;
|
package/cjs/types/aaveV4.d.ts
CHANGED
|
@@ -184,6 +184,7 @@ export interface AaveV4AggregatedPositionData {
|
|
|
184
184
|
totalInterestUsd: string;
|
|
185
185
|
currentVolatilePairRatio?: string;
|
|
186
186
|
minRatio: string;
|
|
187
|
+
exposure: string;
|
|
187
188
|
}
|
|
188
189
|
export type AaveV4UsedReserveAssets = Record<string, AaveV4UsedReserveAsset>;
|
|
189
190
|
export interface AaveV4AccountData extends AaveV4AggregatedPositionData {
|
|
@@ -191,3 +192,47 @@ export interface AaveV4AccountData extends AaveV4AggregatedPositionData {
|
|
|
191
192
|
healthFactor: string;
|
|
192
193
|
riskPremiumBps: number;
|
|
193
194
|
}
|
|
195
|
+
/** One Aave V4 tokenized spoke (Lend vault) as the view contract returns it for a user. */
|
|
196
|
+
export interface AaveV4TokenizationSpokeData {
|
|
197
|
+
underlyingAsset: EthAddress;
|
|
198
|
+
assetId: string;
|
|
199
|
+
decimals: number;
|
|
200
|
+
spoke: EthAddress;
|
|
201
|
+
spokeActive: boolean;
|
|
202
|
+
spokeHalted: boolean;
|
|
203
|
+
spokeDepositCap: string;
|
|
204
|
+
spokeTotalAssets: string;
|
|
205
|
+
spokeTotalShares: string;
|
|
206
|
+
hub: EthAddress;
|
|
207
|
+
hubLiquidity: string;
|
|
208
|
+
hubDrawnRate: string;
|
|
209
|
+
convertToShares: string;
|
|
210
|
+
convertToAssets: string;
|
|
211
|
+
user: EthAddress;
|
|
212
|
+
userSuppliedAssets: string;
|
|
213
|
+
userSuppliedShares: string;
|
|
214
|
+
}
|
|
215
|
+
/** Parsed tokenization spoke data with human-readable supplied amounts for display */
|
|
216
|
+
export interface AaveV4TokenizationSpokeDataParsed {
|
|
217
|
+
vaultAddress: EthAddress;
|
|
218
|
+
key: string | null;
|
|
219
|
+
symbol: string;
|
|
220
|
+
hubKey: string;
|
|
221
|
+
spokeActive: boolean;
|
|
222
|
+
spokeHalted: boolean;
|
|
223
|
+
/** Deposit cap in asset units (wei string) */
|
|
224
|
+
spokeDepositCap: string;
|
|
225
|
+
/** Total assets currently in spoke in asset units (wei string) */
|
|
226
|
+
spokeTotalAssets: string;
|
|
227
|
+
/** Available hub liquidity in asset units (wei string) */
|
|
228
|
+
hubLiquidity: string;
|
|
229
|
+
/** The conversion rate from assets to shares expressed in asset units. */
|
|
230
|
+
convertToShares: string;
|
|
231
|
+
userSuppliedAssetsEth: string;
|
|
232
|
+
userSuppliedSharesEth: string;
|
|
233
|
+
userSuppliedAssets: string;
|
|
234
|
+
userSuppliedShares: string;
|
|
235
|
+
underlyingAsset: EthAddress;
|
|
236
|
+
spoke: EthAddress;
|
|
237
|
+
decimals: number;
|
|
238
|
+
}
|
package/cjs/types/common.d.ts
CHANGED
package/cjs/types/common.js
CHANGED
|
@@ -30,6 +30,7 @@ var LeverageType;
|
|
|
30
30
|
LeverageType["Short"] = "short";
|
|
31
31
|
LeverageType["VolatilePair"] = "volatile-pair";
|
|
32
32
|
LeverageType["VolatilePairReverse"] = "volatile-pair-reverse";
|
|
33
|
+
LeverageType["StablePair"] = "stable-pair";
|
|
33
34
|
LeverageType["None"] = "";
|
|
34
35
|
})(LeverageType || (exports.LeverageType = LeverageType = {}));
|
|
35
36
|
var NetworkNumber;
|
package/cjs/types/compound.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export interface CompoundAssetData extends MMAssetData {
|
|
|
52
52
|
sortIndex?: number;
|
|
53
53
|
}
|
|
54
54
|
export interface CompoundV2AssetData extends CompoundAssetData {
|
|
55
|
+
exchangeRate?: string;
|
|
55
56
|
}
|
|
56
57
|
export interface CompoundV3AssetData extends CompoundAssetData {
|
|
57
58
|
borrowCollateralFactor: string;
|
|
@@ -63,6 +64,17 @@ export interface CompoundV3AssetData extends CompoundAssetData {
|
|
|
63
64
|
supplyCap: string;
|
|
64
65
|
priceInBaseAsset: string;
|
|
65
66
|
canBeWithdrawn: boolean;
|
|
67
|
+
tokenAddr?: EthAddress;
|
|
68
|
+
isBase?: boolean;
|
|
69
|
+
baseBorrowMin?: string;
|
|
70
|
+
baseTrackingBorrowRewardsSpeed?: string;
|
|
71
|
+
baseTrackingSupplyRewardsSpeed?: string;
|
|
72
|
+
borrowIndex?: string;
|
|
73
|
+
supplyIndex?: string;
|
|
74
|
+
trackingBorrowIndex?: string;
|
|
75
|
+
trackingSupplyIndex?: string;
|
|
76
|
+
rewardSupplySpeed?: string;
|
|
77
|
+
rewardBorrowSpeed?: string;
|
|
66
78
|
}
|
|
67
79
|
export interface CompoundAssetsData<T> {
|
|
68
80
|
[token: string]: T;
|
|
@@ -125,9 +137,21 @@ export interface CompoundPositionData extends MMPositionData {
|
|
|
125
137
|
isSubscribedToAutomation?: boolean;
|
|
126
138
|
automationResubscribeRequired?: boolean;
|
|
127
139
|
}
|
|
128
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Fields getCompoundV2AggregatedData adds to every Compound V2 position at runtime — a subset of
|
|
142
|
+
* CompoundAggregatedPositionData. Optional, so code that builds a position by hand keeps compiling.
|
|
143
|
+
*/
|
|
144
|
+
export type CompoundV2PositionAggregatedFields = Partial<Pick<CompoundAggregatedPositionData, 'suppliedCollateralUsd' | 'liquidationLimitUsd' | 'leftToBorrowUsd' | 'collRatio' | 'leveragedType' | 'leveragedAsset' | 'liquidationPrice'>>;
|
|
145
|
+
/**
|
|
146
|
+
* Fields getCompoundV3AggregatedData adds to every Compound V3 position at runtime, on top of those declared in
|
|
147
|
+
* CompoundPositionData. Optional, so code that builds a position by hand keeps compiling.
|
|
148
|
+
*/
|
|
149
|
+
export type CompoundV3PositionAggregatedFields = Partial<Omit<CompoundAggregatedPositionData, keyof MMPositionData | 'ratio' | 'minRatio' | 'suppliedUsd' | 'borrowedUsd' | 'borrowLimitUsd' | 'incentiveUsd' | 'totalInterestUsd'>>;
|
|
150
|
+
export interface CompoundV2PositionData extends CompoundPositionData, CompoundV2PositionAggregatedFields {
|
|
129
151
|
usedAssets: CompoundV2UsedAssets;
|
|
152
|
+
borrowStableSupplyUnstable?: boolean;
|
|
130
153
|
}
|
|
131
|
-
export interface CompoundV3PositionData extends CompoundPositionData {
|
|
154
|
+
export interface CompoundV3PositionData extends CompoundPositionData, CompoundV3PositionAggregatedFields {
|
|
132
155
|
usedAssets: CompoundV3UsedAssets;
|
|
156
|
+
isAllowed?: boolean;
|
|
133
157
|
}
|
package/cjs/types/curveUsd.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export interface CrvUSDGlobalMarketData {
|
|
|
60
60
|
leftToBorrow: string;
|
|
61
61
|
bands: BandData[];
|
|
62
62
|
loanDiscount: string;
|
|
63
|
+
A?: bigint;
|
|
63
64
|
}
|
|
64
65
|
export interface CrvUSDAggregatedPositionData {
|
|
65
66
|
ratio: string;
|
|
@@ -94,7 +95,8 @@ export interface CrvUSDUsedAsset {
|
|
|
94
95
|
export interface CrvUSDUsedAssets {
|
|
95
96
|
[key: string]: CrvUSDUsedAsset;
|
|
96
97
|
}
|
|
97
|
-
export
|
|
98
|
+
export type CrvUSDPositionAggregatedFields = Partial<Pick<CrvUSDAggregatedPositionData, 'borrowLimitUsd' | 'minAllowedRatio' | 'collFactor' | 'leveragedType' | 'leveragedAsset' | 'liquidationPrice'>>;
|
|
99
|
+
export interface CrvUSDUserData extends CrvUSDPositionAggregatedFields {
|
|
98
100
|
debtAmount: string;
|
|
99
101
|
health: string;
|
|
100
102
|
healthPercent: string;
|
|
@@ -119,4 +121,10 @@ export interface CrvUSDUserData {
|
|
|
119
121
|
netApy: string;
|
|
120
122
|
totalInterestUsd: string;
|
|
121
123
|
incentiveUsd: string;
|
|
124
|
+
marketCollateralAmount?: bigint;
|
|
125
|
+
curveUsdCollateralAmount?: bigint;
|
|
126
|
+
N?: bigint;
|
|
127
|
+
bandRange?: readonly [bigint, bigint];
|
|
128
|
+
usersBands?: readonly [readonly bigint[], readonly bigint[]];
|
|
129
|
+
isInSoftLiquidation?: boolean;
|
|
122
130
|
}
|
package/cjs/types/fluid.d.ts
CHANGED
|
@@ -459,3 +459,16 @@ export interface FluidFTokenDataStructOutput {
|
|
|
459
459
|
rewardsRate: bigint;
|
|
460
460
|
withdrawable: bigint;
|
|
461
461
|
}
|
|
462
|
+
/** One Fluid lending (fToken) deposit of an address, from getAllUserEarnPositionsWithFTokens and getFluidDepositData. */
|
|
463
|
+
export interface FluidEarnPositionData {
|
|
464
|
+
fTokenAddress: string | undefined;
|
|
465
|
+
fTokenSymbol: string;
|
|
466
|
+
decimals: string;
|
|
467
|
+
totalDeposited: string;
|
|
468
|
+
withdrawable: string;
|
|
469
|
+
apy: string;
|
|
470
|
+
depositRate: string;
|
|
471
|
+
withdrawRate: string;
|
|
472
|
+
deposited: string;
|
|
473
|
+
depositedShares: string;
|
|
474
|
+
}
|
package/cjs/types/index.d.ts
CHANGED
package/cjs/types/index.js
CHANGED
|
@@ -31,4 +31,5 @@ __exportStar(require("./merkl"), exports);
|
|
|
31
31
|
__exportStar(require("./savings"), exports);
|
|
32
32
|
__exportStar(require("./common"), exports);
|
|
33
33
|
__exportStar(require("./aaveV4"), exports);
|
|
34
|
+
__exportStar(require("./claiming"), exports);
|
|
34
35
|
__exportStar(require("./lendingSummary"), exports);
|
package/cjs/types/liquity.d.ts
CHANGED
|
@@ -32,3 +32,15 @@ export interface LiquityTroveInfo {
|
|
|
32
32
|
totalInterestUsd: string;
|
|
33
33
|
incentiveUsd: string;
|
|
34
34
|
}
|
|
35
|
+
/** LQTY staking and the LUSD stability pool deposit of an address, from getLiquityStakingData. */
|
|
36
|
+
export interface LiquityStakingData {
|
|
37
|
+
totalLUSDDeposited: string;
|
|
38
|
+
totalLQTYStaked: string;
|
|
39
|
+
stakedLQTY: string;
|
|
40
|
+
stakedLUSDBalance: string;
|
|
41
|
+
rewardETH: string;
|
|
42
|
+
rewardLUSD: string;
|
|
43
|
+
stabilityRewardETH: string;
|
|
44
|
+
stabilityRewardLQTY: string;
|
|
45
|
+
showStakingBalances: boolean;
|
|
46
|
+
}
|
package/cjs/types/liquityV2.d.ts
CHANGED
|
@@ -123,3 +123,27 @@ export interface LiquityV2TroveData {
|
|
|
123
123
|
lastInterestRateAdjTime: string;
|
|
124
124
|
exposure: string;
|
|
125
125
|
}
|
|
126
|
+
/** The stability pool deposit of an address in one market, from getLiquityV2Staking. */
|
|
127
|
+
export interface LiquityV2StakingData {
|
|
128
|
+
totalBOLDDeposited: string;
|
|
129
|
+
stakedBOLDBalance: string;
|
|
130
|
+
stabilityRewardColl: string;
|
|
131
|
+
stabilityRewardYield: string;
|
|
132
|
+
showStakingBalances: boolean;
|
|
133
|
+
debtTokenBalance: string;
|
|
134
|
+
stabilityPoolApy: string;
|
|
135
|
+
}
|
|
136
|
+
/** sBOLD, yBOLD and stYBOLD of an address, from getLiquitySAndYBold. */
|
|
137
|
+
export interface LiquityV2SBoldYBoldData {
|
|
138
|
+
spApy: string;
|
|
139
|
+
yBoldApy: string;
|
|
140
|
+
totalBoldDepositedSBold: string;
|
|
141
|
+
boldRateSBold: string;
|
|
142
|
+
maxWithdrawSBold: string;
|
|
143
|
+
totalBoldDepositedYBold: string;
|
|
144
|
+
boldRateYBold: string;
|
|
145
|
+
maxWithdrawYBold: string;
|
|
146
|
+
sBoldBalance: string;
|
|
147
|
+
yBoldBalance: string;
|
|
148
|
+
stYBoldBalance: string;
|
|
149
|
+
}
|
package/cjs/types/llamaLend.d.ts
CHANGED
|
@@ -138,7 +138,8 @@ export interface LlamaLendUsedAsset {
|
|
|
138
138
|
export interface LlamaLendUsedAssets {
|
|
139
139
|
[key: string]: LlamaLendUsedAsset;
|
|
140
140
|
}
|
|
141
|
-
export
|
|
141
|
+
export type LlamaLendPositionAggregatedFields = Partial<Pick<LlamaLendAggregatedPositionData, 'borrowLimitUsd' | 'minAllowedRatio' | 'collFactor' | 'leveragedType' | 'leveragedAsset' | 'liquidationPrice' | 'netApy' | 'incentiveUsd' | 'totalInterestUsd'>>;
|
|
142
|
+
export interface LlamaLendUserData extends LlamaLendPositionAggregatedFields {
|
|
142
143
|
debtAmount: string;
|
|
143
144
|
health: string;
|
|
144
145
|
healthPercent: string;
|
|
@@ -157,4 +158,14 @@ export interface LlamaLendUserData {
|
|
|
157
158
|
loanExists: boolean;
|
|
158
159
|
borrowRate?: string;
|
|
159
160
|
exposure: string;
|
|
161
|
+
collateralPrice?: bigint;
|
|
162
|
+
marketCollateralAmount?: bigint;
|
|
163
|
+
debtTokenCollateralAmount?: bigint;
|
|
164
|
+
N?: bigint;
|
|
165
|
+
bandRange?: readonly [bigint, bigint];
|
|
166
|
+
usersBands?: readonly [readonly bigint[], readonly bigint[]];
|
|
167
|
+
collRatio?: bigint;
|
|
168
|
+
isInSoftLiquidation?: boolean;
|
|
169
|
+
debtTokenSuppliedShares?: bigint;
|
|
170
|
+
debtTokenSuppliedAssets?: bigint;
|
|
160
171
|
}
|
package/cjs/types/merkl.d.ts
CHANGED
|
@@ -126,6 +126,24 @@ export type MerklOpportunity = {
|
|
|
126
126
|
}[];
|
|
127
127
|
};
|
|
128
128
|
};
|
|
129
|
+
/** One entry of Merkl's campaign listing: a campaign plus the opportunity it rewards. */
|
|
130
|
+
export type MerklCampaignListItem = MerklCampaign & {
|
|
131
|
+
opportunityId: string;
|
|
132
|
+
type: string;
|
|
133
|
+
rewardToken?: MerklOpportunity['rewardsRecord']['breakdowns'][number]['token'];
|
|
134
|
+
};
|
|
135
|
+
/** One bucket of an opportunity's APR history (`apr` is the last value recorded in the bucket). */
|
|
136
|
+
export type MerklAprRecord = {
|
|
137
|
+
timestamp: string;
|
|
138
|
+
date: string;
|
|
139
|
+
apr: number;
|
|
140
|
+
open: number;
|
|
141
|
+
min: number;
|
|
142
|
+
max: number;
|
|
143
|
+
avg: number;
|
|
144
|
+
samples: number;
|
|
145
|
+
hasUntrustedContribution: boolean;
|
|
146
|
+
};
|
|
129
147
|
export type MerkleRewardInfo = {
|
|
130
148
|
apy: string;
|
|
131
149
|
rewardTokenSymbol: string;
|
package/cjs/types/portfolio.d.ts
CHANGED
|
@@ -1,20 +1,47 @@
|
|
|
1
|
-
import { AaveV2MarketData, AaveV2PositionData, AaveV3MarketData, AaveV3PositionData, AaveVersions } from './aave';
|
|
1
|
+
import { AaveV2MarketData, AaveV2PositionData, AaveV3MarketData, AaveV3PositionData, AaveVersions, StakeAaveData, UmbrellaStakingData } from './aave';
|
|
2
2
|
import { AaveV4AccountData, AaveV4SpokeData, AaveV4SpokesType } from './aaveV4';
|
|
3
|
+
import { AaveRewardsClaimableToken, EthenaAirdropClaimableToken, KingRewardsClaimableToken, MerklRewardsClaimableToken, SparkAirdropClaimableToken, SparkRewardsClaimableToken, UniswapAirdropClaimableToken } from './claiming';
|
|
3
4
|
import { EthAddress } from './common';
|
|
4
5
|
import { CompoundV2MarketsData, CompoundV2PositionData, CompoundV3MarketsData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
5
6
|
import { CrvUSDGlobalMarketData, CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
6
|
-
import { FluidMarketData, FluidVaultData } from './fluid';
|
|
7
|
-
import { LiquityTroveInfo } from './liquity';
|
|
8
|
-
import { LiquityV2MarketData } from './liquityV2';
|
|
7
|
+
import { FluidEarnPositionData, FluidMarketData, FluidVaultData } from './fluid';
|
|
8
|
+
import { LiquityStakingData, LiquityTroveInfo } from './liquity';
|
|
9
|
+
import { LiquityV2MarketData, LiquityV2SBoldYBoldData, LiquityV2StakingData, LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
|
|
9
10
|
import { LlamaLendGlobalMarketData, LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
10
11
|
import { CdpData, IlkInfo } from './maker';
|
|
11
|
-
import { MorphoBlueMarketInfo, MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
+
import { MorphoBlueEarnData, MorphoBlueMarketInfo, MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
13
|
import { MorphoMidnightMarketInfo, MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
13
14
|
import { SparkMarketsData, SparkPositionData, SparkVersions } from './spark';
|
|
14
15
|
export interface PortfolioProtocolData<T> {
|
|
15
16
|
error: string;
|
|
16
17
|
data: T | null;
|
|
17
18
|
}
|
|
19
|
+
/** A failed fetch of a protocol that, when it succeeds, getPortfolioData returns unwrapped rather than as `{ error, data }`. */
|
|
20
|
+
export interface PortfolioProtocolError {
|
|
21
|
+
error: string;
|
|
22
|
+
data: null;
|
|
23
|
+
}
|
|
24
|
+
/** What getPortfolioData reads besides markets. */
|
|
25
|
+
export interface PortfolioDataOptions {
|
|
26
|
+
/** positions (lending); default true. With false it comes back as {} and no lending position is read. */
|
|
27
|
+
positions?: boolean;
|
|
28
|
+
/** stakingPositions; default true. With false it comes back as {} and no staking source is read. */
|
|
29
|
+
staking?: boolean;
|
|
30
|
+
/** rewardsData; default true. With false it comes back as {} and no rewards source is read. */
|
|
31
|
+
rewards?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Liquity V2 troves in positions[address].liquityV2; default false, as the DeFi Saver app reads them on its own.
|
|
34
|
+
* Mainnet only: elsewhere liquityV2 is {}. Needs positions.
|
|
35
|
+
*/
|
|
36
|
+
liquityV2?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** One Liquity V2 market's troves of an address, by trove id — with an error when the ids or any trove failed to load. */
|
|
39
|
+
export interface PortfolioLiquityV2Troves {
|
|
40
|
+
error: string;
|
|
41
|
+
data: {
|
|
42
|
+
[troveId: string]: LiquityV2TroveData;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
18
45
|
export interface PortfolioPositionsDataForAddress {
|
|
19
46
|
aaveV3: {
|
|
20
47
|
[key in AaveVersions]?: PortfolioProtocolData<AaveV3PositionData>;
|
|
@@ -56,10 +83,102 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
56
83
|
aaveV4: {
|
|
57
84
|
[key in AaveV4SpokesType]?: PortfolioProtocolData<AaveV4AccountData>;
|
|
58
85
|
};
|
|
86
|
+
/** Only with the liquityV2 option. Every trove the address holds, by market. */
|
|
87
|
+
liquityV2?: {
|
|
88
|
+
[key in LiquityV2Versions]?: PortfolioLiquityV2Troves;
|
|
89
|
+
};
|
|
59
90
|
}
|
|
60
91
|
export interface PortfolioPositionsData {
|
|
61
92
|
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
62
93
|
}
|
|
94
|
+
export declare enum PortfolioProtocol {
|
|
95
|
+
AaveV2 = "aaveV2",
|
|
96
|
+
AaveV3 = "aaveV3",
|
|
97
|
+
AaveV4 = "aaveV4",
|
|
98
|
+
CompoundV2 = "compoundV2",
|
|
99
|
+
CompoundV3 = "compoundV3",
|
|
100
|
+
Spark = "spark",
|
|
101
|
+
MorphoBlue = "morphoBlue",
|
|
102
|
+
MorphoMidnight = "morphoMidnight",
|
|
103
|
+
CrvUsd = "crvUsd",
|
|
104
|
+
LlamaLend = "llamaLend",
|
|
105
|
+
Maker = "maker",
|
|
106
|
+
Liquity = "liquity",
|
|
107
|
+
LiquityV2 = "liquityV2",
|
|
108
|
+
Fluid = "fluid"
|
|
109
|
+
}
|
|
110
|
+
export interface CustomDeFiDataOptions {
|
|
111
|
+
/** Defaults to every protocol. */
|
|
112
|
+
protocols?: PortfolioProtocol[];
|
|
113
|
+
fetchStaking?: boolean;
|
|
114
|
+
fetchRewards?: boolean;
|
|
115
|
+
/** Keep Aave V3 / Spark positions with no supply so the eMode category is available. */
|
|
116
|
+
returnEmptyEModePositions?: boolean;
|
|
117
|
+
fetchFluidMarkets?: boolean;
|
|
118
|
+
isSim?: boolean;
|
|
119
|
+
/** viem multicall calldata cap in bytes; defaults to 250k (2k when isSim). */
|
|
120
|
+
batchSize?: number;
|
|
121
|
+
/** Every read is made at this block; defaults to latest. */
|
|
122
|
+
blockNumber?: number;
|
|
123
|
+
}
|
|
124
|
+
export interface CustomDeFiData {
|
|
125
|
+
positions: PortfolioPositionsData;
|
|
126
|
+
stakingPositions: Record<string, any>;
|
|
127
|
+
rewardsData: Record<string, any>;
|
|
128
|
+
/** Includes Fluid's and Maker's markets, filled when their protocols (and fetchFluidMarkets) are requested. */
|
|
129
|
+
markets: ShifterPortfolioMarketsData;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The staking positions getPortfolioData returns for an address. The shapes are uneven, and the DeFi Saver app
|
|
133
|
+
* parses them as they are: a protocol read once per address comes back unwrapped on success, as
|
|
134
|
+
* `{ error, data: null }` on failure, and as {} (or Fluid's `{ error: '', data: {} }`) on a network it is not read on.
|
|
135
|
+
*/
|
|
136
|
+
export interface PortfolioStakingPositionsDataForAddress {
|
|
137
|
+
/** stkAAVE, stkGHO and sGHO; mainnet only. */
|
|
138
|
+
aaveV3: StakeAaveData | PortfolioProtocolError | {};
|
|
139
|
+
/** Morpho Blue supply without a borrow (Earn), by market; only markets with a deposit or an error. */
|
|
140
|
+
morphoBlue: {
|
|
141
|
+
[key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBlueEarnData>;
|
|
142
|
+
};
|
|
143
|
+
compoundV3: Record<string, never>;
|
|
144
|
+
spark: Record<string, never>;
|
|
145
|
+
aaveV2: Record<string, never>;
|
|
146
|
+
compoundV2: Record<string, never>;
|
|
147
|
+
/** LQTY staking and the LUSD stability pool; mainnet only. */
|
|
148
|
+
liquity: LiquityStakingData | PortfolioProtocolError | {};
|
|
149
|
+
/** Stability pool deposits, by market; mainnet only, legacy markets left out. */
|
|
150
|
+
liquityV2: {
|
|
151
|
+
[key in LiquityV2Versions]?: PortfolioProtocolData<LiquityV2StakingData>;
|
|
152
|
+
};
|
|
153
|
+
/** Fluid lending (fToken) deposits; `{ error: '', data: {} }` on a network without Fluid. */
|
|
154
|
+
fluid: FluidEarnPositionData[] | PortfolioProtocolError | {
|
|
155
|
+
error: string;
|
|
156
|
+
data: Record<string, never>;
|
|
157
|
+
};
|
|
158
|
+
/** Umbrella stakes; absent off mainnet. */
|
|
159
|
+
umbrella?: UmbrellaStakingData | PortfolioProtocolError;
|
|
160
|
+
/** sBOLD, yBOLD and stYBOLD; data is null off mainnet. */
|
|
161
|
+
liquityV2SBoldYBold: PortfolioProtocolData<LiquityV2SBoldYBoldData>;
|
|
162
|
+
}
|
|
163
|
+
export type PortfolioStakingPositionsData = Record<EthAddress, PortfolioStakingPositionsDataForAddress>;
|
|
164
|
+
/** The claimable rewards getPortfolioData returns for an address. Off mainnet only Merkl and Aave V3 are read. */
|
|
165
|
+
export interface PortfolioRewardsDataForAddress {
|
|
166
|
+
merkl: PortfolioProtocolData<MerklRewardsClaimableToken[]>;
|
|
167
|
+
aaveV3: {
|
|
168
|
+
[key in AaveVersions]?: PortfolioProtocolData<AaveRewardsClaimableToken[]>;
|
|
169
|
+
};
|
|
170
|
+
spark: {
|
|
171
|
+
[key in SparkVersions]?: PortfolioProtocolData<SparkRewardsClaimableToken[]>;
|
|
172
|
+
};
|
|
173
|
+
/** The SPK airdrop. */
|
|
174
|
+
spk: PortfolioProtocolData<SparkAirdropClaimableToken[]>;
|
|
175
|
+
king: PortfolioProtocolData<KingRewardsClaimableToken[]>;
|
|
176
|
+
/** {} off mainnet. */
|
|
177
|
+
ethena: PortfolioProtocolData<EthenaAirdropClaimableToken[]> | {};
|
|
178
|
+
uniswap: PortfolioProtocolData<UniswapAirdropClaimableToken[]>;
|
|
179
|
+
}
|
|
180
|
+
export type PortfolioRewardsData = Record<EthAddress, PortfolioRewardsDataForAddress>;
|
|
181
|
+
/** The `markets` getPortfolioData returns: every market it read, by protocol, keyed by market or spoke. */
|
|
63
182
|
export interface PortfolioMarketsData {
|
|
64
183
|
morphoMarketsData: Record<string, MorphoBlueMarketInfo>;
|
|
65
184
|
morphoMidnightMarketsData: Record<string, MorphoMidnightMarketInfo>;
|
|
@@ -72,6 +191,44 @@ export interface PortfolioMarketsData {
|
|
|
72
191
|
llamaLendMarketsData: Record<string, LlamaLendGlobalMarketData>;
|
|
73
192
|
liquityV2MarketsData: Record<string, LiquityV2MarketData>;
|
|
74
193
|
aaveV4SpokesData: Record<string, AaveV4SpokeData>;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* The `markets` getShifterPortfolioData returns: the portfolio's markets, plus Fluid's and Maker's, which the shifter
|
|
197
|
+
* offers as destinations. Kept apart from PortfolioMarketsData, which getPortfolioData does not fill these into.
|
|
198
|
+
*/
|
|
199
|
+
export interface ShifterPortfolioMarketsData extends PortfolioMarketsData {
|
|
75
200
|
fluidMarketsData: Record<string, FluidMarketData>;
|
|
76
201
|
makerMarketsData: Record<string, IlkInfo>;
|
|
77
202
|
}
|
|
203
|
+
/** The markets that could not be read, by their key in PortfolioMarketsData, then by market or spoke: the error. */
|
|
204
|
+
export type PortfolioMarketsErrors = {
|
|
205
|
+
[key in keyof PortfolioMarketsData]?: Record<string, string>;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* What the portfolio fetch could not read and has no `{ error, data }` entry of its own to report it in. A key is
|
|
209
|
+
* present only when something under it failed; {} when everything was read.
|
|
210
|
+
*/
|
|
211
|
+
export interface PortfolioErrors {
|
|
212
|
+
/** Markets missing from `markets`; every position on such a market is an entry with an error. */
|
|
213
|
+
markets?: PortfolioMarketsErrors;
|
|
214
|
+
/** Addresses whose Maker vault list could not be read: their `maker` is {}, which would otherwise read as "no vaults". */
|
|
215
|
+
makerCdps?: Record<EthAddress, string>;
|
|
216
|
+
}
|
|
217
|
+
/** getPortfolioMarketsData's result. */
|
|
218
|
+
export interface PortfolioMarketsResult {
|
|
219
|
+
/** Every market read; one that failed is missing and named in `errors`. */
|
|
220
|
+
markets: PortfolioMarketsData;
|
|
221
|
+
errors: PortfolioMarketsErrors;
|
|
222
|
+
}
|
|
223
|
+
/** getPortfolioUserData's result: what is read per address. */
|
|
224
|
+
export interface PortfolioUserData {
|
|
225
|
+
positions: PortfolioPositionsData;
|
|
226
|
+
stakingPositions: PortfolioStakingPositionsData;
|
|
227
|
+
rewardsData: PortfolioRewardsData;
|
|
228
|
+
errors: Pick<PortfolioErrors, 'makerCdps'>;
|
|
229
|
+
}
|
|
230
|
+
/** getPortfolioData's result. */
|
|
231
|
+
export interface PortfolioData extends Omit<PortfolioUserData, 'errors'> {
|
|
232
|
+
markets: PortfolioMarketsData;
|
|
233
|
+
errors: PortfolioErrors;
|
|
234
|
+
}
|
package/cjs/types/portfolio.js
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PortfolioProtocol = void 0;
|
|
4
|
+
var PortfolioProtocol;
|
|
5
|
+
(function (PortfolioProtocol) {
|
|
6
|
+
PortfolioProtocol["AaveV2"] = "aaveV2";
|
|
7
|
+
PortfolioProtocol["AaveV3"] = "aaveV3";
|
|
8
|
+
PortfolioProtocol["AaveV4"] = "aaveV4";
|
|
9
|
+
PortfolioProtocol["CompoundV2"] = "compoundV2";
|
|
10
|
+
PortfolioProtocol["CompoundV3"] = "compoundV3";
|
|
11
|
+
PortfolioProtocol["Spark"] = "spark";
|
|
12
|
+
PortfolioProtocol["MorphoBlue"] = "morphoBlue";
|
|
13
|
+
PortfolioProtocol["MorphoMidnight"] = "morphoMidnight";
|
|
14
|
+
PortfolioProtocol["CrvUsd"] = "crvUsd";
|
|
15
|
+
PortfolioProtocol["LlamaLend"] = "llamaLend";
|
|
16
|
+
PortfolioProtocol["Maker"] = "maker";
|
|
17
|
+
PortfolioProtocol["Liquity"] = "liquity";
|
|
18
|
+
PortfolioProtocol["LiquityV2"] = "liquityV2";
|
|
19
|
+
PortfolioProtocol["Fluid"] = "fluid";
|
|
20
|
+
})(PortfolioProtocol || (exports.PortfolioProtocol = PortfolioProtocol = {}));
|
|
@@ -20,4 +20,12 @@ export interface SavingsVaultData {
|
|
|
20
20
|
asset: string;
|
|
21
21
|
optionType: string;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
/** The key of every savings vault getSavingsData reads. */
|
|
24
|
+
export type SavingsVaultKey = MorphoVaultType | YearnVaultType | MakerDsrType | SkySavingsType | SparkSavingsVaultType | SummerVaultType | YearnV3VaultType;
|
|
25
|
+
export type SavingsData = Partial<Record<SavingsVaultKey, SavingsVaultData>>;
|
|
26
|
+
/** Why each vault that was read for a network came back without data. */
|
|
27
|
+
export type SavingsErrors = Partial<Record<SavingsVaultKey, string>>;
|
|
28
|
+
export interface SavingsDataWithErrors {
|
|
29
|
+
data: SavingsData;
|
|
30
|
+
errors: SavingsErrors;
|
|
31
|
+
}
|