@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
|
@@ -1,191 +1,191 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AaveV4HubInfo,
|
|
3
|
-
AaveV4HubsType,
|
|
4
|
-
AaveV4SpokeInfo,
|
|
5
|
-
AaveV4SpokesType,
|
|
6
|
-
NetworkNumber,
|
|
7
|
-
} from '../../types';
|
|
8
|
-
|
|
9
|
-
// HUBS
|
|
10
|
-
|
|
11
|
-
export const AAVE_V4_CORE_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
|
|
12
|
-
chainIds: [NetworkNumber.Eth],
|
|
13
|
-
label: 'Core Hub',
|
|
14
|
-
value: AaveV4HubsType.AaveV4CoreHub,
|
|
15
|
-
address: '0xCca852Bc40e560adC3b1Cc58CA5b55638ce826c9',
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const AAVE_V4_PLUS_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
|
|
19
|
-
chainIds: [NetworkNumber.Eth],
|
|
20
|
-
label: 'Plus Hub',
|
|
21
|
-
value: AaveV4HubsType.AaveV4PlusHub,
|
|
22
|
-
address: '0x06002e9c4412CB7814a791eA3666D905871E536A',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const AAVE_V4_PRIME_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
|
|
26
|
-
chainIds: [NetworkNumber.Eth],
|
|
27
|
-
label: 'Prime Hub',
|
|
28
|
-
value: AaveV4HubsType.AaveV4PrimeHub,
|
|
29
|
-
address: '0x943827DCA022D0F354a8a8c332dA1e5Eb9f9F931',
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const AaveV4Hubs = (networkId: NetworkNumber) => ({
|
|
33
|
-
[AaveV4HubsType.AaveV4CoreHub]: AAVE_V4_CORE_HUB(networkId),
|
|
34
|
-
[AaveV4HubsType.AaveV4PlusHub]: AAVE_V4_PLUS_HUB(networkId),
|
|
35
|
-
[AaveV4HubsType.AaveV4PrimeHub]: AAVE_V4_PRIME_HUB(networkId),
|
|
36
|
-
}) as const;
|
|
37
|
-
|
|
38
|
-
export const getAaveV4HubTypeInfo = (type: AaveV4HubsType, network?: NetworkNumber) => ({ ...AaveV4Hubs(network ?? NetworkNumber.Eth) }[type]);
|
|
39
|
-
|
|
40
|
-
export const getAaveV4HubByAddress = (networkId: NetworkNumber, address: string): AaveV4HubInfo | undefined => Object.values(AaveV4Hubs(networkId)).find(
|
|
41
|
-
hub => hub.address.toLowerCase() === address.toLowerCase(),
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
// SPOKES
|
|
45
|
-
|
|
46
|
-
export const AAVE_V4_BLUECHIP_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
47
|
-
chainIds: [NetworkNumber.Eth],
|
|
48
|
-
label: 'Bluechip',
|
|
49
|
-
value: AaveV4SpokesType.AaveV4BluechipSpoke,
|
|
50
|
-
url: 'bluechip',
|
|
51
|
-
address: '0x973a023A77420ba610f06b3858aD991Df6d85A08',
|
|
52
|
-
hubs: [
|
|
53
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
54
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
55
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export const AAVE_V4_ETHENA_CORRELATED_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
60
|
-
chainIds: [NetworkNumber.Eth],
|
|
61
|
-
label: 'Ethena Correlated',
|
|
62
|
-
value: AaveV4SpokesType.AaveV4EthenaCorrelatedSpoke,
|
|
63
|
-
url: 'ethena-correlated',
|
|
64
|
-
address: '0x58131E79531caB1d52301228d1f7b842F26B9649',
|
|
65
|
-
hubs: [
|
|
66
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
67
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
68
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
69
|
-
],
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
export const AAVE_V4_ETHENA_ECOSYSTEM_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
73
|
-
chainIds: [NetworkNumber.Eth],
|
|
74
|
-
label: 'Ethena Ecosystem',
|
|
75
|
-
value: AaveV4SpokesType.AaveV4EthenaEcosystemSpoke,
|
|
76
|
-
url: 'ethena-ecosystem',
|
|
77
|
-
address: '0xba1B3D55D249692b669A164024A838309B7508AF',
|
|
78
|
-
hubs: [
|
|
79
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
80
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
81
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
82
|
-
],
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
export const AAVE_V4_ETHERFI_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
86
|
-
chainIds: [NetworkNumber.Eth],
|
|
87
|
-
label: 'Etherfi',
|
|
88
|
-
value: AaveV4SpokesType.AaveV4EtherfiSpoke,
|
|
89
|
-
url: 'etherfi',
|
|
90
|
-
address: '0xbF10BDfE177dE0336aFD7fcCF80A904E15386219',
|
|
91
|
-
hubs: [
|
|
92
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
93
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
94
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
95
|
-
],
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
export const AAVE_V4_FOREX_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
99
|
-
chainIds: [NetworkNumber.Eth],
|
|
100
|
-
label: 'Forex',
|
|
101
|
-
value: AaveV4SpokesType.AaveV4ForexSpoke,
|
|
102
|
-
url: 'forex',
|
|
103
|
-
address: '0xD8B93635b8C6d0fF98CbE90b5988E3F2d1Cd9da1',
|
|
104
|
-
hubs: [
|
|
105
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
106
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
107
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
108
|
-
],
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
export const AAVE_V4_GOLD_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
112
|
-
chainIds: [NetworkNumber.Eth],
|
|
113
|
-
label: 'Gold',
|
|
114
|
-
value: AaveV4SpokesType.AaveV4GoldSpoke,
|
|
115
|
-
url: 'gold',
|
|
116
|
-
address: '0x65407b940966954b23dfA3caA5C0702bB42984DC',
|
|
117
|
-
hubs: [
|
|
118
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
119
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
120
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
121
|
-
],
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
export const AAVE_V4_KELP_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
125
|
-
chainIds: [NetworkNumber.Eth],
|
|
126
|
-
label: 'Kelp',
|
|
127
|
-
value: AaveV4SpokesType.AaveV4KelpSpoke,
|
|
128
|
-
url: 'kelp',
|
|
129
|
-
address: '0x3131FE68C4722e726fe6B2819ED68e514395B9a4',
|
|
130
|
-
hubs: [
|
|
131
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
132
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
133
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
134
|
-
],
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
export const AAVE_V4_LIDO_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
138
|
-
chainIds: [NetworkNumber.Eth],
|
|
139
|
-
label: 'Lido',
|
|
140
|
-
value: AaveV4SpokesType.AaveV4LidoSpoke,
|
|
141
|
-
url: 'lido',
|
|
142
|
-
address: '0xe1900480ac69f0B296841Cd01cC37546d92F35Cd',
|
|
143
|
-
hubs: [
|
|
144
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
145
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
146
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
147
|
-
],
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
export const AAVE_V4_LOMBARD_BTC_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
151
|
-
chainIds: [NetworkNumber.Eth],
|
|
152
|
-
label: 'Lombard BTC',
|
|
153
|
-
value: AaveV4SpokesType.AaveV4LombardBtcSpoke,
|
|
154
|
-
url: 'lombard-btc',
|
|
155
|
-
address: '0x7EC68b5695e803e98a21a9A05d744F28b0a7753D',
|
|
156
|
-
hubs: [
|
|
157
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
158
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
159
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
160
|
-
],
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
export const AAVE_V4_MAIN_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
164
|
-
chainIds: [NetworkNumber.Eth],
|
|
165
|
-
label: 'Main',
|
|
166
|
-
value: AaveV4SpokesType.AaveV4MainSpoke,
|
|
167
|
-
url: 'main',
|
|
168
|
-
address: '0x94e7A5dCbE816e498b89aB752661904E2F56c485',
|
|
169
|
-
hubs: [
|
|
170
|
-
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
171
|
-
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
172
|
-
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
173
|
-
],
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
export const AaveV4Spokes = (networkId: NetworkNumber) => ({
|
|
177
|
-
[AaveV4SpokesType.AaveV4BluechipSpoke]: AAVE_V4_BLUECHIP_SPOKE(networkId),
|
|
178
|
-
[AaveV4SpokesType.AaveV4EthenaCorrelatedSpoke]: AAVE_V4_ETHENA_CORRELATED_SPOKE(networkId),
|
|
179
|
-
[AaveV4SpokesType.AaveV4EthenaEcosystemSpoke]: AAVE_V4_ETHENA_ECOSYSTEM_SPOKE(networkId),
|
|
180
|
-
[AaveV4SpokesType.AaveV4EtherfiSpoke]: AAVE_V4_ETHERFI_SPOKE(networkId),
|
|
181
|
-
[AaveV4SpokesType.AaveV4ForexSpoke]: AAVE_V4_FOREX_SPOKE(networkId),
|
|
182
|
-
[AaveV4SpokesType.AaveV4GoldSpoke]: AAVE_V4_GOLD_SPOKE(networkId),
|
|
183
|
-
[AaveV4SpokesType.AaveV4KelpSpoke]: AAVE_V4_KELP_SPOKE(networkId),
|
|
184
|
-
[AaveV4SpokesType.AaveV4LidoSpoke]: AAVE_V4_LIDO_SPOKE(networkId),
|
|
185
|
-
[AaveV4SpokesType.AaveV4LombardBtcSpoke]: AAVE_V4_LOMBARD_BTC_SPOKE(networkId),
|
|
186
|
-
[AaveV4SpokesType.AaveV4MainSpoke]: AAVE_V4_MAIN_SPOKE(networkId),
|
|
187
|
-
}) as const;
|
|
188
|
-
|
|
189
|
-
export const getAaveV4SpokeTypeInfo = (type: AaveV4SpokesType, network?: NetworkNumber) => ({ ...AaveV4Spokes(network ?? NetworkNumber.Eth) }[type]);
|
|
190
|
-
|
|
191
|
-
|
|
1
|
+
import {
|
|
2
|
+
AaveV4HubInfo,
|
|
3
|
+
AaveV4HubsType,
|
|
4
|
+
AaveV4SpokeInfo,
|
|
5
|
+
AaveV4SpokesType,
|
|
6
|
+
NetworkNumber,
|
|
7
|
+
} from '../../types';
|
|
8
|
+
|
|
9
|
+
// HUBS
|
|
10
|
+
|
|
11
|
+
export const AAVE_V4_CORE_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
|
|
12
|
+
chainIds: [NetworkNumber.Eth],
|
|
13
|
+
label: 'Core Hub',
|
|
14
|
+
value: AaveV4HubsType.AaveV4CoreHub,
|
|
15
|
+
address: '0xCca852Bc40e560adC3b1Cc58CA5b55638ce826c9',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const AAVE_V4_PLUS_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
|
|
19
|
+
chainIds: [NetworkNumber.Eth],
|
|
20
|
+
label: 'Plus Hub',
|
|
21
|
+
value: AaveV4HubsType.AaveV4PlusHub,
|
|
22
|
+
address: '0x06002e9c4412CB7814a791eA3666D905871E536A',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const AAVE_V4_PRIME_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
|
|
26
|
+
chainIds: [NetworkNumber.Eth],
|
|
27
|
+
label: 'Prime Hub',
|
|
28
|
+
value: AaveV4HubsType.AaveV4PrimeHub,
|
|
29
|
+
address: '0x943827DCA022D0F354a8a8c332dA1e5Eb9f9F931',
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const AaveV4Hubs = (networkId: NetworkNumber) => ({
|
|
33
|
+
[AaveV4HubsType.AaveV4CoreHub]: AAVE_V4_CORE_HUB(networkId),
|
|
34
|
+
[AaveV4HubsType.AaveV4PlusHub]: AAVE_V4_PLUS_HUB(networkId),
|
|
35
|
+
[AaveV4HubsType.AaveV4PrimeHub]: AAVE_V4_PRIME_HUB(networkId),
|
|
36
|
+
}) as const;
|
|
37
|
+
|
|
38
|
+
export const getAaveV4HubTypeInfo = (type: AaveV4HubsType, network?: NetworkNumber) => ({ ...AaveV4Hubs(network ?? NetworkNumber.Eth) }[type]);
|
|
39
|
+
|
|
40
|
+
export const getAaveV4HubByAddress = (networkId: NetworkNumber, address: string): AaveV4HubInfo | undefined => Object.values(AaveV4Hubs(networkId)).find(
|
|
41
|
+
hub => hub.address.toLowerCase() === address.toLowerCase(),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// SPOKES
|
|
45
|
+
|
|
46
|
+
export const AAVE_V4_BLUECHIP_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
47
|
+
chainIds: [NetworkNumber.Eth],
|
|
48
|
+
label: 'Bluechip',
|
|
49
|
+
value: AaveV4SpokesType.AaveV4BluechipSpoke,
|
|
50
|
+
url: 'bluechip',
|
|
51
|
+
address: '0x973a023A77420ba610f06b3858aD991Df6d85A08',
|
|
52
|
+
hubs: [
|
|
53
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
54
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
55
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
56
|
+
],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const AAVE_V4_ETHENA_CORRELATED_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
60
|
+
chainIds: [NetworkNumber.Eth],
|
|
61
|
+
label: 'Ethena Correlated',
|
|
62
|
+
value: AaveV4SpokesType.AaveV4EthenaCorrelatedSpoke,
|
|
63
|
+
url: 'ethena-correlated',
|
|
64
|
+
address: '0x58131E79531caB1d52301228d1f7b842F26B9649',
|
|
65
|
+
hubs: [
|
|
66
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
67
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
68
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
69
|
+
],
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export const AAVE_V4_ETHENA_ECOSYSTEM_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
73
|
+
chainIds: [NetworkNumber.Eth],
|
|
74
|
+
label: 'Ethena Ecosystem',
|
|
75
|
+
value: AaveV4SpokesType.AaveV4EthenaEcosystemSpoke,
|
|
76
|
+
url: 'ethena-ecosystem',
|
|
77
|
+
address: '0xba1B3D55D249692b669A164024A838309B7508AF',
|
|
78
|
+
hubs: [
|
|
79
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
80
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
81
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
82
|
+
],
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const AAVE_V4_ETHERFI_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
86
|
+
chainIds: [NetworkNumber.Eth],
|
|
87
|
+
label: 'Etherfi',
|
|
88
|
+
value: AaveV4SpokesType.AaveV4EtherfiSpoke,
|
|
89
|
+
url: 'etherfi',
|
|
90
|
+
address: '0xbF10BDfE177dE0336aFD7fcCF80A904E15386219',
|
|
91
|
+
hubs: [
|
|
92
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
93
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
94
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
95
|
+
],
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export const AAVE_V4_FOREX_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
99
|
+
chainIds: [NetworkNumber.Eth],
|
|
100
|
+
label: 'Forex',
|
|
101
|
+
value: AaveV4SpokesType.AaveV4ForexSpoke,
|
|
102
|
+
url: 'forex',
|
|
103
|
+
address: '0xD8B93635b8C6d0fF98CbE90b5988E3F2d1Cd9da1',
|
|
104
|
+
hubs: [
|
|
105
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
106
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
107
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export const AAVE_V4_GOLD_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
112
|
+
chainIds: [NetworkNumber.Eth],
|
|
113
|
+
label: 'Gold',
|
|
114
|
+
value: AaveV4SpokesType.AaveV4GoldSpoke,
|
|
115
|
+
url: 'gold',
|
|
116
|
+
address: '0x65407b940966954b23dfA3caA5C0702bB42984DC',
|
|
117
|
+
hubs: [
|
|
118
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
119
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
120
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
121
|
+
],
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export const AAVE_V4_KELP_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
125
|
+
chainIds: [NetworkNumber.Eth],
|
|
126
|
+
label: 'Kelp',
|
|
127
|
+
value: AaveV4SpokesType.AaveV4KelpSpoke,
|
|
128
|
+
url: 'kelp',
|
|
129
|
+
address: '0x3131FE68C4722e726fe6B2819ED68e514395B9a4',
|
|
130
|
+
hubs: [
|
|
131
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
132
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
133
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
134
|
+
],
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export const AAVE_V4_LIDO_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
138
|
+
chainIds: [NetworkNumber.Eth],
|
|
139
|
+
label: 'Lido',
|
|
140
|
+
value: AaveV4SpokesType.AaveV4LidoSpoke,
|
|
141
|
+
url: 'lido',
|
|
142
|
+
address: '0xe1900480ac69f0B296841Cd01cC37546d92F35Cd',
|
|
143
|
+
hubs: [
|
|
144
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
145
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
146
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
147
|
+
],
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
export const AAVE_V4_LOMBARD_BTC_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
151
|
+
chainIds: [NetworkNumber.Eth],
|
|
152
|
+
label: 'Lombard BTC',
|
|
153
|
+
value: AaveV4SpokesType.AaveV4LombardBtcSpoke,
|
|
154
|
+
url: 'lombard-btc',
|
|
155
|
+
address: '0x7EC68b5695e803e98a21a9A05d744F28b0a7753D',
|
|
156
|
+
hubs: [
|
|
157
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
158
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
159
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
160
|
+
],
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export const AAVE_V4_MAIN_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
164
|
+
chainIds: [NetworkNumber.Eth],
|
|
165
|
+
label: 'Main',
|
|
166
|
+
value: AaveV4SpokesType.AaveV4MainSpoke,
|
|
167
|
+
url: 'main',
|
|
168
|
+
address: '0x94e7A5dCbE816e498b89aB752661904E2F56c485',
|
|
169
|
+
hubs: [
|
|
170
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
171
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
172
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
173
|
+
],
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
export const AaveV4Spokes = (networkId: NetworkNumber) => ({
|
|
177
|
+
[AaveV4SpokesType.AaveV4BluechipSpoke]: AAVE_V4_BLUECHIP_SPOKE(networkId),
|
|
178
|
+
[AaveV4SpokesType.AaveV4EthenaCorrelatedSpoke]: AAVE_V4_ETHENA_CORRELATED_SPOKE(networkId),
|
|
179
|
+
[AaveV4SpokesType.AaveV4EthenaEcosystemSpoke]: AAVE_V4_ETHENA_ECOSYSTEM_SPOKE(networkId),
|
|
180
|
+
[AaveV4SpokesType.AaveV4EtherfiSpoke]: AAVE_V4_ETHERFI_SPOKE(networkId),
|
|
181
|
+
[AaveV4SpokesType.AaveV4ForexSpoke]: AAVE_V4_FOREX_SPOKE(networkId),
|
|
182
|
+
[AaveV4SpokesType.AaveV4GoldSpoke]: AAVE_V4_GOLD_SPOKE(networkId),
|
|
183
|
+
[AaveV4SpokesType.AaveV4KelpSpoke]: AAVE_V4_KELP_SPOKE(networkId),
|
|
184
|
+
[AaveV4SpokesType.AaveV4LidoSpoke]: AAVE_V4_LIDO_SPOKE(networkId),
|
|
185
|
+
[AaveV4SpokesType.AaveV4LombardBtcSpoke]: AAVE_V4_LOMBARD_BTC_SPOKE(networkId),
|
|
186
|
+
[AaveV4SpokesType.AaveV4MainSpoke]: AAVE_V4_MAIN_SPOKE(networkId),
|
|
187
|
+
}) as const;
|
|
188
|
+
|
|
189
|
+
export const getAaveV4SpokeTypeInfo = (type: AaveV4SpokesType, network?: NetworkNumber) => ({ ...AaveV4Spokes(network ?? NetworkNumber.Eth) }[type]);
|
|
190
|
+
|
|
191
|
+
|