@defisaver/positions-sdk 2.1.1 → 2.1.3
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.js +1 -0
- package/cjs/aaveV3/index.d.ts +12 -0
- package/cjs/aaveV3/index.js +93 -1
- package/cjs/claiming/aaveV3.d.ts +5 -0
- package/cjs/claiming/aaveV3.js +139 -0
- package/cjs/claiming/compV3.d.ts +15 -0
- package/cjs/claiming/compV3.js +34 -0
- package/cjs/claiming/index.d.ts +6 -0
- package/cjs/claiming/index.js +46 -0
- package/cjs/claiming/king.d.ts +4 -0
- package/cjs/claiming/king.js +72 -0
- package/cjs/claiming/morphoBlue.d.ts +5 -0
- package/cjs/claiming/morphoBlue.js +113 -0
- package/cjs/claiming/spark.d.ts +6 -0
- package/cjs/claiming/spark.js +188 -0
- package/cjs/config/contracts.d.ts +2681 -0
- package/cjs/config/contracts.js +103 -2
- package/cjs/constants/index.d.ts +4 -0
- package/cjs/constants/index.js +6 -2
- package/cjs/contracts.d.ts +3027 -23
- package/cjs/contracts.js +10 -1
- package/cjs/helpers/aaveHelpers/index.d.ts +4 -0
- package/cjs/helpers/aaveHelpers/index.js +25 -8
- package/cjs/helpers/morphoBlueHelpers/index.d.ts +1 -0
- package/cjs/helpers/morphoBlueHelpers/index.js +7 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/liquity/index.d.ts +11 -0
- package/cjs/liquity/index.js +39 -1
- package/cjs/liquityV2/index.d.ts +35 -0
- package/cjs/liquityV2/index.js +142 -1
- package/cjs/morphoBlue/index.d.ts +5 -0
- package/cjs/morphoBlue/index.js +35 -0
- package/cjs/portfolio/index.d.ts +6 -1
- package/cjs/portfolio/index.js +293 -10
- package/cjs/services/utils.d.ts +5 -0
- package/cjs/services/utils.js +33 -1
- package/cjs/services/viem.d.ts +12 -12
- package/cjs/spark/index.js +1 -0
- package/cjs/staking/eligibility.d.ts +4 -2
- package/cjs/staking/eligibility.js +3 -4
- package/cjs/staking/staking.d.ts +2 -1
- package/cjs/staking/staking.js +3 -3
- package/cjs/types/claiming.d.ts +93 -0
- package/cjs/types/claiming.js +27 -0
- package/cjs/types/common.d.ts +1 -1
- package/cjs/types/common.js +1 -1
- package/cjs/umbrella/index.d.ts +5 -0
- package/cjs/umbrella/index.js +50 -0
- package/cjs/umbrella/umbrellaUtils.d.ts +22 -0
- package/cjs/umbrella/umbrellaUtils.js +34 -0
- package/esm/aaveV2/index.js +1 -0
- package/esm/aaveV3/index.d.ts +12 -0
- package/esm/aaveV3/index.js +91 -1
- package/esm/claiming/aaveV3.d.ts +5 -0
- package/esm/claiming/aaveV3.js +132 -0
- package/esm/claiming/compV3.d.ts +15 -0
- package/esm/claiming/compV3.js +30 -0
- package/esm/claiming/index.d.ts +6 -0
- package/esm/claiming/index.js +6 -0
- package/esm/claiming/king.d.ts +4 -0
- package/esm/claiming/king.js +64 -0
- package/esm/claiming/morphoBlue.d.ts +5 -0
- package/esm/claiming/morphoBlue.js +105 -0
- package/esm/claiming/spark.d.ts +6 -0
- package/esm/claiming/spark.js +179 -0
- package/esm/config/contracts.d.ts +2681 -0
- package/esm/config/contracts.js +102 -1
- package/esm/constants/index.d.ts +4 -0
- package/esm/constants/index.js +5 -1
- package/esm/contracts.d.ts +3027 -23
- package/esm/contracts.js +9 -0
- package/esm/helpers/aaveHelpers/index.d.ts +4 -0
- package/esm/helpers/aaveHelpers/index.js +23 -7
- package/esm/helpers/morphoBlueHelpers/index.d.ts +1 -0
- package/esm/helpers/morphoBlueHelpers/index.js +6 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/liquity/index.d.ts +11 -0
- package/esm/liquity/index.js +38 -1
- package/esm/liquityV2/index.d.ts +35 -0
- package/esm/liquityV2/index.js +142 -3
- package/esm/morphoBlue/index.d.ts +5 -0
- package/esm/morphoBlue/index.js +35 -1
- package/esm/portfolio/index.d.ts +6 -1
- package/esm/portfolio/index.js +298 -15
- package/esm/services/utils.d.ts +5 -0
- package/esm/services/utils.js +31 -0
- package/esm/services/viem.d.ts +12 -12
- package/esm/spark/index.js +1 -0
- package/esm/staking/eligibility.d.ts +4 -2
- package/esm/staking/eligibility.js +3 -4
- package/esm/staking/staking.d.ts +2 -1
- package/esm/staking/staking.js +3 -3
- package/esm/types/claiming.d.ts +93 -0
- package/esm/types/claiming.js +24 -0
- package/esm/types/common.d.ts +1 -1
- package/esm/types/common.js +1 -1
- package/esm/umbrella/index.d.ts +5 -0
- package/esm/umbrella/index.js +46 -0
- package/esm/umbrella/umbrellaUtils.d.ts +22 -0
- package/esm/umbrella/umbrellaUtils.js +28 -0
- package/package.json +1 -1
- package/src/aaveV2/index.ts +2 -1
- package/src/aaveV3/index.ts +100 -2
- package/src/claiming/aaveV3.ts +155 -0
- package/src/claiming/compV3.ts +23 -0
- package/src/claiming/index.ts +13 -0
- package/src/claiming/king.ts +66 -0
- package/src/claiming/morphoBlue.ts +119 -0
- package/src/claiming/spark.ts +226 -0
- package/src/config/contracts.ts +104 -4
- package/src/constants/index.ts +5 -1
- package/src/contracts.ts +14 -1
- package/src/helpers/aaveHelpers/index.ts +24 -7
- package/src/helpers/morphoBlueHelpers/index.ts +7 -2
- package/src/index.ts +2 -0
- package/src/liquity/index.ts +57 -2
- package/src/liquityV2/index.ts +244 -4
- package/src/morphoBlue/index.ts +40 -2
- package/src/portfolio/index.ts +300 -15
- package/src/services/utils.ts +37 -1
- package/src/spark/index.ts +2 -1
- package/src/staking/eligibility.ts +3 -4
- package/src/staking/staking.ts +4 -4
- package/src/types/claiming.ts +109 -0
- package/src/types/common.ts +1 -1
- package/src/umbrella/index.ts +70 -0
- package/src/umbrella/umbrellaUtils.ts +30 -0
package/src/portfolio/index.ts
CHANGED
|
@@ -2,9 +2,15 @@ import Dec from 'decimal.js';
|
|
|
2
2
|
import { EthAddress, EthereumProvider, NetworkNumber } from '../types/common';
|
|
3
3
|
import {
|
|
4
4
|
AaveMarkets,
|
|
5
|
-
CompoundMarkets,
|
|
5
|
+
CompoundMarkets,
|
|
6
|
+
CrvUsdMarkets,
|
|
7
|
+
EulerV2Markets,
|
|
8
|
+
LiquityV2Markets,
|
|
9
|
+
LlamaLendMarkets,
|
|
10
|
+
MorphoBlueMarkets,
|
|
11
|
+
SparkMarkets,
|
|
6
12
|
} from '../markets';
|
|
7
|
-
import { _getMorphoBlueAccountData, _getMorphoBlueMarketData } from '../morphoBlue';
|
|
13
|
+
import { _getMorphoBlueAccountData, _getMorphoBlueMarketData, getMorphoEarn } from '../morphoBlue';
|
|
8
14
|
import {
|
|
9
15
|
AaveV2MarketData,
|
|
10
16
|
AaveV3MarketData,
|
|
@@ -15,6 +21,7 @@ import {
|
|
|
15
21
|
CompoundVersions,
|
|
16
22
|
CrvUSDGlobalMarketData,
|
|
17
23
|
EulerV2FullMarketData,
|
|
24
|
+
LiquityV2MarketData,
|
|
18
25
|
LlamaLendGlobalMarketData,
|
|
19
26
|
MorphoBlueMarketInfo,
|
|
20
27
|
PortfolioPositionsData,
|
|
@@ -25,18 +32,29 @@ import { _getSparkAccountData, _getSparkMarketsData } from '../spark';
|
|
|
25
32
|
import { _getEulerV2AccountData, _getEulerV2MarketsData } from '../eulerV2';
|
|
26
33
|
import { _getCurveUsdGlobalData, _getCurveUsdUserData } from '../curveUsd';
|
|
27
34
|
import { _getLlamaLendGlobalData, _getLlamaLendUserData } from '../llamaLend';
|
|
28
|
-
import { _getAaveV3AccountData, _getAaveV3MarketData } from '../aaveV3';
|
|
35
|
+
import { _getAaveV3AccountData, _getAaveV3MarketData, getStakeAaveData } from '../aaveV3';
|
|
29
36
|
import { ZERO_ADDRESS } from '../constants';
|
|
30
37
|
import { _getMakerCdpData, _getUserCdps } from '../maker';
|
|
31
38
|
import { _getAaveV2AccountData, _getAaveV2MarketsData } from '../aaveV2';
|
|
32
39
|
import { _getCompoundV2AccountData, _getCompoundV2MarketsData } from '../compoundV2';
|
|
33
40
|
import { getViemProvider } from '../services/viem';
|
|
34
|
-
import { _getLiquityTroveInfo } from '../liquity';
|
|
35
|
-
import { _getLiquityV2MarketData,
|
|
36
|
-
import { _getUserPositionsPortfolio } from '../fluid';
|
|
41
|
+
import { _getLiquityTroveInfo, getLiquityStakingData } from '../liquity';
|
|
42
|
+
import { _getLiquityV2MarketData, getLiquitySAndYBold, getLiquityV2Staking } from '../liquityV2';
|
|
43
|
+
import { _getAllUserEarnPositionsWithFTokens, _getUserPositionsPortfolio } from '../fluid';
|
|
37
44
|
import { getEulerV2SubAccounts } from '../helpers/eulerHelpers';
|
|
45
|
+
import { getUmbrellaData } from '../umbrella';
|
|
46
|
+
import { getMeritUnclaimedRewards, getUnclaimedRewardsForAllMarkets } from '../claiming/aaveV3';
|
|
47
|
+
import { getCompoundV3Rewards } from '../claiming/compV3';
|
|
48
|
+
import { fetchSparkAirdropRewards, fetchSparkRewards } from '../claiming/spark';
|
|
49
|
+
import { fetchMorphoBlueRewards } from '../claiming/morphoBlue';
|
|
50
|
+
import { getKingRewards } from '../claiming/king';
|
|
38
51
|
|
|
39
|
-
export async function getPortfolioData(provider: EthereumProvider, network: NetworkNumber, defaultProvider: EthereumProvider, addresses: EthAddress[], summerFiAddresses: EthAddress[]): Promise<
|
|
52
|
+
export async function getPortfolioData(provider: EthereumProvider, network: NetworkNumber, defaultProvider: EthereumProvider, addresses: EthAddress[], summerFiAddresses: EthAddress[]): Promise<{
|
|
53
|
+
positions: PortfolioPositionsData;
|
|
54
|
+
stakingPositions: any;
|
|
55
|
+
rewardsData: any;
|
|
56
|
+
markets: any;
|
|
57
|
+
}> {
|
|
40
58
|
const isMainnet = network === NetworkNumber.Eth;
|
|
41
59
|
const isFluidSupported = [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base].includes(network);
|
|
42
60
|
|
|
@@ -49,6 +67,8 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
49
67
|
const compoundV2Markets = [CompoundVersions.CompoundV2].map((version) => CompoundMarkets(network)[version]).filter((market) => market.chainIds.includes(network));
|
|
50
68
|
const crvUsdMarkets = Object.values(CrvUsdMarkets(network)).filter((market) => market.chainIds.includes(network));
|
|
51
69
|
const llamaLendMarkets = [NetworkNumber.Eth, NetworkNumber.Arb].includes(network) ? Object.values(LlamaLendMarkets(network)).filter((market) => market.chainIds.includes(network)) : [];
|
|
70
|
+
const liquityV2Markets = [NetworkNumber.Eth].includes(network) ? Object.values(LiquityV2Markets(network)) : [];
|
|
71
|
+
const liquityV2MarketsStaking = [NetworkNumber.Eth].includes(network) ? Object.values(LiquityV2Markets(network)).filter(market => !market.isLegacy) : [];
|
|
52
72
|
|
|
53
73
|
const client = getViemProvider(provider, network, {
|
|
54
74
|
batch: {
|
|
@@ -75,9 +95,26 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
75
95
|
const compoundV2MarketsData: Record<string, CompoundV2MarketsData> = {};
|
|
76
96
|
const crvUsdMarketsData: Record<string, CrvUSDGlobalMarketData> = {};
|
|
77
97
|
const llamaLendMarketsData: Record<string, LlamaLendGlobalMarketData> = {};
|
|
98
|
+
const liquityV2MarketsData: Record<string, LiquityV2MarketData> = {};
|
|
99
|
+
|
|
100
|
+
const markets = {
|
|
101
|
+
morphoMarketsData,
|
|
102
|
+
compoundV3MarketsData,
|
|
103
|
+
sparkMarketsData,
|
|
104
|
+
eulerV2MarketsData,
|
|
105
|
+
aaveV3MarketsData,
|
|
106
|
+
aaveV2MarketsData,
|
|
107
|
+
compoundV2MarketsData,
|
|
108
|
+
crvUsdMarketsData,
|
|
109
|
+
llamaLendMarketsData,
|
|
110
|
+
liquityV2MarketsData,
|
|
111
|
+
};
|
|
78
112
|
|
|
79
113
|
const positions: PortfolioPositionsData = {};
|
|
114
|
+
const stakingPositions: any = {};
|
|
115
|
+
const rewardsData: any = {};
|
|
80
116
|
const allAddresses = [...addresses, ...summerFiAddresses];
|
|
117
|
+
|
|
81
118
|
for (const address of allAddresses) {
|
|
82
119
|
positions[address.toLowerCase() as EthAddress] = {
|
|
83
120
|
aaveV3: {},
|
|
@@ -98,7 +135,36 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
98
135
|
};
|
|
99
136
|
}
|
|
100
137
|
|
|
138
|
+
// TODO: check default values, probably needed when fetching portfolio on unsupported networks
|
|
139
|
+
for (const address of addresses) {
|
|
140
|
+
stakingPositions[address.toLowerCase() as EthAddress] = {
|
|
141
|
+
aaveV3: {},
|
|
142
|
+
morphoBlue: {},
|
|
143
|
+
compoundV3: {},
|
|
144
|
+
spark: {},
|
|
145
|
+
aaveV2: {},
|
|
146
|
+
compoundV2: {},
|
|
147
|
+
liquity: {},
|
|
148
|
+
liquityV2: {},
|
|
149
|
+
fluid: {
|
|
150
|
+
error: '',
|
|
151
|
+
data: {},
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
rewardsData[address.toLowerCase() as EthAddress] = {
|
|
156
|
+
aaveV3merit: {},
|
|
157
|
+
aaveV3: {},
|
|
158
|
+
compV3: {},
|
|
159
|
+
spark: {},
|
|
160
|
+
spk: {},
|
|
161
|
+
king: {},
|
|
162
|
+
morpho: {},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
101
166
|
await Promise.allSettled([
|
|
167
|
+
// === MARKET DATA (needs to be fetched first) ===
|
|
102
168
|
...morphoMarkets.map(async (market) => {
|
|
103
169
|
const marketData = await _getMorphoBlueMarketData(client, network, market);
|
|
104
170
|
morphoMarketsData[market.value] = marketData;
|
|
@@ -119,11 +185,6 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
119
185
|
const marketData = await _getAaveV3MarketData(client, network, market);
|
|
120
186
|
aaveV3MarketsData[market.value] = marketData;
|
|
121
187
|
}),
|
|
122
|
-
...addresses.map(async (address) => {
|
|
123
|
-
if (!isMainnet) return; // Maker CDPs are only available on mainnet
|
|
124
|
-
const makerCdp = await _getUserCdps(client, network, address);
|
|
125
|
-
makerCdps[address.toLowerCase() as EthAddress] = makerCdp;
|
|
126
|
-
}),
|
|
127
188
|
...aaveV2Markets.map(async (market) => {
|
|
128
189
|
const marketData = await _getAaveV2MarketsData(client, network, market);
|
|
129
190
|
aaveV2MarketsData[market.value] = marketData;
|
|
@@ -140,6 +201,17 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
140
201
|
const marketData = await _getLlamaLendGlobalData(client, network, market);
|
|
141
202
|
llamaLendMarketsData[market.value] = marketData;
|
|
142
203
|
}),
|
|
204
|
+
...liquityV2Markets.map(async (market) => {
|
|
205
|
+
const marketData = await _getLiquityV2MarketData(client, network, market);
|
|
206
|
+
liquityV2MarketsData[market.value] = marketData;
|
|
207
|
+
}),
|
|
208
|
+
|
|
209
|
+
// === INDEPENDENT USER DATA (doesn't depend on market data) ===
|
|
210
|
+
...addresses.map(async (address) => {
|
|
211
|
+
if (!isMainnet) return; // Maker CDPs are only available on mainnet
|
|
212
|
+
const makerCdp = await _getUserCdps(client, network, address);
|
|
213
|
+
makerCdps[address.toLowerCase() as EthAddress] = makerCdp;
|
|
214
|
+
}),
|
|
143
215
|
...addresses.map(async (address) => {
|
|
144
216
|
try {
|
|
145
217
|
if (!isFluidSupported) return; // Fluid is not available on Optimism
|
|
@@ -157,6 +229,177 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
157
229
|
};
|
|
158
230
|
}
|
|
159
231
|
}),
|
|
232
|
+
|
|
233
|
+
// === STAKING DATA (independent of market data) ===
|
|
234
|
+
...addresses.map(async (address) => {
|
|
235
|
+
try {
|
|
236
|
+
if (!isFluidSupported) return;
|
|
237
|
+
stakingPositions[address.toLowerCase()].fluid = await _getAllUserEarnPositionsWithFTokens(client, network, address);
|
|
238
|
+
} catch (error) {
|
|
239
|
+
console.error(`Error fetching Fluid lend data for address ${address}:`, error);
|
|
240
|
+
stakingPositions[address.toLowerCase()].fluid = { error: `Error fetching Fluid lend data for address ${address}`, data: null };
|
|
241
|
+
}
|
|
242
|
+
}),
|
|
243
|
+
...addresses.map(async (address) => {
|
|
244
|
+
try {
|
|
245
|
+
if (!isMainnet) return;
|
|
246
|
+
stakingPositions[address.toLowerCase()].liquity = await getLiquityStakingData(client, network, address);
|
|
247
|
+
} catch (error) {
|
|
248
|
+
console.error(`Error fetching Liquity staking data for address ${address}:`, error);
|
|
249
|
+
stakingPositions[address.toLowerCase()].liquity = { error: `Error fetching Liquity staking data for address ${address}`, data: null };
|
|
250
|
+
}
|
|
251
|
+
}),
|
|
252
|
+
...addresses.map(async (address) => {
|
|
253
|
+
try {
|
|
254
|
+
if (!isMainnet) return;
|
|
255
|
+
stakingPositions[address.toLowerCase()].aaveV3 = await getStakeAaveData(client, network, address);
|
|
256
|
+
} catch (error) {
|
|
257
|
+
console.error(`Error fetching Aave V3 staking data for address ${address}:`, error);
|
|
258
|
+
stakingPositions[address.toLowerCase()].aaveV3 = { error: `Error fetching Aave V3 staking data for address ${address}`, data: null };
|
|
259
|
+
}
|
|
260
|
+
}),
|
|
261
|
+
...addresses.map(async (address) => {
|
|
262
|
+
try {
|
|
263
|
+
if (!isMainnet) return;
|
|
264
|
+
stakingPositions[address.toLowerCase()].umbrella = await getUmbrellaData(client, network, address);
|
|
265
|
+
} catch (error) {
|
|
266
|
+
console.error(`Error fetching Umbrella staking data for address ${address}:`, error);
|
|
267
|
+
stakingPositions[address.toLowerCase()].umbrella = { error: `Error fetching Umbrella staking data for address ${address}`, data: null };
|
|
268
|
+
}
|
|
269
|
+
}),
|
|
270
|
+
// Liquity V2 staking
|
|
271
|
+
...liquityV2MarketsStaking.map(market => addresses.map(async (address) => {
|
|
272
|
+
try {
|
|
273
|
+
if (!isMainnet) {
|
|
274
|
+
stakingPositions[address.toLowerCase()].liquityV2[market.value] = { error: '', data: null };
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const liquityV2StakingData = await getLiquityV2Staking(client, network, market.value, address);
|
|
278
|
+
stakingPositions[address.toLowerCase()].liquityV2[market.value] = { error: '', data: liquityV2StakingData };
|
|
279
|
+
} catch (error) {
|
|
280
|
+
console.error(`Error fetching Liquity V2 staking data for address ${address}, market ${market.value}:`, error);
|
|
281
|
+
stakingPositions[address.toLowerCase()].liquityV2[market.value] = { error: `Error fetching Liquity V2 staking data for address ${address}`, data: null };
|
|
282
|
+
}
|
|
283
|
+
})).flat(),
|
|
284
|
+
|
|
285
|
+
// === REWARDS DATA (independent of market data) ===
|
|
286
|
+
// Batch King rewards
|
|
287
|
+
(async () => {
|
|
288
|
+
try {
|
|
289
|
+
if (!isMainnet) {
|
|
290
|
+
for (const address of addresses) {
|
|
291
|
+
rewardsData[address.toLowerCase()].king = { error: '', data: [] };
|
|
292
|
+
}
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const kingRewards = await getKingRewards(client, network, addresses);
|
|
296
|
+
for (const address of addresses) {
|
|
297
|
+
const lowerAddress = address.toLowerCase() as EthAddress;
|
|
298
|
+
rewardsData[lowerAddress].king = {
|
|
299
|
+
error: '',
|
|
300
|
+
data: kingRewards[lowerAddress] || [],
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
} catch (error) {
|
|
304
|
+
console.error('Error fetching King rewards data in batch:', error);
|
|
305
|
+
for (const address of addresses) {
|
|
306
|
+
rewardsData[address.toLowerCase() as EthAddress].king = {
|
|
307
|
+
error: 'Error fetching King rewards data in batch',
|
|
308
|
+
data: null,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
})(),
|
|
313
|
+
...sparkMarkets.map((market) => addresses.map(async address => {
|
|
314
|
+
try {
|
|
315
|
+
if (!isMainnet) {
|
|
316
|
+
rewardsData[address.toLowerCase()].spark[market.value] = { error: '', data: [] };
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const sparkData = await fetchSparkRewards(client, network, address, market.providerAddress);
|
|
320
|
+
rewardsData[address.toLowerCase() as EthAddress].spark[market.value] = { error: '', data: sparkData };
|
|
321
|
+
} catch (error) {
|
|
322
|
+
console.error(`Error fetching Spark rewards data for address ${address}, market ${market.value}:`, error);
|
|
323
|
+
rewardsData[address.toLowerCase() as EthAddress].spark[market.value] = { error: `Error fetching Spark rewards data for address ${address}`, data: null };
|
|
324
|
+
}
|
|
325
|
+
})).flat(),
|
|
326
|
+
// CompV3 rewards
|
|
327
|
+
...compoundV3Markets.map(market => addresses.map(async (address) => {
|
|
328
|
+
try {
|
|
329
|
+
const compV3Rewards = await getCompoundV3Rewards(client, network, address, market.baseMarketAddress);
|
|
330
|
+
rewardsData[address.toLowerCase() as EthAddress].compV3[market.value] = { error: '', data: compV3Rewards };
|
|
331
|
+
} catch (error) {
|
|
332
|
+
console.error(`Error fetching Compound V3 rewards data for address ${address}:`, error);
|
|
333
|
+
rewardsData[address.toLowerCase() as EthAddress].compV3[market.value] = { error: `Error fetching Compound V3 rewards data for address ${address}`, data: null };
|
|
334
|
+
}
|
|
335
|
+
})).flat(),
|
|
336
|
+
...addresses.map(async (address) => {
|
|
337
|
+
try {
|
|
338
|
+
const aaveMeritData = await getMeritUnclaimedRewards(address, network);
|
|
339
|
+
rewardsData[address.toLowerCase() as EthAddress].aaveV3merit = { error: '', data: aaveMeritData };
|
|
340
|
+
} catch (error) {
|
|
341
|
+
console.error(`Error fetching Aave V3 Merit rewards data for address ${address}:`, error);
|
|
342
|
+
rewardsData[address.toLowerCase() as EthAddress].aaveV3merit = { error: `Error fetching Aave V3 Merit rewards data for address ${address}`, data: null };
|
|
343
|
+
}
|
|
344
|
+
}),
|
|
345
|
+
...aaveV3Markets.map(market => addresses.map(async (address) => {
|
|
346
|
+
try {
|
|
347
|
+
const aaveData = await getUnclaimedRewardsForAllMarkets(client, network, address, market.providerAddress);
|
|
348
|
+
rewardsData[address.toLowerCase() as EthAddress].aaveV3[market.value] = { error: '', data: aaveData };
|
|
349
|
+
} catch (error) {
|
|
350
|
+
console.error(`Error fetching Aave V3 Merit rewards data for address ${address}:`, error);
|
|
351
|
+
rewardsData[address.toLowerCase() as EthAddress].aaveV3 = { error: `Error fetching Aave V3 rewards data for address ${address}`, data: null };
|
|
352
|
+
}
|
|
353
|
+
})).flat(),
|
|
354
|
+
// Batch Morpho Blue rewards
|
|
355
|
+
(async () => {
|
|
356
|
+
try {
|
|
357
|
+
const morphoRewards = await fetchMorphoBlueRewards(client, network, addresses);
|
|
358
|
+
for (const address of addresses) {
|
|
359
|
+
const lowerAddress = address.toLowerCase() as EthAddress;
|
|
360
|
+
rewardsData[lowerAddress].morpho = {
|
|
361
|
+
error: '',
|
|
362
|
+
data: morphoRewards[lowerAddress] || [],
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
} catch (error) {
|
|
366
|
+
console.error('Error fetching Morpho Blue rewards data in batch:', error);
|
|
367
|
+
for (const address of addresses) {
|
|
368
|
+
rewardsData[address.toLowerCase() as EthAddress].morpho = {
|
|
369
|
+
error: 'Error fetching Morpho Blue rewards data in batch',
|
|
370
|
+
data: null,
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
})(),
|
|
375
|
+
// Batch Spark Airdrop rewards
|
|
376
|
+
(async () => {
|
|
377
|
+
try {
|
|
378
|
+
if (!isMainnet) {
|
|
379
|
+
for (const address of addresses) {
|
|
380
|
+
rewardsData[address.toLowerCase()].spk = { error: '', data: [] };
|
|
381
|
+
}
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const sparkAirdropRewards = await fetchSparkAirdropRewards(client, network, addresses);
|
|
386
|
+
for (const address of addresses) {
|
|
387
|
+
const lowerAddress = address.toLowerCase() as EthAddress;
|
|
388
|
+
rewardsData[lowerAddress].spk = {
|
|
389
|
+
error: '',
|
|
390
|
+
data: sparkAirdropRewards[lowerAddress] || [],
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
} catch (error) {
|
|
394
|
+
console.error('Error fetching Spark Airdrop rewards data in batch:', error);
|
|
395
|
+
for (const address of addresses) {
|
|
396
|
+
rewardsData[address.toLowerCase() as EthAddress].spk = {
|
|
397
|
+
error: 'Error fetching Spark Airdrop rewards data in batch',
|
|
398
|
+
data: null,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
})(),
|
|
160
403
|
]);
|
|
161
404
|
|
|
162
405
|
|
|
@@ -172,8 +415,31 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
172
415
|
})).flat(),
|
|
173
416
|
...morphoMarkets.map((market) => addresses.map(async (address) => {
|
|
174
417
|
try {
|
|
175
|
-
const
|
|
176
|
-
|
|
418
|
+
const [accDataPromise, earnDataPromise] = await Promise.allSettled([
|
|
419
|
+
_getMorphoBlueAccountData(client, network, address, market, morphoMarketsData[market.value]),
|
|
420
|
+
getMorphoEarn(client, network, address, market, morphoMarketsData[market.value]),
|
|
421
|
+
]);
|
|
422
|
+
if (accDataPromise.status === 'rejected') {
|
|
423
|
+
console.error(`Error fetching MorphoBlue account data for address ${address} on market ${market.value}:`, accDataPromise.reason);
|
|
424
|
+
positions[address.toLowerCase() as EthAddress].morphoBlue[market.value] = { error: `Error fetching MorphoBlue account data for address ${address} on market ${market.value}`, data: null };
|
|
425
|
+
}
|
|
426
|
+
if (earnDataPromise.status === 'rejected') {
|
|
427
|
+
console.error(`Error fetching MorphoBlue account data for address ${address} on market ${market.value}:`, earnDataPromise.reason);
|
|
428
|
+
positions[address.toLowerCase() as EthAddress].morphoBlue[market.value] = { error: `Error fetching MorphoBlue account data for address ${address} on market ${market.value}`, data: null };
|
|
429
|
+
}
|
|
430
|
+
if (accDataPromise.status !== 'rejected') {
|
|
431
|
+
const accData = accDataPromise.value;
|
|
432
|
+
if (new Dec(accData.suppliedUsd).gt(0)) positions[address.toLowerCase() as EthAddress].morphoBlue[market.value] = { error: '', data: accData };
|
|
433
|
+
}
|
|
434
|
+
if (earnDataPromise.status !== 'rejected') {
|
|
435
|
+
const earnData = earnDataPromise.value;
|
|
436
|
+
if (earnData && new Dec(earnData.amount).gt(0)) {
|
|
437
|
+
stakingPositions[address.toLowerCase() as EthAddress].morphoBlue[market.value] = {
|
|
438
|
+
error: '',
|
|
439
|
+
data: earnData,
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
}
|
|
177
443
|
} catch (error) {
|
|
178
444
|
console.error(`Error fetching MorphoBlue account data for address ${address} on market ${market.value}:`, error);
|
|
179
445
|
positions[address.toLowerCase() as EthAddress].morphoBlue[market.value] = { error: `Error fetching MorphoBlue account data for address ${address} on market ${market.value}`, data: null };
|
|
@@ -279,7 +545,26 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
279
545
|
positions[address.toLowerCase() as EthAddress].llamaLend[market.value] = { error: `Error fetching LlamaLend account data for address ${address} on market ${market.value}`, data: null };
|
|
280
546
|
}
|
|
281
547
|
})).flat(),
|
|
548
|
+
// liquity sBold/yBold and staking options
|
|
549
|
+
...addresses.map(async (address) => {
|
|
550
|
+
try {
|
|
551
|
+
if (!isMainnet) {
|
|
552
|
+
stakingPositions[address.toLowerCase() as EthAddress].liquityV2SBoldYBold = { error: '', data: null };
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
const data = await getLiquitySAndYBold(client, network, stakingPositions[address.toLowerCase()].liquityV2, address);
|
|
556
|
+
stakingPositions[address.toLowerCase() as EthAddress].liquityV2SBoldYBold = { error: '', data };
|
|
557
|
+
} catch (error) {
|
|
558
|
+
console.error(`Error fetching SBold/YBold data for address ${address}:`, error);
|
|
559
|
+
stakingPositions[address.toLowerCase() as EthAddress].liquityV2SBoldYBold = { error: `Error fetching sBold/yBold data for address ${address}`, data: null };
|
|
560
|
+
}
|
|
561
|
+
}),
|
|
282
562
|
]);
|
|
283
563
|
|
|
284
|
-
return
|
|
564
|
+
return {
|
|
565
|
+
positions,
|
|
566
|
+
stakingPositions,
|
|
567
|
+
rewardsData,
|
|
568
|
+
markets,
|
|
569
|
+
};
|
|
285
570
|
}
|
package/src/services/utils.ts
CHANGED
|
@@ -61,4 +61,40 @@ export const isMaxuint = (amount: string) => compareAddresses(MAXUINT, amount);
|
|
|
61
61
|
|
|
62
62
|
export const isMainnetNetwork = (network: NetworkNumber) => network === NetworkNumber.Eth;
|
|
63
63
|
|
|
64
|
-
export const DEFAULT_TIMEOUT = 2000; // 2 seconds
|
|
64
|
+
export const DEFAULT_TIMEOUT = 2000; // 2 seconds
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Converts web3 hybrid response (that can be used as objects and arrays, so has duplicated values) to objects.
|
|
68
|
+
* @param value
|
|
69
|
+
*/
|
|
70
|
+
export const convertHybridArraysToObjects = (value: any): any => {
|
|
71
|
+
if (Array.isArray(value)) {
|
|
72
|
+
const keys = Object.keys(value);
|
|
73
|
+
const hasNamedKeys = keys.some((key) => Number.isNaN(Number(key)));
|
|
74
|
+
|
|
75
|
+
// If array has named keys, treat it as an object and keep only those
|
|
76
|
+
if (hasNamedKeys) {
|
|
77
|
+
const result: Record<string, any> = {};
|
|
78
|
+
for (const [key, val] of Object.entries(value)) {
|
|
79
|
+
if (Number.isNaN(Number(key))) {
|
|
80
|
+
result[key] = convertHybridArraysToObjects(val);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Else, treat as a regular array
|
|
87
|
+
return value.map(convertHybridArraysToObjects);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// If it's an object (but not an array), recurse into its values
|
|
91
|
+
if (value && typeof value === 'object') {
|
|
92
|
+
const result: Record<string, any> = {};
|
|
93
|
+
for (const [key, val] of Object.entries(value)) {
|
|
94
|
+
result[key] = convertHybridArraysToObjects(val);
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return value;
|
|
100
|
+
};
|
package/src/spark/index.ts
CHANGED
|
@@ -274,7 +274,8 @@ export const _getSparkAccountBalances = async (provider: Client, network: Networ
|
|
|
274
274
|
// @ts-ignore
|
|
275
275
|
const protocolDataProviderContract = createViemContractFromConfigFunc(market.protocolData, market.protocolDataAddress)(provider, network);
|
|
276
276
|
|
|
277
|
-
|
|
277
|
+
// @ts-ignore
|
|
278
|
+
const reserveTokens = await protocolDataProviderContract.read.getAllReservesTokens(setViemBlockNumber(block)) as { symbol: string, tokenAddress: EthAddress }[];
|
|
278
279
|
const symbols = reserveTokens.map(({ symbol }: { symbol: string }) => symbol);
|
|
279
280
|
const _addresses = reserveTokens.map(({ tokenAddress }: { tokenAddress: EthAddress }) => tokenAddress);
|
|
280
281
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Dec from 'decimal.js';
|
|
2
2
|
import { IncentiveEligibilityId, MMUsedAssets } from '../types/common';
|
|
3
3
|
|
|
4
|
-
export const isEligibleForEthenaUSDeRewards = (usedAssets: MMUsedAssets) => {
|
|
4
|
+
export const isEligibleForEthenaUSDeRewards = (usedAssets: MMUsedAssets, { healthRatio }: { healthRatio: string }) => {
|
|
5
5
|
const USDeUSDAmountSupplied = usedAssets.USDe?.suppliedUsd || '0';
|
|
6
6
|
const sUSDeUSDAmountSupplied = usedAssets.sUSDe?.suppliedUsd || '0';
|
|
7
7
|
const anythingElseSupplied = Object.values(usedAssets).some((asset) => asset.symbol !== 'USDe' && asset.symbol !== 'sUSDe' && asset.isSupplied);
|
|
@@ -23,8 +23,7 @@ export const isEligibleForEthenaUSDeRewards = (usedAssets: MMUsedAssets) => {
|
|
|
23
23
|
return acc;
|
|
24
24
|
}, new Dec(0)).toString();
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
if (borrowPercentage < 0.5) return { isEligible: false, eligibleUSDAmount: '0' }; // must be looped at least once
|
|
26
|
+
if (new Dec(healthRatio).gte(2.5)) return { isEligible: false, eligibleUSDAmount: '0' }; // health ratio must be below 2.5
|
|
28
27
|
|
|
29
28
|
const halfAmountSupplied = new Dec(totalAmountSupplied).div(2).toString();
|
|
30
29
|
const USDeAmountEligibleForRewards = Dec.min(USDeUSDAmountSupplied, halfAmountSupplied).toString(); // rewards are given to amount of USDe supplied up to half of total amount supplied
|
|
@@ -54,7 +53,7 @@ export const isEligibleForAaveV3ArbitrumETHLSBorrow = (usedAssets: MMUsedAssets)
|
|
|
54
53
|
return { isEligible: true, eligibleUSDAmount: ETHAmountBorrowed };
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
export const EligibilityMapping: { [key in IncentiveEligibilityId]: (usedAssets: MMUsedAssets) => { isEligible: boolean; eligibleUSDAmount: string } } = {
|
|
56
|
+
export const EligibilityMapping: { [key in IncentiveEligibilityId]: (usedAssets: MMUsedAssets, optionalData: any) => { isEligible: boolean; eligibleUSDAmount: string } } = {
|
|
58
57
|
[IncentiveEligibilityId.AaveV3EthenaLiquidLeverage]: isEligibleForEthenaUSDeRewards,
|
|
59
58
|
[IncentiveEligibilityId.AaveV3ArbitrumEthSupply]: isEligibleForAaveV3ArbitrumEthSupply,
|
|
60
59
|
[IncentiveEligibilityId.AaveV3ArbitrumETHLSBorrow]: isEligibleForAaveV3ArbitrumETHLSBorrow,
|
package/src/staking/staking.ts
CHANGED
|
@@ -106,8 +106,8 @@ export const calculateInterestEarned = (principal: string, interest: string, typ
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
export const calculateNetApy = ({
|
|
109
|
-
usedAssets, assetsData,
|
|
110
|
-
}: { usedAssets: MMUsedAssets, assetsData: MMAssetsData }) => {
|
|
109
|
+
usedAssets, assetsData, optionalData,
|
|
110
|
+
}: { usedAssets: MMUsedAssets, assetsData: MMAssetsData, optionalData?: any }) => {
|
|
111
111
|
const sumValues = Object.values(usedAssets).reduce((_acc, usedAsset) => {
|
|
112
112
|
const acc = { ..._acc };
|
|
113
113
|
const assetData = assetsData[usedAsset.symbol] || assetsData[(usedAsset as EulerV2UsedAsset).vaultAddress?.toLowerCase() || ''];
|
|
@@ -123,7 +123,7 @@ export const calculateNetApy = ({
|
|
|
123
123
|
const { apy, eligibilityId } = supplyIncentive;
|
|
124
124
|
const eligibilityCheck = eligibilityId ? EligibilityMapping[eligibilityId] : null;
|
|
125
125
|
if (eligibilityCheck) {
|
|
126
|
-
const { isEligible, eligibleUSDAmount } = eligibilityCheck(usedAssets);
|
|
126
|
+
const { isEligible, eligibleUSDAmount } = eligibilityCheck(usedAssets, optionalData);
|
|
127
127
|
const incentiveInterest = isEligible ? calculateInterestEarned(eligibleUSDAmount, apy, 'year', true) : '0';
|
|
128
128
|
acc.incentiveUsd = new Dec(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
129
129
|
} else {
|
|
@@ -144,7 +144,7 @@ export const calculateNetApy = ({
|
|
|
144
144
|
const { apy, eligibilityId } = borrowIncentive;
|
|
145
145
|
const eligibilityCheck = eligibilityId ? EligibilityMapping[eligibilityId] : null;
|
|
146
146
|
if (eligibilityCheck) {
|
|
147
|
-
const { isEligible, eligibleUSDAmount } = eligibilityCheck(usedAssets);
|
|
147
|
+
const { isEligible, eligibleUSDAmount } = eligibilityCheck(usedAssets, optionalData);
|
|
148
148
|
const incentiveInterest = isEligible ? calculateInterestEarned(eligibleUSDAmount, apy, 'year', true) : '0';
|
|
149
149
|
acc.incentiveUsd = new Dec(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
150
150
|
} else {
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
|
|
22
|
+
type _ClaimableTokenPartial = {
|
|
23
|
+
symbol: string;
|
|
24
|
+
underlyingSymbol: string;
|
|
25
|
+
tokenAddress: EthAddress;
|
|
26
|
+
amount: string;
|
|
27
|
+
walletAddress: EthAddress;
|
|
28
|
+
label: string;
|
|
29
|
+
};
|
|
30
|
+
export type AaveRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
31
|
+
claimType: ClaimType.AAVE_REWARDS;
|
|
32
|
+
additionalClaimFields: {
|
|
33
|
+
marketAddress: EthAddress;
|
|
34
|
+
aTokenAddresses: string[];
|
|
35
|
+
isAaveToken: boolean;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type AaveMeritRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
39
|
+
claimType: ClaimType.AAVE_MERIT_REWARDS;
|
|
40
|
+
additionalClaimFields: {
|
|
41
|
+
accumulated: string;
|
|
42
|
+
proof: string[];
|
|
43
|
+
decimals: string;
|
|
44
|
+
unclaimed: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type SparkRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
49
|
+
claimType: ClaimType.SPARK_REWARDS;
|
|
50
|
+
additionalClaimFields: {
|
|
51
|
+
sparkAssetAddresses: string[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type KingRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
56
|
+
claimType: ClaimType.KING_REWARDS;
|
|
57
|
+
additionalClaimFields: {
|
|
58
|
+
allRewardsAmount: string;
|
|
59
|
+
merkleRoot: string;
|
|
60
|
+
merkleProofs: string[];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type MorphoClaimableToken = _ClaimableTokenPartial & {
|
|
65
|
+
claimType: ClaimType.MORPHO,
|
|
66
|
+
additionalClaimFields: {
|
|
67
|
+
originalAmount: string,
|
|
68
|
+
merkleProofs: string[];
|
|
69
|
+
distributor: EthAddress;
|
|
70
|
+
isLegacy: boolean;
|
|
71
|
+
txData: string;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
export type CompoundV3CompClaimableToken = _ClaimableTokenPartial & {
|
|
77
|
+
claimType: ClaimType.COMPOUND_V3_COMP,
|
|
78
|
+
additionalClaimFields: {
|
|
79
|
+
marketAddress: EthAddress;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export enum SparkAirdropType {
|
|
84
|
+
SPARK_IGNITION = 'spark-ignition',
|
|
85
|
+
PRE_FARMING_AND_SOCIAL = 'pre-farming-and-social',
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type SparkAirdropClaimableToken = _ClaimableTokenPartial & {
|
|
89
|
+
claimType: ClaimType.SPARK_AIRDROP,
|
|
90
|
+
additionalClaimFields: {
|
|
91
|
+
merkleRoot: string;
|
|
92
|
+
merkleProofs: string[];
|
|
93
|
+
epoch: number;
|
|
94
|
+
rewardType: SparkAirdropType;
|
|
95
|
+
allRewardsAmount: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export type SparkWstEthRewardsClaimableToken = _ClaimableTokenPartial & { claimType: ClaimType.SPARK_WST_ETH_REWARDS };
|
|
100
|
+
|
|
101
|
+
export type ClaimableToken =
|
|
102
|
+
AaveRewardsClaimableToken
|
|
103
|
+
| AaveMeritRewardsClaimableToken
|
|
104
|
+
| CompoundV3CompClaimableToken
|
|
105
|
+
| MorphoClaimableToken
|
|
106
|
+
| SparkRewardsClaimableToken
|
|
107
|
+
| KingRewardsClaimableToken
|
|
108
|
+
| SparkAirdropClaimableToken
|
|
109
|
+
| SparkWstEthRewardsClaimableToken;
|
package/src/types/common.ts
CHANGED
|
@@ -4,7 +4,7 @@ export enum IncentiveKind {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
export enum IncentiveEligibilityId {
|
|
7
|
-
AaveV3EthenaLiquidLeverage = '
|
|
7
|
+
AaveV3EthenaLiquidLeverage = '0x7361e6f04060154e0268a8402b073cbf97e11ae3BORROW_BL',
|
|
8
8
|
AaveV3ArbitrumEthSupply = '0x5d16261c6715a653248269861bbacf68a9774cde',
|
|
9
9
|
AaveV3ArbitrumETHLSBorrow = '0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351',
|
|
10
10
|
}
|