@defisaver/positions-sdk 2.1.11 → 2.1.13
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 +1 -1
- package/cjs/contracts.d.ts +100947 -134653
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/markets/aave/marketAssets.js +1 -1
- package/cjs/services/viem.d.ts +2 -3254
- package/cjs/staking/staking.d.ts +1 -1
- package/cjs/staking/staking.js +17 -14
- package/esm/aaveV3/index.js +1 -1
- package/esm/contracts.d.ts +100947 -134653
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/markets/aave/marketAssets.js +1 -1
- package/esm/services/viem.d.ts +2 -3254
- package/esm/staking/staking.d.ts +1 -1
- package/esm/staking/staking.js +17 -14
- package/package.json +47 -47
- package/src/aaveV2/index.ts +240 -240
- package/src/aaveV3/index.ts +614 -614
- package/src/aaveV3/merit.ts +97 -97
- package/src/aaveV3/merkl.ts +74 -74
- package/src/claiming/aaveV3.ts +154 -154
- package/src/claiming/compV3.ts +22 -22
- 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 +244 -244
- package/src/compoundV3/index.ts +274 -274
- package/src/config/contracts.ts +1251 -1251
- package/src/constants/index.ts +10 -10
- package/src/contracts.ts +120 -120
- package/src/curveUsd/index.ts +254 -254
- package/src/eulerV2/index.ts +324 -324
- package/src/exchange/index.ts +25 -25
- package/src/fluid/index.ts +1668 -1668
- package/src/helpers/aaveHelpers/index.ts +187 -187
- package/src/helpers/compoundHelpers/index.ts +283 -283
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +222 -222
- package/src/helpers/fluidHelpers/index.ts +326 -326
- package/src/helpers/index.ts +10 -10
- package/src/helpers/liquityV2Helpers/index.ts +82 -82
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +52 -52
- package/src/helpers/morphoBlueHelpers/index.ts +396 -396
- package/src/helpers/sparkHelpers/index.ts +158 -158
- package/src/index.ts +47 -47
- package/src/liquity/index.ts +159 -159
- package/src/liquityV2/index.ts +657 -657
- package/src/llamaLend/index.ts +305 -305
- package/src/maker/index.ts +223 -223
- package/src/markets/aave/index.ts +116 -116
- package/src/markets/aave/marketAssets.ts +54 -54
- package/src/markets/compound/index.ts +238 -238
- 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 +2460 -2460
- package/src/markets/index.ts +25 -25
- 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 +895 -895
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +12 -12
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoBlue/index.ts +274 -274
- package/src/portfolio/index.ts +570 -570
- package/src/services/priceService.ts +159 -159
- package/src/services/utils.ts +115 -115
- package/src/services/viem.ts +34 -34
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +456 -456
- package/src/staking/eligibility.ts +53 -53
- package/src/staking/index.ts +1 -1
- package/src/staking/staking.ts +177 -172
- package/src/types/aave.ts +189 -189
- package/src/types/claiming.ts +109 -109
- package/src/types/common.ts +107 -107
- package/src/types/compound.ts +136 -136
- package/src/types/curveUsd.ts +123 -123
- package/src/types/euler.ts +175 -175
- package/src/types/fluid.ts +452 -452
- package/src/types/index.ts +13 -13
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +126 -126
- package/src/types/llamaLend.ts +159 -159
- package/src/types/maker.ts +63 -63
- package/src/types/merit.ts +1 -1
- package/src/types/merkl.ts +70 -70
- package/src/types/morphoBlue.ts +194 -194
- package/src/types/portfolio.ts +60 -60
- package/src/types/spark.ts +133 -133
- package/src/umbrella/index.ts +69 -69
- package/src/umbrella/umbrellaUtils.ts +29 -29
|
@@ -1,239 +1,239 @@
|
|
|
1
|
-
import { ZERO_ADDRESS } from '../../constants';
|
|
2
|
-
import { getConfigContractAddress } from '../../contracts';
|
|
3
|
-
import { CompoundBulkerOptions, CompoundMarketData, CompoundVersions } from '../../types';
|
|
4
|
-
import { NetworkNumber } from '../../types/common';
|
|
5
|
-
import {
|
|
6
|
-
compoundV2CollateralAssets,
|
|
7
|
-
v3ETHCollAssets,
|
|
8
|
-
v3USDbCCollAssets,
|
|
9
|
-
v3USDCCollAssets,
|
|
10
|
-
v3USDCeCollAssets,
|
|
11
|
-
v3USDSCollAssets,
|
|
12
|
-
v3USDTCollAssets,
|
|
13
|
-
v3wstETHCollAssets,
|
|
14
|
-
} from './marketsAssets';
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
compoundV2CollateralAssets,
|
|
18
|
-
v3ETHCollAssets,
|
|
19
|
-
v3USDbCCollAssets,
|
|
20
|
-
v3USDCCollAssets,
|
|
21
|
-
v3USDCeCollAssets,
|
|
22
|
-
v3USDTCollAssets,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const EMPTY_BULKER_OPTIONS: CompoundBulkerOptions = { supply: '', withdraw: '' };
|
|
26
|
-
|
|
27
|
-
const STANDARD_BULKER_OPTIONS: CompoundBulkerOptions = {
|
|
28
|
-
supply: '0x414354494f4e5f535550504c595f4e41544956455f544f4b454e000000000000',
|
|
29
|
-
withdraw: '0x414354494f4e5f57495448445241575f4e41544956455f544f4b454e00000000',
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const BULKER_OPTIONS: Record<NetworkNumber, Record<CompoundVersions, CompoundBulkerOptions>> = {
|
|
33
|
-
[NetworkNumber.Eth]: {
|
|
34
|
-
[CompoundVersions.CompoundV3USDC]: { supply: 2, withdraw: 5 },
|
|
35
|
-
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
36
|
-
[CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
|
|
37
|
-
[CompoundVersions.CompoundV3wstETH]: STANDARD_BULKER_OPTIONS,
|
|
38
|
-
[CompoundVersions.CompoundV3USDS]: STANDARD_BULKER_OPTIONS,
|
|
39
|
-
|
|
40
|
-
// Non-existing markets, keeping it because of typescript
|
|
41
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
42
|
-
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
43
|
-
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
44
|
-
},
|
|
45
|
-
[NetworkNumber.Arb]: {
|
|
46
|
-
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
47
|
-
[CompoundVersions.CompoundV3USDCe]: STANDARD_BULKER_OPTIONS,
|
|
48
|
-
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
49
|
-
[CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
|
|
50
|
-
|
|
51
|
-
// Non-existing markets, keeping it because of typescript
|
|
52
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
53
|
-
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
54
|
-
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
55
|
-
[CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
|
|
56
|
-
},
|
|
57
|
-
[NetworkNumber.Base]: {
|
|
58
|
-
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
59
|
-
[CompoundVersions.CompoundV3USDbC]: STANDARD_BULKER_OPTIONS,
|
|
60
|
-
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
61
|
-
[CompoundVersions.CompoundV3USDS]: STANDARD_BULKER_OPTIONS,
|
|
62
|
-
|
|
63
|
-
// Non-existing markets, keeping it because of typescript
|
|
64
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
65
|
-
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
66
|
-
[CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
|
|
67
|
-
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
68
|
-
},
|
|
69
|
-
[NetworkNumber.Opt]: {
|
|
70
|
-
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
71
|
-
[CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
|
|
72
|
-
// Non-existing markets, keeping it because of typescript
|
|
73
|
-
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
74
|
-
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
75
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
76
|
-
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
77
|
-
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
78
|
-
[CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
|
|
79
|
-
},
|
|
80
|
-
[NetworkNumber.Linea]: {
|
|
81
|
-
// Non-existing markets, keeping it because of typescript
|
|
82
|
-
[CompoundVersions.CompoundV3USDC]: EMPTY_BULKER_OPTIONS,
|
|
83
|
-
[CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
|
|
84
|
-
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
85
|
-
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
86
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
87
|
-
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
88
|
-
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
89
|
-
[CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
|
|
90
|
-
},
|
|
91
|
-
[NetworkNumber.Plasma]: {
|
|
92
|
-
// Non-existing markets, keeping it because of typescript
|
|
93
|
-
[CompoundVersions.CompoundV3USDC]: EMPTY_BULKER_OPTIONS,
|
|
94
|
-
[CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
|
|
95
|
-
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
96
|
-
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
97
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
98
|
-
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
99
|
-
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
100
|
-
[CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export const COMPOUND_V2: CompoundMarketData = {
|
|
105
|
-
chainIds: [NetworkNumber.Eth],
|
|
106
|
-
label: 'Compound V2',
|
|
107
|
-
shortLabel: 'v2',
|
|
108
|
-
value: CompoundVersions.CompoundV2,
|
|
109
|
-
baseAsset: '',
|
|
110
|
-
collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
|
|
111
|
-
baseMarket: '',
|
|
112
|
-
baseMarketAddress: ZERO_ADDRESS,
|
|
113
|
-
secondLabel: '',
|
|
114
|
-
bulkerName: '',
|
|
115
|
-
bulkerAddress: ZERO_ADDRESS,
|
|
116
|
-
bulkerOptions: BULKER_OPTIONS[NetworkNumber.Eth][CompoundVersions.CompoundV2],
|
|
117
|
-
// icon: SvgAdapter(protocolIcons.compound),
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export const COMPOUND_V3_USDC = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
121
|
-
chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
|
|
122
|
-
label: 'Compound V3 - USDC',
|
|
123
|
-
shortLabel: 'v3',
|
|
124
|
-
value: CompoundVersions.CompoundV3USDC,
|
|
125
|
-
baseAsset: 'USDC',
|
|
126
|
-
collAssets: networkId ? v3USDCCollAssets[networkId] : [],
|
|
127
|
-
baseMarket: 'cUSDCv3',
|
|
128
|
-
baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
|
|
129
|
-
secondLabel: 'Market',
|
|
130
|
-
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
|
|
131
|
-
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
|
|
132
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
|
|
133
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
137
|
-
chainIds: [NetworkNumber.Arb],
|
|
138
|
-
label: 'Compound V3 - USDC.e',
|
|
139
|
-
shortLabel: 'v3',
|
|
140
|
-
value: CompoundVersions.CompoundV3USDCe,
|
|
141
|
-
baseAsset: 'USDC.e',
|
|
142
|
-
collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
|
|
143
|
-
baseMarket: 'cUSDCev3',
|
|
144
|
-
baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
|
|
145
|
-
secondLabel: 'Market',
|
|
146
|
-
bulkerName: 'CompV3BulkerL2',
|
|
147
|
-
bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
|
|
148
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
|
|
149
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
153
|
-
chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
|
|
154
|
-
label: 'Compound V3 - ETH',
|
|
155
|
-
shortLabel: 'v3',
|
|
156
|
-
value: CompoundVersions.CompoundV3ETH,
|
|
157
|
-
baseAsset: 'ETH',
|
|
158
|
-
collAssets: networkId ? v3ETHCollAssets[networkId] : [],
|
|
159
|
-
baseMarket: 'cETHv3',
|
|
160
|
-
baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
|
|
161
|
-
secondLabel: 'Market',
|
|
162
|
-
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
163
|
-
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
164
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
|
|
165
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
export const COMPOUND_V3_USDBC = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
169
|
-
chainIds: [NetworkNumber.Base],
|
|
170
|
-
label: 'Compound V3 - USDbC',
|
|
171
|
-
shortLabel: 'v3',
|
|
172
|
-
value: CompoundVersions.CompoundV3USDbC,
|
|
173
|
-
baseAsset: 'USDbC',
|
|
174
|
-
collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
|
|
175
|
-
baseMarket: 'cUSDbCv3',
|
|
176
|
-
baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
|
|
177
|
-
secondLabel: 'Market',
|
|
178
|
-
bulkerName: 'CompV3BulkerL2',
|
|
179
|
-
bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
|
|
180
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
|
|
181
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
export const COMPOUND_V3_USDT = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
185
|
-
chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt],
|
|
186
|
-
label: 'Compound V3 - USDT',
|
|
187
|
-
shortLabel: 'v3',
|
|
188
|
-
value: CompoundVersions.CompoundV3USDT,
|
|
189
|
-
baseAsset: 'USDT',
|
|
190
|
-
collAssets: networkId ? v3USDTCollAssets[networkId] : [],
|
|
191
|
-
baseMarket: 'cUSDTv3',
|
|
192
|
-
baseMarketAddress: getConfigContractAddress('cUSDTv3', networkId),
|
|
193
|
-
secondLabel: 'Market',
|
|
194
|
-
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
195
|
-
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
196
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDT],
|
|
197
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
export const COMPOUND_V3_WSTETH = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
201
|
-
chainIds: [NetworkNumber.Eth],
|
|
202
|
-
label: 'Compound V3 - wstETH',
|
|
203
|
-
shortLabel: 'v3',
|
|
204
|
-
value: CompoundVersions.CompoundV3wstETH,
|
|
205
|
-
baseAsset: 'wstETH',
|
|
206
|
-
collAssets: networkId ? v3wstETHCollAssets[networkId] : [],
|
|
207
|
-
baseMarket: 'cWstETHv3',
|
|
208
|
-
baseMarketAddress: getConfigContractAddress('cWstETHv3', networkId),
|
|
209
|
-
secondLabel: 'Market',
|
|
210
|
-
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
211
|
-
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
212
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3wstETH],
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
export const COMPOUND_V3_USDS = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
216
|
-
chainIds: [NetworkNumber.Eth, NetworkNumber.Base],
|
|
217
|
-
label: 'Compound V3 - USDS',
|
|
218
|
-
shortLabel: 'v3',
|
|
219
|
-
value: CompoundVersions.CompoundV3USDS,
|
|
220
|
-
baseAsset: 'USDS',
|
|
221
|
-
collAssets: networkId ? v3USDSCollAssets[networkId] : [],
|
|
222
|
-
baseMarket: 'cUSDSv3',
|
|
223
|
-
baseMarketAddress: getConfigContractAddress('cUSDSv3', networkId),
|
|
224
|
-
secondLabel: 'Market',
|
|
225
|
-
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
226
|
-
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
227
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDS],
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
export const CompoundMarkets = (networkId: NetworkNumber) => ({
|
|
231
|
-
[CompoundVersions.CompoundV2]: COMPOUND_V2,
|
|
232
|
-
[CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
|
|
233
|
-
[CompoundVersions.CompoundV3USDC]: COMPOUND_V3_USDC(networkId),
|
|
234
|
-
[CompoundVersions.CompoundV3USDbC]: COMPOUND_V3_USDBC(networkId),
|
|
235
|
-
[CompoundVersions.CompoundV3USDCe]: COMPOUND_V3_USDCe(networkId),
|
|
236
|
-
[CompoundVersions.CompoundV3USDT]: COMPOUND_V3_USDT(networkId),
|
|
237
|
-
[CompoundVersions.CompoundV3wstETH]: COMPOUND_V3_WSTETH(networkId),
|
|
238
|
-
[CompoundVersions.CompoundV3USDS]: COMPOUND_V3_USDS(networkId),
|
|
1
|
+
import { ZERO_ADDRESS } from '../../constants';
|
|
2
|
+
import { getConfigContractAddress } from '../../contracts';
|
|
3
|
+
import { CompoundBulkerOptions, CompoundMarketData, CompoundVersions } from '../../types';
|
|
4
|
+
import { NetworkNumber } from '../../types/common';
|
|
5
|
+
import {
|
|
6
|
+
compoundV2CollateralAssets,
|
|
7
|
+
v3ETHCollAssets,
|
|
8
|
+
v3USDbCCollAssets,
|
|
9
|
+
v3USDCCollAssets,
|
|
10
|
+
v3USDCeCollAssets,
|
|
11
|
+
v3USDSCollAssets,
|
|
12
|
+
v3USDTCollAssets,
|
|
13
|
+
v3wstETHCollAssets,
|
|
14
|
+
} from './marketsAssets';
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
compoundV2CollateralAssets,
|
|
18
|
+
v3ETHCollAssets,
|
|
19
|
+
v3USDbCCollAssets,
|
|
20
|
+
v3USDCCollAssets,
|
|
21
|
+
v3USDCeCollAssets,
|
|
22
|
+
v3USDTCollAssets,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const EMPTY_BULKER_OPTIONS: CompoundBulkerOptions = { supply: '', withdraw: '' };
|
|
26
|
+
|
|
27
|
+
const STANDARD_BULKER_OPTIONS: CompoundBulkerOptions = {
|
|
28
|
+
supply: '0x414354494f4e5f535550504c595f4e41544956455f544f4b454e000000000000',
|
|
29
|
+
withdraw: '0x414354494f4e5f57495448445241575f4e41544956455f544f4b454e00000000',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const BULKER_OPTIONS: Record<NetworkNumber, Record<CompoundVersions, CompoundBulkerOptions>> = {
|
|
33
|
+
[NetworkNumber.Eth]: {
|
|
34
|
+
[CompoundVersions.CompoundV3USDC]: { supply: 2, withdraw: 5 },
|
|
35
|
+
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
36
|
+
[CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
|
|
37
|
+
[CompoundVersions.CompoundV3wstETH]: STANDARD_BULKER_OPTIONS,
|
|
38
|
+
[CompoundVersions.CompoundV3USDS]: STANDARD_BULKER_OPTIONS,
|
|
39
|
+
|
|
40
|
+
// Non-existing markets, keeping it because of typescript
|
|
41
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
42
|
+
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
43
|
+
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
44
|
+
},
|
|
45
|
+
[NetworkNumber.Arb]: {
|
|
46
|
+
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
47
|
+
[CompoundVersions.CompoundV3USDCe]: STANDARD_BULKER_OPTIONS,
|
|
48
|
+
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
49
|
+
[CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
|
|
50
|
+
|
|
51
|
+
// Non-existing markets, keeping it because of typescript
|
|
52
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
53
|
+
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
54
|
+
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
55
|
+
[CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
|
|
56
|
+
},
|
|
57
|
+
[NetworkNumber.Base]: {
|
|
58
|
+
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
59
|
+
[CompoundVersions.CompoundV3USDbC]: STANDARD_BULKER_OPTIONS,
|
|
60
|
+
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
61
|
+
[CompoundVersions.CompoundV3USDS]: STANDARD_BULKER_OPTIONS,
|
|
62
|
+
|
|
63
|
+
// Non-existing markets, keeping it because of typescript
|
|
64
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
65
|
+
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
66
|
+
[CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
|
|
67
|
+
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
68
|
+
},
|
|
69
|
+
[NetworkNumber.Opt]: {
|
|
70
|
+
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
71
|
+
[CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
|
|
72
|
+
// Non-existing markets, keeping it because of typescript
|
|
73
|
+
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
74
|
+
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
75
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
76
|
+
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
77
|
+
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
78
|
+
[CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
|
|
79
|
+
},
|
|
80
|
+
[NetworkNumber.Linea]: {
|
|
81
|
+
// Non-existing markets, keeping it because of typescript
|
|
82
|
+
[CompoundVersions.CompoundV3USDC]: EMPTY_BULKER_OPTIONS,
|
|
83
|
+
[CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
|
|
84
|
+
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
85
|
+
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
86
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
87
|
+
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
88
|
+
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
89
|
+
[CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
|
|
90
|
+
},
|
|
91
|
+
[NetworkNumber.Plasma]: {
|
|
92
|
+
// Non-existing markets, keeping it because of typescript
|
|
93
|
+
[CompoundVersions.CompoundV3USDC]: EMPTY_BULKER_OPTIONS,
|
|
94
|
+
[CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
|
|
95
|
+
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
96
|
+
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
97
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
98
|
+
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
99
|
+
[CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
|
|
100
|
+
[CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const COMPOUND_V2: CompoundMarketData = {
|
|
105
|
+
chainIds: [NetworkNumber.Eth],
|
|
106
|
+
label: 'Compound V2',
|
|
107
|
+
shortLabel: 'v2',
|
|
108
|
+
value: CompoundVersions.CompoundV2,
|
|
109
|
+
baseAsset: '',
|
|
110
|
+
collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
|
|
111
|
+
baseMarket: '',
|
|
112
|
+
baseMarketAddress: ZERO_ADDRESS,
|
|
113
|
+
secondLabel: '',
|
|
114
|
+
bulkerName: '',
|
|
115
|
+
bulkerAddress: ZERO_ADDRESS,
|
|
116
|
+
bulkerOptions: BULKER_OPTIONS[NetworkNumber.Eth][CompoundVersions.CompoundV2],
|
|
117
|
+
// icon: SvgAdapter(protocolIcons.compound),
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const COMPOUND_V3_USDC = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
121
|
+
chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
|
|
122
|
+
label: 'Compound V3 - USDC',
|
|
123
|
+
shortLabel: 'v3',
|
|
124
|
+
value: CompoundVersions.CompoundV3USDC,
|
|
125
|
+
baseAsset: 'USDC',
|
|
126
|
+
collAssets: networkId ? v3USDCCollAssets[networkId] : [],
|
|
127
|
+
baseMarket: 'cUSDCv3',
|
|
128
|
+
baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
|
|
129
|
+
secondLabel: 'Market',
|
|
130
|
+
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
|
|
131
|
+
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
|
|
132
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
|
|
133
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
137
|
+
chainIds: [NetworkNumber.Arb],
|
|
138
|
+
label: 'Compound V3 - USDC.e',
|
|
139
|
+
shortLabel: 'v3',
|
|
140
|
+
value: CompoundVersions.CompoundV3USDCe,
|
|
141
|
+
baseAsset: 'USDC.e',
|
|
142
|
+
collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
|
|
143
|
+
baseMarket: 'cUSDCev3',
|
|
144
|
+
baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
|
|
145
|
+
secondLabel: 'Market',
|
|
146
|
+
bulkerName: 'CompV3BulkerL2',
|
|
147
|
+
bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
|
|
148
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
|
|
149
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
153
|
+
chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
|
|
154
|
+
label: 'Compound V3 - ETH',
|
|
155
|
+
shortLabel: 'v3',
|
|
156
|
+
value: CompoundVersions.CompoundV3ETH,
|
|
157
|
+
baseAsset: 'ETH',
|
|
158
|
+
collAssets: networkId ? v3ETHCollAssets[networkId] : [],
|
|
159
|
+
baseMarket: 'cETHv3',
|
|
160
|
+
baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
|
|
161
|
+
secondLabel: 'Market',
|
|
162
|
+
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
163
|
+
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
164
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
|
|
165
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
export const COMPOUND_V3_USDBC = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
169
|
+
chainIds: [NetworkNumber.Base],
|
|
170
|
+
label: 'Compound V3 - USDbC',
|
|
171
|
+
shortLabel: 'v3',
|
|
172
|
+
value: CompoundVersions.CompoundV3USDbC,
|
|
173
|
+
baseAsset: 'USDbC',
|
|
174
|
+
collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
|
|
175
|
+
baseMarket: 'cUSDbCv3',
|
|
176
|
+
baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
|
|
177
|
+
secondLabel: 'Market',
|
|
178
|
+
bulkerName: 'CompV3BulkerL2',
|
|
179
|
+
bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
|
|
180
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
|
|
181
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
export const COMPOUND_V3_USDT = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
185
|
+
chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt],
|
|
186
|
+
label: 'Compound V3 - USDT',
|
|
187
|
+
shortLabel: 'v3',
|
|
188
|
+
value: CompoundVersions.CompoundV3USDT,
|
|
189
|
+
baseAsset: 'USDT',
|
|
190
|
+
collAssets: networkId ? v3USDTCollAssets[networkId] : [],
|
|
191
|
+
baseMarket: 'cUSDTv3',
|
|
192
|
+
baseMarketAddress: getConfigContractAddress('cUSDTv3', networkId),
|
|
193
|
+
secondLabel: 'Market',
|
|
194
|
+
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
195
|
+
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
196
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDT],
|
|
197
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
export const COMPOUND_V3_WSTETH = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
201
|
+
chainIds: [NetworkNumber.Eth],
|
|
202
|
+
label: 'Compound V3 - wstETH',
|
|
203
|
+
shortLabel: 'v3',
|
|
204
|
+
value: CompoundVersions.CompoundV3wstETH,
|
|
205
|
+
baseAsset: 'wstETH',
|
|
206
|
+
collAssets: networkId ? v3wstETHCollAssets[networkId] : [],
|
|
207
|
+
baseMarket: 'cWstETHv3',
|
|
208
|
+
baseMarketAddress: getConfigContractAddress('cWstETHv3', networkId),
|
|
209
|
+
secondLabel: 'Market',
|
|
210
|
+
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
211
|
+
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
212
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3wstETH],
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
export const COMPOUND_V3_USDS = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
216
|
+
chainIds: [NetworkNumber.Eth, NetworkNumber.Base],
|
|
217
|
+
label: 'Compound V3 - USDS',
|
|
218
|
+
shortLabel: 'v3',
|
|
219
|
+
value: CompoundVersions.CompoundV3USDS,
|
|
220
|
+
baseAsset: 'USDS',
|
|
221
|
+
collAssets: networkId ? v3USDSCollAssets[networkId] : [],
|
|
222
|
+
baseMarket: 'cUSDSv3',
|
|
223
|
+
baseMarketAddress: getConfigContractAddress('cUSDSv3', networkId),
|
|
224
|
+
secondLabel: 'Market',
|
|
225
|
+
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
226
|
+
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
227
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDS],
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
export const CompoundMarkets = (networkId: NetworkNumber) => ({
|
|
231
|
+
[CompoundVersions.CompoundV2]: COMPOUND_V2,
|
|
232
|
+
[CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
|
|
233
|
+
[CompoundVersions.CompoundV3USDC]: COMPOUND_V3_USDC(networkId),
|
|
234
|
+
[CompoundVersions.CompoundV3USDbC]: COMPOUND_V3_USDBC(networkId),
|
|
235
|
+
[CompoundVersions.CompoundV3USDCe]: COMPOUND_V3_USDCe(networkId),
|
|
236
|
+
[CompoundVersions.CompoundV3USDT]: COMPOUND_V3_USDT(networkId),
|
|
237
|
+
[CompoundVersions.CompoundV3wstETH]: COMPOUND_V3_WSTETH(networkId),
|
|
238
|
+
[CompoundVersions.CompoundV3USDS]: COMPOUND_V3_USDS(networkId),
|
|
239
239
|
}) as const;
|