@defisaver/positions-sdk 2.0.1 → 2.0.4

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