@defisaver/positions-sdk 2.0.11 → 2.0.12

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 (106) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +64 -64
  4. package/cjs/aaveV3/index.js +1 -1
  5. package/cjs/config/contracts.d.ts +194 -33
  6. package/cjs/config/contracts.js +18 -1
  7. package/cjs/contracts.d.ts +1283 -293
  8. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  9. package/cjs/markets/aave/index.js +1 -1
  10. package/cjs/markets/aave/marketAssets.d.ts +4 -0
  11. package/cjs/markets/aave/marketAssets.js +5 -1
  12. package/cjs/markets/compound/index.js +11 -0
  13. package/cjs/markets/compound/marketsAssets.d.ts +7 -0
  14. package/cjs/markets/compound/marketsAssets.js +7 -0
  15. package/cjs/markets/spark/marketAssets.d.ts +1 -0
  16. package/cjs/markets/spark/marketAssets.js +1 -0
  17. package/cjs/portfolio/index.js +2 -2
  18. package/cjs/services/utils.js +1 -1
  19. package/cjs/services/viem.d.ts +46 -0
  20. package/cjs/services/viem.js +2 -0
  21. package/cjs/types/common.d.ts +2 -1
  22. package/cjs/types/common.js +1 -0
  23. package/esm/aaveV3/index.js +1 -1
  24. package/esm/config/contracts.d.ts +194 -33
  25. package/esm/config/contracts.js +18 -1
  26. package/esm/contracts.d.ts +1283 -293
  27. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  28. package/esm/markets/aave/index.js +1 -1
  29. package/esm/markets/aave/marketAssets.d.ts +4 -0
  30. package/esm/markets/aave/marketAssets.js +4 -0
  31. package/esm/markets/compound/index.js +11 -0
  32. package/esm/markets/compound/marketsAssets.d.ts +7 -0
  33. package/esm/markets/compound/marketsAssets.js +7 -0
  34. package/esm/markets/spark/marketAssets.d.ts +1 -0
  35. package/esm/markets/spark/marketAssets.js +1 -0
  36. package/esm/portfolio/index.js +2 -2
  37. package/esm/services/utils.js +1 -1
  38. package/esm/services/viem.d.ts +46 -0
  39. package/esm/services/viem.js +3 -1
  40. package/esm/types/common.d.ts +2 -1
  41. package/esm/types/common.js +1 -0
  42. package/package.json +47 -47
  43. package/src/aaveV2/index.ts +236 -236
  44. package/src/aaveV3/index.ts +488 -489
  45. package/src/compoundV2/index.ts +240 -240
  46. package/src/compoundV3/index.ts +270 -270
  47. package/src/config/contracts.ts +1107 -1090
  48. package/src/constants/index.ts +6 -6
  49. package/src/contracts.ts +107 -107
  50. package/src/curveUsd/index.ts +250 -250
  51. package/src/eulerV2/index.ts +314 -314
  52. package/src/exchange/index.ts +25 -25
  53. package/src/fluid/index.ts +1568 -1568
  54. package/src/helpers/aaveHelpers/index.ts +170 -170
  55. package/src/helpers/compoundHelpers/index.ts +261 -261
  56. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  57. package/src/helpers/eulerHelpers/index.ts +259 -259
  58. package/src/helpers/fluidHelpers/index.ts +324 -324
  59. package/src/helpers/index.ts +10 -10
  60. package/src/helpers/liquityV2Helpers/index.ts +80 -80
  61. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  62. package/src/helpers/makerHelpers/index.ts +52 -52
  63. package/src/helpers/morphoBlueHelpers/index.ts +390 -390
  64. package/src/helpers/sparkHelpers/index.ts +155 -155
  65. package/src/index.ts +45 -45
  66. package/src/liquity/index.ts +104 -104
  67. package/src/liquityV2/index.ts +408 -408
  68. package/src/llamaLend/index.ts +296 -296
  69. package/src/maker/index.ts +223 -223
  70. package/src/markets/aave/index.ts +116 -116
  71. package/src/markets/aave/marketAssets.ts +49 -44
  72. package/src/markets/compound/index.ts +227 -216
  73. package/src/markets/compound/marketsAssets.ts +90 -83
  74. package/src/markets/curveUsd/index.ts +69 -69
  75. package/src/markets/euler/index.ts +26 -26
  76. package/src/markets/fluid/index.ts +2456 -2456
  77. package/src/markets/index.ts +25 -25
  78. package/src/markets/liquityV2/index.ts +102 -102
  79. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  80. package/src/markets/llamaLend/index.ts +235 -235
  81. package/src/markets/morphoBlue/index.ts +895 -895
  82. package/src/markets/spark/index.ts +29 -29
  83. package/src/markets/spark/marketAssets.ts +11 -10
  84. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  85. package/src/morphoBlue/index.ts +222 -222
  86. package/src/portfolio/index.ts +285 -285
  87. package/src/services/priceService.ts +159 -159
  88. package/src/services/utils.ts +63 -63
  89. package/src/services/viem.ts +32 -30
  90. package/src/setup.ts +8 -8
  91. package/src/spark/index.ts +456 -456
  92. package/src/staking/staking.ts +193 -193
  93. package/src/types/aave.ts +194 -194
  94. package/src/types/common.ts +88 -87
  95. package/src/types/compound.ts +136 -136
  96. package/src/types/curveUsd.ts +121 -121
  97. package/src/types/euler.ts +174 -174
  98. package/src/types/fluid.ts +450 -450
  99. package/src/types/index.ts +11 -11
  100. package/src/types/liquity.ts +30 -30
  101. package/src/types/liquityV2.ts +126 -126
  102. package/src/types/llamaLend.ts +157 -157
  103. package/src/types/maker.ts +63 -63
  104. package/src/types/morphoBlue.ts +194 -194
  105. package/src/types/portfolio.ts +60 -60
  106. package/src/types/spark.ts +137 -137
@@ -1,217 +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
- };
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
+ [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),
217
228
  }) as const;
@@ -1,84 +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
- } 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
+ [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]: [],
84
91
  };