@defisaver/positions-sdk 2.0.12 → 2.0.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.
Files changed (70) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +64 -64
  4. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  5. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  6. package/package.json +47 -47
  7. package/src/aaveV2/index.ts +236 -236
  8. package/src/aaveV3/index.ts +488 -488
  9. package/src/compoundV2/index.ts +240 -240
  10. package/src/compoundV3/index.ts +270 -270
  11. package/src/config/contracts.ts +1107 -1107
  12. package/src/constants/index.ts +6 -6
  13. package/src/contracts.ts +107 -107
  14. package/src/curveUsd/index.ts +250 -250
  15. package/src/eulerV2/index.ts +314 -314
  16. package/src/exchange/index.ts +25 -25
  17. package/src/fluid/index.ts +1568 -1568
  18. package/src/helpers/aaveHelpers/index.ts +170 -170
  19. package/src/helpers/compoundHelpers/index.ts +261 -261
  20. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  21. package/src/helpers/eulerHelpers/index.ts +259 -259
  22. package/src/helpers/fluidHelpers/index.ts +324 -324
  23. package/src/helpers/index.ts +10 -10
  24. package/src/helpers/liquityV2Helpers/index.ts +80 -80
  25. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  26. package/src/helpers/makerHelpers/index.ts +52 -52
  27. package/src/helpers/morphoBlueHelpers/index.ts +390 -390
  28. package/src/helpers/sparkHelpers/index.ts +155 -155
  29. package/src/index.ts +45 -45
  30. package/src/liquity/index.ts +104 -104
  31. package/src/liquityV2/index.ts +408 -408
  32. package/src/llamaLend/index.ts +296 -296
  33. package/src/maker/index.ts +223 -223
  34. package/src/markets/aave/index.ts +116 -116
  35. package/src/markets/aave/marketAssets.ts +49 -49
  36. package/src/markets/compound/index.ts +227 -227
  37. package/src/markets/compound/marketsAssets.ts +90 -90
  38. package/src/markets/curveUsd/index.ts +69 -69
  39. package/src/markets/euler/index.ts +26 -26
  40. package/src/markets/fluid/index.ts +2456 -2456
  41. package/src/markets/index.ts +25 -25
  42. package/src/markets/liquityV2/index.ts +102 -102
  43. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  44. package/src/markets/llamaLend/index.ts +235 -235
  45. package/src/markets/morphoBlue/index.ts +895 -895
  46. package/src/markets/spark/index.ts +29 -29
  47. package/src/markets/spark/marketAssets.ts +11 -11
  48. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  49. package/src/morphoBlue/index.ts +222 -222
  50. package/src/portfolio/index.ts +285 -285
  51. package/src/services/priceService.ts +159 -159
  52. package/src/services/utils.ts +63 -63
  53. package/src/services/viem.ts +32 -32
  54. package/src/setup.ts +8 -8
  55. package/src/spark/index.ts +456 -456
  56. package/src/staking/staking.ts +193 -193
  57. package/src/types/aave.ts +194 -194
  58. package/src/types/common.ts +88 -88
  59. package/src/types/compound.ts +136 -136
  60. package/src/types/curveUsd.ts +121 -121
  61. package/src/types/euler.ts +174 -174
  62. package/src/types/fluid.ts +450 -450
  63. package/src/types/index.ts +11 -11
  64. package/src/types/liquity.ts +30 -30
  65. package/src/types/liquityV2.ts +126 -126
  66. package/src/types/llamaLend.ts +157 -157
  67. package/src/types/maker.ts +63 -63
  68. package/src/types/morphoBlue.ts +194 -194
  69. package/src/types/portfolio.ts +60 -60
  70. package/src/types/spark.ts +137 -137
@@ -1,228 +1,228 @@
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
- };
92
-
93
- export const COMPOUND_V2: CompoundMarketData = {
94
- chainIds: [NetworkNumber.Eth],
95
- label: 'Compound V2',
96
- shortLabel: 'v2',
97
- value: CompoundVersions.CompoundV2,
98
- baseAsset: '',
99
- collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
100
- baseMarket: '',
101
- baseMarketAddress: ZERO_ADDRESS,
102
- secondLabel: '',
103
- bulkerName: '',
104
- bulkerAddress: ZERO_ADDRESS,
105
- bulkerOptions: BULKER_OPTIONS[NetworkNumber.Eth][CompoundVersions.CompoundV2],
106
- // icon: SvgAdapter(protocolIcons.compound),
107
- };
108
-
109
- export const COMPOUND_V3_USDC = (networkId: NetworkNumber): CompoundMarketData => ({
110
- chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
111
- label: 'Compound V3 - USDC',
112
- shortLabel: 'v3',
113
- value: CompoundVersions.CompoundV3USDC,
114
- baseAsset: 'USDC',
115
- collAssets: networkId ? v3USDCCollAssets[networkId] : [],
116
- baseMarket: 'cUSDCv3',
117
- baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
118
- secondLabel: 'Market',
119
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
120
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
121
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
122
- // icon: SvgAdapter(protocolIcons.compoundv3),
123
- });
124
-
125
- export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData => ({
126
- chainIds: [NetworkNumber.Arb],
127
- label: 'Compound V3 - USDC.e',
128
- shortLabel: 'v3',
129
- value: CompoundVersions.CompoundV3USDCe,
130
- baseAsset: 'USDC.e',
131
- collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
132
- baseMarket: 'cUSDCev3',
133
- baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
134
- secondLabel: 'Market',
135
- bulkerName: 'CompV3BulkerL2',
136
- bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
137
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
138
- // icon: SvgAdapter(protocolIcons.compoundv3),
139
- });
140
-
141
- export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
142
- chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
143
- label: 'Compound V3 - ETH',
144
- shortLabel: 'v3',
145
- value: CompoundVersions.CompoundV3ETH,
146
- baseAsset: 'ETH',
147
- collAssets: networkId ? v3ETHCollAssets[networkId] : [],
148
- baseMarket: 'cETHv3',
149
- baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
150
- secondLabel: 'Market',
151
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
152
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
153
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
154
- // icon: SvgAdapter(protocolIcons.compoundv3),
155
- });
156
-
157
- export const COMPOUND_V3_USDBC = (networkId: NetworkNumber): CompoundMarketData => ({
158
- chainIds: [NetworkNumber.Base],
159
- label: 'Compound V3 - USDbC',
160
- shortLabel: 'v3',
161
- value: CompoundVersions.CompoundV3USDbC,
162
- baseAsset: 'USDbC',
163
- collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
164
- baseMarket: 'cUSDbCv3',
165
- baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
166
- secondLabel: 'Market',
167
- bulkerName: 'CompV3BulkerL2',
168
- bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
169
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
170
- // icon: SvgAdapter(protocolIcons.compoundv3),
171
- });
172
-
173
- export const COMPOUND_V3_USDT = (networkId: NetworkNumber): CompoundMarketData => ({
174
- chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt],
175
- label: 'Compound V3 - USDT',
176
- shortLabel: 'v3',
177
- value: CompoundVersions.CompoundV3USDT,
178
- baseAsset: 'USDT',
179
- collAssets: networkId ? v3USDTCollAssets[networkId] : [],
180
- baseMarket: 'cUSDTv3',
181
- baseMarketAddress: getConfigContractAddress('cUSDTv3', networkId),
182
- secondLabel: 'Market',
183
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
184
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
185
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDT],
186
- // icon: SvgAdapter(protocolIcons.compoundv3),
187
- });
188
-
189
- export const COMPOUND_V3_WSTETH = (networkId: NetworkNumber): CompoundMarketData => ({
190
- chainIds: [NetworkNumber.Eth],
191
- label: 'Compound V3 - wstETH',
192
- shortLabel: 'v3',
193
- value: CompoundVersions.CompoundV3wstETH,
194
- baseAsset: 'wstETH',
195
- collAssets: networkId ? v3wstETHCollAssets[networkId] : [],
196
- baseMarket: 'cWstETHv3',
197
- baseMarketAddress: getConfigContractAddress('cWstETHv3', networkId),
198
- secondLabel: 'Market',
199
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
200
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
201
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3wstETH],
202
- });
203
-
204
- export const COMPOUND_V3_USDS = (networkId: NetworkNumber): CompoundMarketData => ({
205
- chainIds: [NetworkNumber.Eth, NetworkNumber.Base],
206
- label: 'Compound V3 - USDS',
207
- shortLabel: 'v3',
208
- value: CompoundVersions.CompoundV3USDS,
209
- baseAsset: 'USDS',
210
- collAssets: networkId ? v3USDSCollAssets[networkId] : [],
211
- baseMarket: 'cUSDSv3',
212
- baseMarketAddress: getConfigContractAddress('cUSDSv3', networkId),
213
- secondLabel: 'Market',
214
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
215
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
216
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDS],
217
- });
218
-
219
- export const CompoundMarkets = (networkId: NetworkNumber) => ({
220
- [CompoundVersions.CompoundV2]: COMPOUND_V2,
221
- [CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
222
- [CompoundVersions.CompoundV3USDC]: COMPOUND_V3_USDC(networkId),
223
- [CompoundVersions.CompoundV3USDbC]: COMPOUND_V3_USDBC(networkId),
224
- [CompoundVersions.CompoundV3USDCe]: COMPOUND_V3_USDCe(networkId),
225
- [CompoundVersions.CompoundV3USDT]: COMPOUND_V3_USDT(networkId),
226
- [CompoundVersions.CompoundV3wstETH]: COMPOUND_V3_WSTETH(networkId),
227
- [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
+ };
92
+
93
+ export const COMPOUND_V2: CompoundMarketData = {
94
+ chainIds: [NetworkNumber.Eth],
95
+ label: 'Compound V2',
96
+ shortLabel: 'v2',
97
+ value: CompoundVersions.CompoundV2,
98
+ baseAsset: '',
99
+ collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
100
+ baseMarket: '',
101
+ baseMarketAddress: ZERO_ADDRESS,
102
+ secondLabel: '',
103
+ bulkerName: '',
104
+ bulkerAddress: ZERO_ADDRESS,
105
+ bulkerOptions: BULKER_OPTIONS[NetworkNumber.Eth][CompoundVersions.CompoundV2],
106
+ // icon: SvgAdapter(protocolIcons.compound),
107
+ };
108
+
109
+ export const COMPOUND_V3_USDC = (networkId: NetworkNumber): CompoundMarketData => ({
110
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
111
+ label: 'Compound V3 - USDC',
112
+ shortLabel: 'v3',
113
+ value: CompoundVersions.CompoundV3USDC,
114
+ baseAsset: 'USDC',
115
+ collAssets: networkId ? v3USDCCollAssets[networkId] : [],
116
+ baseMarket: 'cUSDCv3',
117
+ baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
118
+ secondLabel: 'Market',
119
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
120
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
121
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
122
+ // icon: SvgAdapter(protocolIcons.compoundv3),
123
+ });
124
+
125
+ export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData => ({
126
+ chainIds: [NetworkNumber.Arb],
127
+ label: 'Compound V3 - USDC.e',
128
+ shortLabel: 'v3',
129
+ value: CompoundVersions.CompoundV3USDCe,
130
+ baseAsset: 'USDC.e',
131
+ collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
132
+ baseMarket: 'cUSDCev3',
133
+ baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
134
+ secondLabel: 'Market',
135
+ bulkerName: 'CompV3BulkerL2',
136
+ bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
137
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
138
+ // icon: SvgAdapter(protocolIcons.compoundv3),
139
+ });
140
+
141
+ export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
142
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
143
+ label: 'Compound V3 - ETH',
144
+ shortLabel: 'v3',
145
+ value: CompoundVersions.CompoundV3ETH,
146
+ baseAsset: 'ETH',
147
+ collAssets: networkId ? v3ETHCollAssets[networkId] : [],
148
+ baseMarket: 'cETHv3',
149
+ baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
150
+ secondLabel: 'Market',
151
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
152
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
153
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
154
+ // icon: SvgAdapter(protocolIcons.compoundv3),
155
+ });
156
+
157
+ export const COMPOUND_V3_USDBC = (networkId: NetworkNumber): CompoundMarketData => ({
158
+ chainIds: [NetworkNumber.Base],
159
+ label: 'Compound V3 - USDbC',
160
+ shortLabel: 'v3',
161
+ value: CompoundVersions.CompoundV3USDbC,
162
+ baseAsset: 'USDbC',
163
+ collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
164
+ baseMarket: 'cUSDbCv3',
165
+ baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
166
+ secondLabel: 'Market',
167
+ bulkerName: 'CompV3BulkerL2',
168
+ bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
169
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
170
+ // icon: SvgAdapter(protocolIcons.compoundv3),
171
+ });
172
+
173
+ export const COMPOUND_V3_USDT = (networkId: NetworkNumber): CompoundMarketData => ({
174
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt],
175
+ label: 'Compound V3 - USDT',
176
+ shortLabel: 'v3',
177
+ value: CompoundVersions.CompoundV3USDT,
178
+ baseAsset: 'USDT',
179
+ collAssets: networkId ? v3USDTCollAssets[networkId] : [],
180
+ baseMarket: 'cUSDTv3',
181
+ baseMarketAddress: getConfigContractAddress('cUSDTv3', networkId),
182
+ secondLabel: 'Market',
183
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
184
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
185
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDT],
186
+ // icon: SvgAdapter(protocolIcons.compoundv3),
187
+ });
188
+
189
+ export const COMPOUND_V3_WSTETH = (networkId: NetworkNumber): CompoundMarketData => ({
190
+ chainIds: [NetworkNumber.Eth],
191
+ label: 'Compound V3 - wstETH',
192
+ shortLabel: 'v3',
193
+ value: CompoundVersions.CompoundV3wstETH,
194
+ baseAsset: 'wstETH',
195
+ collAssets: networkId ? v3wstETHCollAssets[networkId] : [],
196
+ baseMarket: 'cWstETHv3',
197
+ baseMarketAddress: getConfigContractAddress('cWstETHv3', networkId),
198
+ secondLabel: 'Market',
199
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
200
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
201
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3wstETH],
202
+ });
203
+
204
+ export const COMPOUND_V3_USDS = (networkId: NetworkNumber): CompoundMarketData => ({
205
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Base],
206
+ label: 'Compound V3 - USDS',
207
+ shortLabel: 'v3',
208
+ value: CompoundVersions.CompoundV3USDS,
209
+ baseAsset: 'USDS',
210
+ collAssets: networkId ? v3USDSCollAssets[networkId] : [],
211
+ baseMarket: 'cUSDSv3',
212
+ baseMarketAddress: getConfigContractAddress('cUSDSv3', networkId),
213
+ secondLabel: 'Market',
214
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
215
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
216
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDS],
217
+ });
218
+
219
+ export const CompoundMarkets = (networkId: NetworkNumber) => ({
220
+ [CompoundVersions.CompoundV2]: COMPOUND_V2,
221
+ [CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
222
+ [CompoundVersions.CompoundV3USDC]: COMPOUND_V3_USDC(networkId),
223
+ [CompoundVersions.CompoundV3USDbC]: COMPOUND_V3_USDBC(networkId),
224
+ [CompoundVersions.CompoundV3USDCe]: COMPOUND_V3_USDCe(networkId),
225
+ [CompoundVersions.CompoundV3USDT]: COMPOUND_V3_USDT(networkId),
226
+ [CompoundVersions.CompoundV3wstETH]: COMPOUND_V3_WSTETH(networkId),
227
+ [CompoundVersions.CompoundV3USDS]: COMPOUND_V3_USDS(networkId),
228
228
  }) as const;
@@ -1,91 +1,91 @@
1
- import { AssetData, getAssetInfo } from '@defisaver/tokens';
2
- import { NetworkNumber } from '../../types/common';
3
-
4
- export const compoundV2CollateralAssets: AssetData[] = [
5
- 'cETH', 'cDAI', 'cBAT', 'cZRX', 'cUSDC', 'cWBTC Legacy', 'cWBTC', 'cUSDT',
6
- 'cTUSD', 'cLINK', 'cUSDP', 'cUNI', 'cCOMP', 'cMKR', 'cSUSHI', 'cAAVE', 'cYFI',
7
- ].map((symbol) => getAssetInfo(symbol));
8
-
9
- export const v3USDCCollAssetsEth = ['COMP', 'WBTC', 'ETH', 'UNI', 'LINK', 'wstETH', 'cbBTC', 'tBTC', 'weETH', 'deUSD', 'sdeUSD'];
10
- export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC', 'wstETH', 'ezETH', 'wUSDM'];
11
- export const v3USDCCollAssetsBase = ['cbETH', 'ETH', 'wstETH', 'cbBTC', 'tBTC'];
12
- export const v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC', 'wstETH'];
13
-
14
- // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
15
- export const v3USDCCollAssets = {
16
- [NetworkNumber.Eth]: v3USDCCollAssetsEth,
17
- [NetworkNumber.Opt]: v3USDCCollAssetsOpt,
18
- [NetworkNumber.Arb]: v3USDCCollAssetsArb,
19
- [NetworkNumber.Base]: v3USDCCollAssetsBase,
20
- [NetworkNumber.Linea]: [],
21
- } as const;
22
-
23
- export const v3USDCeCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
24
-
25
- // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
26
- export const v3USDCeCollAssets = {
27
- [NetworkNumber.Eth]: [],
28
- [NetworkNumber.Opt]: [],
29
- [NetworkNumber.Arb]: v3USDCeCollAssetsArb,
30
- [NetworkNumber.Base]: [],
31
- [NetworkNumber.Linea]: [],
32
- } as const;
33
-
34
- export const v3ETHCollAssetsEth = ['cbETH', 'wstETH', 'rETH', 'rsETH', 'weETH', 'osETH', 'WBTC', 'ezETH', 'cbBTC', 'rswETH', 'tBTC', 'ETHx', 'tETH', 'pufETH', 'wOETH'];
35
- export const v3ETHCollAssetsBase = ['cbETH', 'ezETH', 'wstETH', 'USDC', 'weETH', 'wrsETH', 'cbBTC', 'wsuperOETHb'];
36
- export const v3ETHCollAssetsArb = ['weETH', 'rETH', 'wstETH', 'WBTC', 'rsETH', 'ezETH', 'USDC', 'USDT'];
37
- export const v3ETHCollAssetsOpt = ['rETH', 'wstETH', 'WBTC', 'ezETH', 'USDC', 'USDT', 'weETH', 'wrsETH'];
38
-
39
- // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
40
- export const v3ETHCollAssets = {
41
- [NetworkNumber.Eth]: v3ETHCollAssetsEth,
42
- [NetworkNumber.Opt]: v3ETHCollAssetsOpt,
43
- [NetworkNumber.Arb]: v3ETHCollAssetsArb,
44
- [NetworkNumber.Base]: v3ETHCollAssetsBase,
45
- [NetworkNumber.Linea]: [],
46
- } as const;
47
-
48
- export const v3USDbCCollAssetsBase = ['ETH', 'cbETH'];
49
-
50
- // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
51
- export const v3USDbCCollAssets = {
52
- [NetworkNumber.Eth]: [],
53
- [NetworkNumber.Opt]: [],
54
- [NetworkNumber.Arb]: [],
55
- [NetworkNumber.Base]: v3USDbCCollAssetsBase,
56
- [NetworkNumber.Linea]: [],
57
- };
58
-
59
- export const v3USDTCollAssetsEth = ['COMP', 'ETH', 'WBTC', 'UNI', 'LINK', 'wstETH', 'cbBTC', 'tBTC', 'sFRAX', 'mETH', 'weETH', 'sdeUSD', 'deUSD'];
60
- export const v3USDTCollAssetsArb = ['ETH', 'WBTC', 'wstETH', 'ARB', 'GMX'];
61
- export const v3USDTCollAssetsOpt = ['ETH', 'WBTC', 'OP', 'wstETH'];
62
-
63
- // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
64
- export const v3USDTCollAssets = {
65
- [NetworkNumber.Eth]: v3USDTCollAssetsEth,
66
- [NetworkNumber.Opt]: v3USDTCollAssetsOpt,
67
- [NetworkNumber.Arb]: v3USDTCollAssetsArb,
68
- [NetworkNumber.Base]: [],
69
- [NetworkNumber.Linea]: [],
70
- };
71
-
72
- export const v3USDSCollAssetsEth = ['wstETH', 'ETH', 'sUSDS', 'cbETH', 'tBTC', 'USDe'];
73
- export const v3USDSCollAssetsBase = ['sUSDS', 'cbBTC'];
74
-
75
- export const v3USDSCollAssets = {
76
- [NetworkNumber.Eth]: v3USDSCollAssetsEth,
77
- [NetworkNumber.Opt]: [],
78
- [NetworkNumber.Arb]: [],
79
- [NetworkNumber.Base]: v3USDSCollAssetsBase,
80
- [NetworkNumber.Linea]: [],
81
- };
82
-
83
- export const v3wstETHCollAssetsEth = ['rsETH', 'ezETH'];
84
-
85
- export const v3wstETHCollAssets = {
86
- [NetworkNumber.Eth]: v3wstETHCollAssetsEth,
87
- [NetworkNumber.Opt]: [],
88
- [NetworkNumber.Arb]: [],
89
- [NetworkNumber.Base]: [],
90
- [NetworkNumber.Linea]: [],
1
+ import { AssetData, getAssetInfo } from '@defisaver/tokens';
2
+ import { NetworkNumber } from '../../types/common';
3
+
4
+ export const compoundV2CollateralAssets: AssetData[] = [
5
+ 'cETH', 'cDAI', 'cBAT', 'cZRX', 'cUSDC', 'cWBTC Legacy', 'cWBTC', 'cUSDT',
6
+ 'cTUSD', 'cLINK', 'cUSDP', 'cUNI', 'cCOMP', 'cMKR', 'cSUSHI', 'cAAVE', 'cYFI',
7
+ ].map((symbol) => getAssetInfo(symbol));
8
+
9
+ export const v3USDCCollAssetsEth = ['COMP', 'WBTC', 'ETH', 'UNI', 'LINK', 'wstETH', 'cbBTC', 'tBTC', 'weETH', 'deUSD', 'sdeUSD'];
10
+ export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC', 'wstETH', 'ezETH', 'wUSDM'];
11
+ export const v3USDCCollAssetsBase = ['cbETH', 'ETH', 'wstETH', 'cbBTC', 'tBTC'];
12
+ export const v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC', 'wstETH'];
13
+
14
+ // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
15
+ export const v3USDCCollAssets = {
16
+ [NetworkNumber.Eth]: v3USDCCollAssetsEth,
17
+ [NetworkNumber.Opt]: v3USDCCollAssetsOpt,
18
+ [NetworkNumber.Arb]: v3USDCCollAssetsArb,
19
+ [NetworkNumber.Base]: v3USDCCollAssetsBase,
20
+ [NetworkNumber.Linea]: [],
21
+ } as const;
22
+
23
+ export const v3USDCeCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
24
+
25
+ // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
26
+ export const v3USDCeCollAssets = {
27
+ [NetworkNumber.Eth]: [],
28
+ [NetworkNumber.Opt]: [],
29
+ [NetworkNumber.Arb]: v3USDCeCollAssetsArb,
30
+ [NetworkNumber.Base]: [],
31
+ [NetworkNumber.Linea]: [],
32
+ } as const;
33
+
34
+ export const v3ETHCollAssetsEth = ['cbETH', 'wstETH', 'rETH', 'rsETH', 'weETH', 'osETH', 'WBTC', 'ezETH', 'cbBTC', 'rswETH', 'tBTC', 'ETHx', 'tETH', 'pufETH', 'wOETH'];
35
+ export const v3ETHCollAssetsBase = ['cbETH', 'ezETH', 'wstETH', 'USDC', 'weETH', 'wrsETH', 'cbBTC', 'wsuperOETHb'];
36
+ export const v3ETHCollAssetsArb = ['weETH', 'rETH', 'wstETH', 'WBTC', 'rsETH', 'ezETH', 'USDC', 'USDT'];
37
+ export const v3ETHCollAssetsOpt = ['rETH', 'wstETH', 'WBTC', 'ezETH', 'USDC', 'USDT', 'weETH', 'wrsETH'];
38
+
39
+ // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
40
+ export const v3ETHCollAssets = {
41
+ [NetworkNumber.Eth]: v3ETHCollAssetsEth,
42
+ [NetworkNumber.Opt]: v3ETHCollAssetsOpt,
43
+ [NetworkNumber.Arb]: v3ETHCollAssetsArb,
44
+ [NetworkNumber.Base]: v3ETHCollAssetsBase,
45
+ [NetworkNumber.Linea]: [],
46
+ } as const;
47
+
48
+ export const v3USDbCCollAssetsBase = ['ETH', 'cbETH'];
49
+
50
+ // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
51
+ export const v3USDbCCollAssets = {
52
+ [NetworkNumber.Eth]: [],
53
+ [NetworkNumber.Opt]: [],
54
+ [NetworkNumber.Arb]: [],
55
+ [NetworkNumber.Base]: v3USDbCCollAssetsBase,
56
+ [NetworkNumber.Linea]: [],
57
+ };
58
+
59
+ export const v3USDTCollAssetsEth = ['COMP', 'ETH', 'WBTC', 'UNI', 'LINK', 'wstETH', 'cbBTC', 'tBTC', 'sFRAX', 'mETH', 'weETH', 'sdeUSD', 'deUSD'];
60
+ export const v3USDTCollAssetsArb = ['ETH', 'WBTC', 'wstETH', 'ARB', 'GMX'];
61
+ export const v3USDTCollAssetsOpt = ['ETH', 'WBTC', 'OP', 'wstETH'];
62
+
63
+ // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
64
+ export const v3USDTCollAssets = {
65
+ [NetworkNumber.Eth]: v3USDTCollAssetsEth,
66
+ [NetworkNumber.Opt]: v3USDTCollAssetsOpt,
67
+ [NetworkNumber.Arb]: v3USDTCollAssetsArb,
68
+ [NetworkNumber.Base]: [],
69
+ [NetworkNumber.Linea]: [],
70
+ };
71
+
72
+ export const v3USDSCollAssetsEth = ['wstETH', 'ETH', 'sUSDS', 'cbETH', 'tBTC', 'USDe'];
73
+ export const v3USDSCollAssetsBase = ['sUSDS', 'cbBTC'];
74
+
75
+ export const v3USDSCollAssets = {
76
+ [NetworkNumber.Eth]: v3USDSCollAssetsEth,
77
+ [NetworkNumber.Opt]: [],
78
+ [NetworkNumber.Arb]: [],
79
+ [NetworkNumber.Base]: v3USDSCollAssetsBase,
80
+ [NetworkNumber.Linea]: [],
81
+ };
82
+
83
+ export const v3wstETHCollAssetsEth = ['rsETH', 'ezETH'];
84
+
85
+ export const v3wstETHCollAssets = {
86
+ [NetworkNumber.Eth]: v3wstETHCollAssetsEth,
87
+ [NetworkNumber.Opt]: [],
88
+ [NetworkNumber.Arb]: [],
89
+ [NetworkNumber.Base]: [],
90
+ [NetworkNumber.Linea]: [],
91
91
  };