@defisaver/positions-sdk 2.1.96 → 2.1.98-aave-v4-apy-2
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/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +64 -64
- package/cjs/aaveV3/index.js +3 -3
- package/cjs/aaveV4/index.js +2 -0
- package/cjs/config/contracts.d.ts +61 -1
- package/cjs/config/contracts.js +2 -2
- package/cjs/contracts.d.ts +2963 -82
- package/cjs/helpers/aaveV4Helpers/index.d.ts +11 -1
- package/cjs/helpers/aaveV4Helpers/index.js +58 -1
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/savings/morphoVaults/index.js +17 -17
- package/cjs/services/utils.d.ts +1 -1
- package/cjs/services/utils.js +2 -1
- package/cjs/types/aaveV4.d.ts +2 -0
- package/esm/aaveV3/index.js +3 -3
- package/esm/aaveV4/index.js +2 -0
- package/esm/config/contracts.d.ts +61 -1
- package/esm/config/contracts.js +2 -2
- package/esm/contracts.d.ts +2963 -82
- package/esm/helpers/aaveV4Helpers/index.d.ts +11 -1
- package/esm/helpers/aaveV4Helpers/index.js +56 -0
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/savings/morphoVaults/index.js +17 -17
- package/esm/services/utils.d.ts +1 -1
- package/esm/services/utils.js +2 -1
- package/esm/types/aaveV4.d.ts +2 -0
- package/package.json +48 -48
- package/src/aaveV2/index.ts +240 -240
- package/src/aaveV3/index.ts +634 -634
- package/src/aaveV3/merit.ts +97 -97
- package/src/aaveV3/merkl.ts +74 -74
- package/src/aaveV4/index.ts +238 -236
- package/src/aaveV4/lend.ts +185 -185
- package/src/claiming/aaveV3.ts +154 -154
- package/src/claiming/compV3.ts +22 -22
- package/src/claiming/ethena.ts +61 -61
- package/src/claiming/index.ts +12 -12
- package/src/claiming/king.ts +66 -66
- package/src/claiming/morphoBlue.ts +118 -118
- package/src/claiming/spark.ts +225 -225
- package/src/compoundV2/index.ts +245 -245
- package/src/compoundV3/index.ts +280 -280
- package/src/config/contracts.ts +1357 -1357
- package/src/constants/index.ts +10 -10
- package/src/contracts.ts +183 -183
- package/src/curveUsd/index.ts +254 -254
- package/src/eulerV2/index.ts +330 -330
- package/src/exchange/index.ts +25 -25
- package/src/fluid/index.ts +1800 -1800
- package/src/helpers/aaveHelpers/index.ts +203 -203
- package/src/helpers/aaveV4Helpers/index.ts +349 -291
- package/src/helpers/compoundHelpers/index.ts +280 -280
- package/src/helpers/curveUsdHelpers/index.ts +44 -44
- package/src/helpers/eulerHelpers/index.ts +230 -230
- package/src/helpers/fluidHelpers/index.ts +338 -338
- package/src/helpers/index.ts +11 -11
- package/src/helpers/liquityV2Helpers/index.ts +85 -85
- package/src/helpers/llamaLendHelpers/index.ts +56 -56
- package/src/helpers/makerHelpers/index.ts +52 -52
- package/src/helpers/morphoBlueHelpers/index.ts +406 -406
- package/src/helpers/sparkHelpers/index.ts +170 -170
- package/src/index.ts +51 -51
- package/src/liquity/index.ts +161 -161
- package/src/liquityV2/index.ts +703 -703
- package/src/llamaLend/index.ts +305 -305
- package/src/maker/index.ts +225 -225
- package/src/markets/aave/index.ts +118 -118
- package/src/markets/aave/marketAssets.ts +54 -54
- package/src/markets/aaveV4/index.ts +191 -191
- package/src/markets/compound/index.ts +243 -243
- package/src/markets/compound/marketsAssets.ts +97 -97
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2900 -2900
- package/src/markets/index.ts +29 -29
- package/src/markets/liquityV2/index.ts +102 -102
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +1370 -1370
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +12 -12
- package/src/moneymarket/moneymarketCommonService.ts +91 -91
- package/src/morphoBlue/index.ts +274 -274
- package/src/portfolio/index.ts +606 -606
- package/src/savings/index.ts +111 -111
- package/src/savings/makerDsr/index.ts +53 -53
- package/src/savings/makerDsr/options.ts +9 -9
- package/src/savings/morphoVaults/index.ts +80 -80
- package/src/savings/morphoVaults/options.ts +193 -193
- package/src/savings/skyOptions/index.ts +95 -95
- package/src/savings/skyOptions/options.ts +10 -10
- package/src/savings/sparkSavingsVaults/index.ts +60 -60
- package/src/savings/sparkSavingsVaults/options.ts +35 -35
- package/src/savings/summerVaults/index.ts +56 -56
- package/src/savings/summerVaults/options.ts +117 -117
- package/src/savings/yearnV3Vaults/index.ts +61 -61
- package/src/savings/yearnV3Vaults/options.ts +55 -55
- package/src/savings/yearnVaults/index.ts +73 -73
- package/src/savings/yearnVaults/options.ts +32 -32
- package/src/services/priceService.ts +278 -278
- package/src/services/utils.ts +122 -117
- package/src/services/viem.ts +57 -57
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +460 -460
- package/src/staking/eligibility.ts +105 -105
- package/src/staking/index.ts +1 -1
- package/src/staking/staking.ts +201 -201
- package/src/types/aave.ts +200 -200
- package/src/types/aaveV4.ts +179 -177
- package/src/types/claiming.ts +114 -114
- package/src/types/common.ts +117 -117
- package/src/types/compound.ts +147 -147
- package/src/types/curveUsd.ts +125 -125
- package/src/types/euler.ts +177 -177
- package/src/types/fluid.ts +486 -486
- package/src/types/index.ts +16 -16
- package/src/types/liquity.ts +31 -31
- package/src/types/liquityV2.ts +130 -130
- package/src/types/llamaLend.ts +163 -163
- package/src/types/maker.ts +64 -64
- package/src/types/merit.ts +1 -1
- package/src/types/merkl.ts +70 -70
- package/src/types/morphoBlue.ts +228 -228
- package/src/types/portfolio.ts +64 -64
- package/src/types/savings/index.ts +25 -25
- package/src/types/savings/makerDsr.ts +13 -13
- package/src/types/savings/morphoVaults.ts +32 -32
- package/src/types/savings/sky.ts +14 -14
- package/src/types/savings/sparkSavingsVaults.ts +15 -15
- package/src/types/savings/summerVaults.ts +24 -24
- package/src/types/savings/yearnV3Vaults.ts +17 -17
- package/src/types/savings/yearnVaults.ts +14 -14
- package/src/types/spark.ts +136 -136
- package/src/umbrella/index.ts +69 -69
- package/src/umbrella/umbrellaUtils.ts +29 -29
package/src/types/aaveV4.ts
CHANGED
|
@@ -1,177 +1,179 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EthAddress, IncentiveData, LeverageType, NetworkNumber,
|
|
3
|
-
} from './common';
|
|
4
|
-
|
|
5
|
-
export enum AaveV4HubsType {
|
|
6
|
-
AaveV4CoreHub = 'aave_v4_core_hub',
|
|
7
|
-
AaveV4PlusHub = 'aave_v4_plus_hub',
|
|
8
|
-
AaveV4PrimeHub = 'aave_v4_prime_hub',
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export enum AaveV4SpokesType {
|
|
12
|
-
AaveV4BluechipSpoke = 'aave_v4_bluechip_spoke',
|
|
13
|
-
AaveV4EthenaCorrelatedSpoke = 'aave_v4_ethena_correlated_spoke',
|
|
14
|
-
AaveV4EthenaEcosystemSpoke = 'aave_v4_ethena_ecosystem_spoke',
|
|
15
|
-
AaveV4EtherfiSpoke = 'aave_v4_etherfi_spoke',
|
|
16
|
-
AaveV4ForexSpoke = 'aave_v4_forex_spoke',
|
|
17
|
-
AaveV4GoldSpoke = 'aave_v4_gold_spoke',
|
|
18
|
-
AaveV4KelpSpoke = 'aave_v4_kelp_spoke',
|
|
19
|
-
AaveV4LidoSpoke = 'aave_v4_lido_spoke',
|
|
20
|
-
AaveV4LombardBtcSpoke = 'aave_v4_lombard_btc_spoke',
|
|
21
|
-
AaveV4MainSpoke = 'aave_v4_main_spoke',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface AaveV4HubInfo {
|
|
25
|
-
chainIds: NetworkNumber[],
|
|
26
|
-
label: string,
|
|
27
|
-
value: AaveV4HubsType,
|
|
28
|
-
address: EthAddress,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface AaveV4HubAssetOnChainData {
|
|
32
|
-
assetId: number,
|
|
33
|
-
drawnRate: bigint,
|
|
34
|
-
liquidity: bigint,
|
|
35
|
-
liquidityFee: number,
|
|
36
|
-
swept: bigint,
|
|
37
|
-
totalDrawn: bigint,
|
|
38
|
-
totalDrawnShares: bigint,
|
|
39
|
-
totalPremiumShares: bigint,
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface AaveV4HubOnChainData {
|
|
43
|
-
assets: Record<number, AaveV4HubAssetOnChainData>,
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface AaveV4SpokeInfo {
|
|
47
|
-
chainIds: NetworkNumber[],
|
|
48
|
-
label: string,
|
|
49
|
-
value: AaveV4SpokesType,
|
|
50
|
-
url: string,
|
|
51
|
-
address: EthAddress,
|
|
52
|
-
hubs: EthAddress[],
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface AaveV4SpokeData {
|
|
56
|
-
assetsData: AaveV4AssetsData,
|
|
57
|
-
oracle: EthAddress,
|
|
58
|
-
oracleDecimals: number,
|
|
59
|
-
address: EthAddress,
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface AaveV4ReserveAssetOnChain {
|
|
63
|
-
underlying: EthAddress,
|
|
64
|
-
hub: EthAddress,
|
|
65
|
-
assetId: number,
|
|
66
|
-
decimals: number,
|
|
67
|
-
paused: boolean,
|
|
68
|
-
frozen: boolean,
|
|
69
|
-
borrowable: boolean,
|
|
70
|
-
collateralRisk: number,
|
|
71
|
-
collateralFactor: number,
|
|
72
|
-
maxLiquidationBonus: number,
|
|
73
|
-
liquidationFee: number,
|
|
74
|
-
price: bigint,
|
|
75
|
-
totalSupplied: bigint,
|
|
76
|
-
totalDrawn: bigint,
|
|
77
|
-
totalPremium: bigint,
|
|
78
|
-
totalDebt: bigint,
|
|
79
|
-
supplyCap: bigint,
|
|
80
|
-
borrowCap: bigint,
|
|
81
|
-
deficitRay: bigint,
|
|
82
|
-
spokeActive: boolean,
|
|
83
|
-
spokeHalted: boolean
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface AaveV4ReserveAssetData {
|
|
87
|
-
symbol: string,
|
|
88
|
-
underlying: EthAddress,
|
|
89
|
-
hub: EthAddress,
|
|
90
|
-
hubName: string,
|
|
91
|
-
assetId: number,
|
|
92
|
-
reserveId: number,
|
|
93
|
-
paused: boolean,
|
|
94
|
-
frozen: boolean,
|
|
95
|
-
borrowable: boolean,
|
|
96
|
-
collateralRisk: number,
|
|
97
|
-
collateralFactor: number,
|
|
98
|
-
liquidationFee: number,
|
|
99
|
-
maxLiquidationBonus: number,
|
|
100
|
-
price: string,
|
|
101
|
-
totalSupplied: string,
|
|
102
|
-
totalDrawn: string,
|
|
103
|
-
totalPremium: string,
|
|
104
|
-
totalDebt: string,
|
|
105
|
-
supplyCap: string,
|
|
106
|
-
borrowCap: string,
|
|
107
|
-
spokeActive: boolean,
|
|
108
|
-
spokeHalted: boolean,
|
|
109
|
-
drawnRate: string,
|
|
110
|
-
supplyRate: string,
|
|
111
|
-
borrowRate: string,
|
|
112
|
-
supplyIncentives: IncentiveData[];
|
|
113
|
-
borrowIncentives: IncentiveData[];
|
|
114
|
-
canBeBorrowed: boolean;
|
|
115
|
-
canBeSupplied: boolean;
|
|
116
|
-
canBeWithdrawn: boolean;
|
|
117
|
-
canBePayBacked: boolean;
|
|
118
|
-
utilization: string;
|
|
119
|
-
/** Hub `liquidity` for this assetId (underlying amount), used for pool-level borrow/withdraw limits */
|
|
120
|
-
hubLiquidity: string,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
export
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
export
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
1
|
+
import {
|
|
2
|
+
EthAddress, IncentiveData, LeverageType, NetworkNumber,
|
|
3
|
+
} from './common';
|
|
4
|
+
|
|
5
|
+
export enum AaveV4HubsType {
|
|
6
|
+
AaveV4CoreHub = 'aave_v4_core_hub',
|
|
7
|
+
AaveV4PlusHub = 'aave_v4_plus_hub',
|
|
8
|
+
AaveV4PrimeHub = 'aave_v4_prime_hub',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum AaveV4SpokesType {
|
|
12
|
+
AaveV4BluechipSpoke = 'aave_v4_bluechip_spoke',
|
|
13
|
+
AaveV4EthenaCorrelatedSpoke = 'aave_v4_ethena_correlated_spoke',
|
|
14
|
+
AaveV4EthenaEcosystemSpoke = 'aave_v4_ethena_ecosystem_spoke',
|
|
15
|
+
AaveV4EtherfiSpoke = 'aave_v4_etherfi_spoke',
|
|
16
|
+
AaveV4ForexSpoke = 'aave_v4_forex_spoke',
|
|
17
|
+
AaveV4GoldSpoke = 'aave_v4_gold_spoke',
|
|
18
|
+
AaveV4KelpSpoke = 'aave_v4_kelp_spoke',
|
|
19
|
+
AaveV4LidoSpoke = 'aave_v4_lido_spoke',
|
|
20
|
+
AaveV4LombardBtcSpoke = 'aave_v4_lombard_btc_spoke',
|
|
21
|
+
AaveV4MainSpoke = 'aave_v4_main_spoke',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface AaveV4HubInfo {
|
|
25
|
+
chainIds: NetworkNumber[],
|
|
26
|
+
label: string,
|
|
27
|
+
value: AaveV4HubsType,
|
|
28
|
+
address: EthAddress,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface AaveV4HubAssetOnChainData {
|
|
32
|
+
assetId: number,
|
|
33
|
+
drawnRate: bigint,
|
|
34
|
+
liquidity: bigint,
|
|
35
|
+
liquidityFee: number,
|
|
36
|
+
swept: bigint,
|
|
37
|
+
totalDrawn: bigint,
|
|
38
|
+
totalDrawnShares: bigint,
|
|
39
|
+
totalPremiumShares: bigint,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface AaveV4HubOnChainData {
|
|
43
|
+
assets: Record<number, AaveV4HubAssetOnChainData>,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface AaveV4SpokeInfo {
|
|
47
|
+
chainIds: NetworkNumber[],
|
|
48
|
+
label: string,
|
|
49
|
+
value: AaveV4SpokesType,
|
|
50
|
+
url: string,
|
|
51
|
+
address: EthAddress,
|
|
52
|
+
hubs: EthAddress[],
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface AaveV4SpokeData {
|
|
56
|
+
assetsData: AaveV4AssetsData,
|
|
57
|
+
oracle: EthAddress,
|
|
58
|
+
oracleDecimals: number,
|
|
59
|
+
address: EthAddress,
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface AaveV4ReserveAssetOnChain {
|
|
63
|
+
underlying: EthAddress,
|
|
64
|
+
hub: EthAddress,
|
|
65
|
+
assetId: number,
|
|
66
|
+
decimals: number,
|
|
67
|
+
paused: boolean,
|
|
68
|
+
frozen: boolean,
|
|
69
|
+
borrowable: boolean,
|
|
70
|
+
collateralRisk: number,
|
|
71
|
+
collateralFactor: number,
|
|
72
|
+
maxLiquidationBonus: number,
|
|
73
|
+
liquidationFee: number,
|
|
74
|
+
price: bigint,
|
|
75
|
+
totalSupplied: bigint,
|
|
76
|
+
totalDrawn: bigint,
|
|
77
|
+
totalPremium: bigint,
|
|
78
|
+
totalDebt: bigint,
|
|
79
|
+
supplyCap: bigint,
|
|
80
|
+
borrowCap: bigint,
|
|
81
|
+
deficitRay: bigint,
|
|
82
|
+
spokeActive: boolean,
|
|
83
|
+
spokeHalted: boolean
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface AaveV4ReserveAssetData {
|
|
87
|
+
symbol: string,
|
|
88
|
+
underlying: EthAddress,
|
|
89
|
+
hub: EthAddress,
|
|
90
|
+
hubName: string,
|
|
91
|
+
assetId: number,
|
|
92
|
+
reserveId: number,
|
|
93
|
+
paused: boolean,
|
|
94
|
+
frozen: boolean,
|
|
95
|
+
borrowable: boolean,
|
|
96
|
+
collateralRisk: number,
|
|
97
|
+
collateralFactor: number,
|
|
98
|
+
liquidationFee: number,
|
|
99
|
+
maxLiquidationBonus: number,
|
|
100
|
+
price: string,
|
|
101
|
+
totalSupplied: string,
|
|
102
|
+
totalDrawn: string,
|
|
103
|
+
totalPremium: string,
|
|
104
|
+
totalDebt: string,
|
|
105
|
+
supplyCap: string,
|
|
106
|
+
borrowCap: string,
|
|
107
|
+
spokeActive: boolean,
|
|
108
|
+
spokeHalted: boolean,
|
|
109
|
+
drawnRate: string,
|
|
110
|
+
supplyRate: string,
|
|
111
|
+
borrowRate: string,
|
|
112
|
+
supplyIncentives: IncentiveData[];
|
|
113
|
+
borrowIncentives: IncentiveData[];
|
|
114
|
+
canBeBorrowed: boolean;
|
|
115
|
+
canBeSupplied: boolean;
|
|
116
|
+
canBeWithdrawn: boolean;
|
|
117
|
+
canBePayBacked: boolean;
|
|
118
|
+
utilization: string;
|
|
119
|
+
/** Hub `liquidity` for this assetId (underlying amount), used for pool-level borrow/withdraw limits */
|
|
120
|
+
hubLiquidity: string,
|
|
121
|
+
premiumMultiplier: string;
|
|
122
|
+
liquidityFee: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type AaveV4AssetsData = Record<string, AaveV4ReserveAssetData>;
|
|
126
|
+
|
|
127
|
+
export interface AaveV4UsedReserveAsset {
|
|
128
|
+
symbol: string,
|
|
129
|
+
hubName: string,
|
|
130
|
+
assetId: number,
|
|
131
|
+
reserveId: number,
|
|
132
|
+
supplied: string,
|
|
133
|
+
suppliedUsd: string,
|
|
134
|
+
drawn: string,
|
|
135
|
+
drawnUsd: string,
|
|
136
|
+
premium: string,
|
|
137
|
+
premiumUsd: string,
|
|
138
|
+
borrowed: string,
|
|
139
|
+
borrowedUsd: string,
|
|
140
|
+
isSupplied: boolean,
|
|
141
|
+
isBorrowed: boolean,
|
|
142
|
+
collateral: boolean,
|
|
143
|
+
collateralFactor: number,
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface AaveV4AggregatedPositionData {
|
|
147
|
+
suppliedUsd: string,
|
|
148
|
+
suppliedCollateralUsd: string,
|
|
149
|
+
borrowLimitUsd: string,
|
|
150
|
+
liquidationLimitUsd: string,
|
|
151
|
+
borrowedUsd: string,
|
|
152
|
+
drawnUsd: string,
|
|
153
|
+
premiumUsd: string,
|
|
154
|
+
leftToBorrowUsd: string,
|
|
155
|
+
ratio: string,
|
|
156
|
+
collRatio: string,
|
|
157
|
+
liqRatio: string,
|
|
158
|
+
liqPercent: string,
|
|
159
|
+
leveragedType: LeverageType,
|
|
160
|
+
leveragedAsset: string,
|
|
161
|
+
liquidationPrice: string,
|
|
162
|
+
minCollRatio: string,
|
|
163
|
+
collLiquidationRatio: string,
|
|
164
|
+
minHealthRatio: string,
|
|
165
|
+
healthRatio: string,
|
|
166
|
+
netApy: string,
|
|
167
|
+
incentiveUsd: string,
|
|
168
|
+
totalInterestUsd: string,
|
|
169
|
+
currentVolatilePairRatio?: string,
|
|
170
|
+
minRatio: string,
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type AaveV4UsedReserveAssets = Record<string, AaveV4UsedReserveAsset>;
|
|
174
|
+
|
|
175
|
+
export interface AaveV4AccountData extends AaveV4AggregatedPositionData {
|
|
176
|
+
usedAssets: AaveV4UsedReserveAssets,
|
|
177
|
+
healthFactor: string,
|
|
178
|
+
riskPremiumBps: number,
|
|
179
|
+
}
|
package/src/types/claiming.ts
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import { EthAddress } from './common';
|
|
2
|
-
|
|
3
|
-
export enum ClaimType {
|
|
4
|
-
/** Rewards from AAVE - various tokens & aTokens (supplied to protocol) */
|
|
5
|
-
AAVE_REWARDS = 'AAVE_REWARDS',
|
|
6
|
-
/** Merit rewards from AAVE (various tokens) */
|
|
7
|
-
AAVE_MERIT_REWARDS = 'AAVE_MERIT_REWARDS',
|
|
8
|
-
/** Rewards from Compound V3 (only in COMP) */
|
|
9
|
-
COMPOUND_V3_COMP = 'COMPOUND_V3_COMP',
|
|
10
|
-
/** Rewards from Spark (wstETH only for now) */
|
|
11
|
-
SPARK_REWARDS = 'SPARK_REWARDS',
|
|
12
|
-
/** Rewards from Morpho */
|
|
13
|
-
MORPHO = 'MORPHO',
|
|
14
|
-
/** Rewards from King (prev LTR^2 - received for weETH holding) */
|
|
15
|
-
KING_REWARDS = 'KING_REWARDS',
|
|
16
|
-
/** Spark Airdrop */
|
|
17
|
-
SPARK_AIRDROP = 'SPARK_AIRDROP',
|
|
18
|
-
/** Spark Airdrop */
|
|
19
|
-
SPARK_WST_ETH_REWARDS = 'SPARK_WST_ETH_REWARDS', // TODO: This will be removed once we fully refactor spark rewards
|
|
20
|
-
|
|
21
|
-
ETHENA_AIRDROP = 'ETHENA_AIRDROP',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
type _ClaimableTokenPartial = {
|
|
25
|
-
symbol: string;
|
|
26
|
-
underlyingSymbol: string;
|
|
27
|
-
tokenAddress: EthAddress;
|
|
28
|
-
amount: string;
|
|
29
|
-
walletAddress: EthAddress;
|
|
30
|
-
label: string;
|
|
31
|
-
};
|
|
32
|
-
export type AaveRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
33
|
-
claimType: ClaimType.AAVE_REWARDS;
|
|
34
|
-
additionalClaimFields: {
|
|
35
|
-
marketAddress: EthAddress;
|
|
36
|
-
aTokenAddresses: string[];
|
|
37
|
-
isAaveToken: boolean;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export type AaveMeritRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
41
|
-
claimType: ClaimType.AAVE_MERIT_REWARDS;
|
|
42
|
-
additionalClaimFields: {
|
|
43
|
-
accumulated: string;
|
|
44
|
-
proof: string[];
|
|
45
|
-
decimals: string;
|
|
46
|
-
unclaimed: string;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export type SparkRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
51
|
-
claimType: ClaimType.SPARK_REWARDS;
|
|
52
|
-
additionalClaimFields: {
|
|
53
|
-
sparkAssetAddresses: string[];
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export type KingRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
58
|
-
claimType: ClaimType.KING_REWARDS;
|
|
59
|
-
additionalClaimFields: {
|
|
60
|
-
allRewardsAmount: string;
|
|
61
|
-
merkleRoot: string;
|
|
62
|
-
merkleProofs: string[];
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export type MorphoClaimableToken = _ClaimableTokenPartial & {
|
|
67
|
-
claimType: ClaimType.MORPHO,
|
|
68
|
-
additionalClaimFields: {
|
|
69
|
-
originalAmount: string,
|
|
70
|
-
merkleProofs: string[];
|
|
71
|
-
distributor: EthAddress;
|
|
72
|
-
isLegacy: boolean;
|
|
73
|
-
txData: string;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export type CompoundV3CompClaimableToken = _ClaimableTokenPartial & {
|
|
79
|
-
claimType: ClaimType.COMPOUND_V3_COMP,
|
|
80
|
-
additionalClaimFields: {
|
|
81
|
-
marketAddress: EthAddress;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export enum SparkAirdropType {
|
|
86
|
-
SPARK_IGNITION = 'spark-ignition',
|
|
87
|
-
PRE_FARMING_AND_SOCIAL = 'pre-farming-and-social',
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export type SparkAirdropClaimableToken = _ClaimableTokenPartial & {
|
|
91
|
-
claimType: ClaimType.SPARK_AIRDROP,
|
|
92
|
-
additionalClaimFields: {
|
|
93
|
-
merkleRoot: string;
|
|
94
|
-
merkleProofs: string[];
|
|
95
|
-
epoch: number;
|
|
96
|
-
rewardType: SparkAirdropType;
|
|
97
|
-
allRewardsAmount: string;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export type SparkWstEthRewardsClaimableToken = _ClaimableTokenPartial & { claimType: ClaimType.SPARK_WST_ETH_REWARDS };
|
|
102
|
-
|
|
103
|
-
export type EthenaAirdropClaimableToken = _ClaimableTokenPartial & { claimType: ClaimType.ETHENA_AIRDROP };
|
|
104
|
-
|
|
105
|
-
export type ClaimableToken =
|
|
106
|
-
AaveRewardsClaimableToken
|
|
107
|
-
| AaveMeritRewardsClaimableToken
|
|
108
|
-
| CompoundV3CompClaimableToken
|
|
109
|
-
| MorphoClaimableToken
|
|
110
|
-
| SparkRewardsClaimableToken
|
|
111
|
-
| KingRewardsClaimableToken
|
|
112
|
-
| SparkAirdropClaimableToken
|
|
113
|
-
| SparkWstEthRewardsClaimableToken
|
|
114
|
-
| EthenaAirdropClaimableToken;
|
|
1
|
+
import { EthAddress } from './common';
|
|
2
|
+
|
|
3
|
+
export enum ClaimType {
|
|
4
|
+
/** Rewards from AAVE - various tokens & aTokens (supplied to protocol) */
|
|
5
|
+
AAVE_REWARDS = 'AAVE_REWARDS',
|
|
6
|
+
/** Merit rewards from AAVE (various tokens) */
|
|
7
|
+
AAVE_MERIT_REWARDS = 'AAVE_MERIT_REWARDS',
|
|
8
|
+
/** Rewards from Compound V3 (only in COMP) */
|
|
9
|
+
COMPOUND_V3_COMP = 'COMPOUND_V3_COMP',
|
|
10
|
+
/** Rewards from Spark (wstETH only for now) */
|
|
11
|
+
SPARK_REWARDS = 'SPARK_REWARDS',
|
|
12
|
+
/** Rewards from Morpho */
|
|
13
|
+
MORPHO = 'MORPHO',
|
|
14
|
+
/** Rewards from King (prev LTR^2 - received for weETH holding) */
|
|
15
|
+
KING_REWARDS = 'KING_REWARDS',
|
|
16
|
+
/** Spark Airdrop */
|
|
17
|
+
SPARK_AIRDROP = 'SPARK_AIRDROP',
|
|
18
|
+
/** Spark Airdrop */
|
|
19
|
+
SPARK_WST_ETH_REWARDS = 'SPARK_WST_ETH_REWARDS', // TODO: This will be removed once we fully refactor spark rewards
|
|
20
|
+
|
|
21
|
+
ETHENA_AIRDROP = 'ETHENA_AIRDROP',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type _ClaimableTokenPartial = {
|
|
25
|
+
symbol: string;
|
|
26
|
+
underlyingSymbol: string;
|
|
27
|
+
tokenAddress: EthAddress;
|
|
28
|
+
amount: string;
|
|
29
|
+
walletAddress: EthAddress;
|
|
30
|
+
label: string;
|
|
31
|
+
};
|
|
32
|
+
export type AaveRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
33
|
+
claimType: ClaimType.AAVE_REWARDS;
|
|
34
|
+
additionalClaimFields: {
|
|
35
|
+
marketAddress: EthAddress;
|
|
36
|
+
aTokenAddresses: string[];
|
|
37
|
+
isAaveToken: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type AaveMeritRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
41
|
+
claimType: ClaimType.AAVE_MERIT_REWARDS;
|
|
42
|
+
additionalClaimFields: {
|
|
43
|
+
accumulated: string;
|
|
44
|
+
proof: string[];
|
|
45
|
+
decimals: string;
|
|
46
|
+
unclaimed: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type SparkRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
51
|
+
claimType: ClaimType.SPARK_REWARDS;
|
|
52
|
+
additionalClaimFields: {
|
|
53
|
+
sparkAssetAddresses: string[];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type KingRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
58
|
+
claimType: ClaimType.KING_REWARDS;
|
|
59
|
+
additionalClaimFields: {
|
|
60
|
+
allRewardsAmount: string;
|
|
61
|
+
merkleRoot: string;
|
|
62
|
+
merkleProofs: string[];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type MorphoClaimableToken = _ClaimableTokenPartial & {
|
|
67
|
+
claimType: ClaimType.MORPHO,
|
|
68
|
+
additionalClaimFields: {
|
|
69
|
+
originalAmount: string,
|
|
70
|
+
merkleProofs: string[];
|
|
71
|
+
distributor: EthAddress;
|
|
72
|
+
isLegacy: boolean;
|
|
73
|
+
txData: string;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
export type CompoundV3CompClaimableToken = _ClaimableTokenPartial & {
|
|
79
|
+
claimType: ClaimType.COMPOUND_V3_COMP,
|
|
80
|
+
additionalClaimFields: {
|
|
81
|
+
marketAddress: EthAddress;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export enum SparkAirdropType {
|
|
86
|
+
SPARK_IGNITION = 'spark-ignition',
|
|
87
|
+
PRE_FARMING_AND_SOCIAL = 'pre-farming-and-social',
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type SparkAirdropClaimableToken = _ClaimableTokenPartial & {
|
|
91
|
+
claimType: ClaimType.SPARK_AIRDROP,
|
|
92
|
+
additionalClaimFields: {
|
|
93
|
+
merkleRoot: string;
|
|
94
|
+
merkleProofs: string[];
|
|
95
|
+
epoch: number;
|
|
96
|
+
rewardType: SparkAirdropType;
|
|
97
|
+
allRewardsAmount: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type SparkWstEthRewardsClaimableToken = _ClaimableTokenPartial & { claimType: ClaimType.SPARK_WST_ETH_REWARDS };
|
|
102
|
+
|
|
103
|
+
export type EthenaAirdropClaimableToken = _ClaimableTokenPartial & { claimType: ClaimType.ETHENA_AIRDROP };
|
|
104
|
+
|
|
105
|
+
export type ClaimableToken =
|
|
106
|
+
AaveRewardsClaimableToken
|
|
107
|
+
| AaveMeritRewardsClaimableToken
|
|
108
|
+
| CompoundV3CompClaimableToken
|
|
109
|
+
| MorphoClaimableToken
|
|
110
|
+
| SparkRewardsClaimableToken
|
|
111
|
+
| KingRewardsClaimableToken
|
|
112
|
+
| SparkAirdropClaimableToken
|
|
113
|
+
| SparkWstEthRewardsClaimableToken
|
|
114
|
+
| EthenaAirdropClaimableToken;
|