@defisaver/positions-sdk 0.0.201-fluid-dev-4 → 0.0.201-fluid-dev-6

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 (95) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +69 -69
  4. package/cjs/config/contracts.d.ts +15 -0
  5. package/cjs/config/contracts.js +7 -2
  6. package/cjs/fluid/index.d.ts +14 -0
  7. package/cjs/fluid/index.js +32 -5
  8. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  9. package/cjs/markets/fluid/index.d.ts +0 -6
  10. package/cjs/markets/fluid/index.js +57 -62
  11. package/cjs/services/priceService.d.ts +1 -0
  12. package/cjs/services/priceService.js +29 -1
  13. package/cjs/types/fluid.d.ts +1 -9
  14. package/cjs/types/fluid.js +0 -8
  15. package/esm/config/contracts.d.ts +15 -0
  16. package/esm/config/contracts.js +7 -2
  17. package/esm/fluid/index.d.ts +14 -0
  18. package/esm/fluid/index.js +32 -6
  19. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  20. package/esm/markets/fluid/index.d.ts +0 -6
  21. package/esm/markets/fluid/index.js +56 -57
  22. package/esm/services/priceService.d.ts +1 -0
  23. package/esm/services/priceService.js +27 -0
  24. package/esm/types/fluid.d.ts +1 -9
  25. package/esm/types/fluid.js +0 -8
  26. package/package.json +51 -51
  27. package/src/aaveV2/index.ts +227 -227
  28. package/src/aaveV3/index.ts +625 -625
  29. package/src/assets/index.ts +60 -60
  30. package/src/chickenBonds/index.ts +123 -123
  31. package/src/compoundV2/index.ts +220 -220
  32. package/src/compoundV3/index.ts +291 -291
  33. package/src/config/contracts.js +1122 -1117
  34. package/src/constants/index.ts +6 -6
  35. package/src/contracts.ts +134 -134
  36. package/src/curveUsd/index.ts +229 -229
  37. package/src/eulerV2/index.ts +303 -303
  38. package/src/exchange/index.ts +17 -17
  39. package/src/fluid/index.ts +329 -298
  40. package/src/helpers/aaveHelpers/index.ts +198 -198
  41. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  42. package/src/helpers/compoundHelpers/index.ts +246 -246
  43. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  44. package/src/helpers/eulerHelpers/index.ts +232 -232
  45. package/src/helpers/fluidHelpers/index.ts +53 -53
  46. package/src/helpers/index.ts +11 -11
  47. package/src/helpers/liquityV2Helpers/index.ts +79 -79
  48. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  49. package/src/helpers/makerHelpers/index.ts +94 -94
  50. package/src/helpers/morphoBlueHelpers/index.ts +365 -365
  51. package/src/helpers/sparkHelpers/index.ts +150 -150
  52. package/src/index.ts +52 -52
  53. package/src/liquity/index.ts +116 -116
  54. package/src/liquityV2/index.ts +227 -227
  55. package/src/llamaLend/index.ts +275 -275
  56. package/src/maker/index.ts +117 -117
  57. package/src/markets/aave/index.ts +152 -152
  58. package/src/markets/aave/marketAssets.ts +44 -44
  59. package/src/markets/compound/index.ts +213 -213
  60. package/src/markets/compound/marketsAssets.ts +82 -82
  61. package/src/markets/curveUsd/index.ts +69 -69
  62. package/src/markets/euler/index.ts +26 -26
  63. package/src/markets/fluid/index.ts +2002 -2005
  64. package/src/markets/index.ts +27 -27
  65. package/src/markets/liquityV2/index.ts +43 -43
  66. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  67. package/src/markets/llamaLend/index.ts +235 -235
  68. package/src/markets/morphoBlue/index.ts +895 -895
  69. package/src/markets/spark/index.ts +29 -29
  70. package/src/markets/spark/marketAssets.ts +10 -10
  71. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  72. package/src/morphoAaveV2/index.ts +256 -256
  73. package/src/morphoAaveV3/index.ts +631 -631
  74. package/src/morphoBlue/index.ts +202 -202
  75. package/src/multicall/index.ts +33 -33
  76. package/src/services/dsrService.ts +15 -15
  77. package/src/services/priceService.ts +91 -62
  78. package/src/services/utils.ts +59 -59
  79. package/src/setup.ts +8 -8
  80. package/src/spark/index.ts +461 -461
  81. package/src/staking/staking.ts +220 -220
  82. package/src/types/aave.ts +271 -271
  83. package/src/types/chickenBonds.ts +45 -45
  84. package/src/types/common.ts +84 -84
  85. package/src/types/compound.ts +131 -131
  86. package/src/types/curveUsd.ts +118 -118
  87. package/src/types/euler.ts +171 -171
  88. package/src/types/fluid.ts +263 -271
  89. package/src/types/index.ts +11 -11
  90. package/src/types/liquity.ts +30 -30
  91. package/src/types/liquityV2.ts +118 -118
  92. package/src/types/llamaLend.ts +155 -155
  93. package/src/types/maker.ts +50 -50
  94. package/src/types/morphoBlue.ts +192 -192
  95. package/src/types/spark.ts +131 -131
@@ -1,214 +1,214 @@
1
- import { getConfigContractAddress } from '../../contracts';
2
- import { CompoundBulkerOptions, CompoundMarketData, CompoundVersions } from '../../types';
3
- import { NetworkNumber } from '../../types/common';
4
- import {
5
- compoundV2CollateralAssets,
6
- v3ETHCollAssets,
7
- v3USDbCCollAssets,
8
- v3USDCCollAssets,
9
- v3USDCeCollAssets, v3USDSCollAssets,
10
- v3USDTCollAssets, v3wstETHCollAssets,
11
- } from './marketsAssets';
12
-
13
- export {
14
- compoundV2CollateralAssets,
15
- v3ETHCollAssets,
16
- v3USDbCCollAssets,
17
- v3USDCCollAssets,
18
- v3USDCeCollAssets,
19
- v3USDTCollAssets,
20
- };
21
-
22
- const EMPTY_BULKER_OPTIONS: CompoundBulkerOptions = { supply: '', withdraw: '' };
23
-
24
- const STANDARD_BULKER_OPTIONS: CompoundBulkerOptions = {
25
- supply: '0x414354494f4e5f535550504c595f4e41544956455f544f4b454e000000000000',
26
- withdraw: '0x414354494f4e5f57495448445241575f4e41544956455f544f4b454e00000000',
27
- };
28
-
29
- const BULKER_OPTIONS: Record<NetworkNumber, Record<CompoundVersions, CompoundBulkerOptions>> = {
30
- [NetworkNumber.Eth]: {
31
- [CompoundVersions.CompoundV3USDC]: { supply: 2, withdraw: 5 },
32
- [CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
33
- [CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
34
- [CompoundVersions.CompoundV3wstETH]: STANDARD_BULKER_OPTIONS,
35
- [CompoundVersions.CompoundV3USDS]: STANDARD_BULKER_OPTIONS,
36
-
37
- // Non-existing markets, keeping it because of typescript
38
- [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
39
- [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
40
- [CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
41
- },
42
- [NetworkNumber.Arb]: {
43
- [CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
44
- [CompoundVersions.CompoundV3USDCe]: STANDARD_BULKER_OPTIONS,
45
- [CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
46
- [CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
47
-
48
- // Non-existing markets, keeping it because of typescript
49
- [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
50
- [CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
51
- [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
52
- [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
53
- },
54
- [NetworkNumber.Base]: {
55
- [CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
56
- [CompoundVersions.CompoundV3USDbC]: STANDARD_BULKER_OPTIONS,
57
- [CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
58
-
59
- // Non-existing markets, keeping it because of typescript
60
- [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
61
- [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
62
- [CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
63
- [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
64
- [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
65
- },
66
- [NetworkNumber.Opt]: {
67
- [CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
68
- [CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
69
- // Non-existing markets, keeping it because of typescript
70
- [CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
71
- [CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
72
- [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
73
- [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
74
- [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
75
- [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
76
- },
77
- };
78
-
79
- export const COMPOUND_V2: CompoundMarketData = {
80
- chainIds: [NetworkNumber.Eth],
81
- label: 'Compound V2',
82
- shortLabel: 'v2',
83
- value: CompoundVersions.CompoundV2,
84
- baseAsset: '',
85
- collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
86
- baseMarket: '',
87
- baseMarketAddress: '',
88
- secondLabel: '',
89
- bulkerName: '',
90
- bulkerAddress: '',
91
- bulkerOptions: BULKER_OPTIONS[NetworkNumber.Eth][CompoundVersions.CompoundV2],
92
- // icon: SvgAdapter(protocolIcons.compound),
93
- };
94
-
95
- export const COMPOUND_V3_USDC = (networkId: NetworkNumber): CompoundMarketData => ({
96
- chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
97
- label: 'Compound V3 - USDC',
98
- shortLabel: 'v3',
99
- value: CompoundVersions.CompoundV3USDC,
100
- baseAsset: 'USDC',
101
- collAssets: networkId ? v3USDCCollAssets[networkId] : [],
102
- baseMarket: 'cUSDCv3',
103
- baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
104
- secondLabel: 'Market',
105
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
106
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
107
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
108
- // icon: SvgAdapter(protocolIcons.compoundv3),
109
- });
110
-
111
- export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData => ({
112
- chainIds: [NetworkNumber.Arb],
113
- label: 'Compound V3 - USDC.e',
114
- shortLabel: 'v3',
115
- value: CompoundVersions.CompoundV3USDCe,
116
- baseAsset: 'USDC.e',
117
- collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
118
- baseMarket: 'cUSDCev3',
119
- baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
120
- secondLabel: 'Market',
121
- bulkerName: 'CompV3BulkerL2',
122
- bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
123
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
124
- // icon: SvgAdapter(protocolIcons.compoundv3),
125
- });
126
-
127
- export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
128
- chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
129
- label: 'Compound V3 - ETH',
130
- shortLabel: 'v3',
131
- value: CompoundVersions.CompoundV3ETH,
132
- baseAsset: 'ETH',
133
- collAssets: networkId ? v3ETHCollAssets[networkId] : [],
134
- baseMarket: 'cETHv3',
135
- baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
136
- secondLabel: 'Market',
137
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
138
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
139
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
140
- // icon: SvgAdapter(protocolIcons.compoundv3),
141
- });
142
-
143
- export const COMPOUND_V3_USDBC = (networkId: NetworkNumber): CompoundMarketData => ({
144
- chainIds: [NetworkNumber.Base],
145
- label: 'Compound V3 - USDbC',
146
- shortLabel: 'v3',
147
- value: CompoundVersions.CompoundV3USDbC,
148
- baseAsset: 'USDbC',
149
- collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
150
- baseMarket: 'cUSDbCv3',
151
- baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
152
- secondLabel: 'Market',
153
- bulkerName: 'CompV3BulkerL2',
154
- bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
155
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
156
- // icon: SvgAdapter(protocolIcons.compoundv3),
157
- });
158
-
159
- export const COMPOUND_V3_USDT = (networkId: NetworkNumber): CompoundMarketData => ({
160
- chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt],
161
- label: 'Compound V3 - USDT',
162
- shortLabel: 'v3',
163
- value: CompoundVersions.CompoundV3USDT,
164
- baseAsset: 'USDT',
165
- collAssets: networkId ? v3USDTCollAssets[networkId] : [],
166
- baseMarket: 'cUSDTv3',
167
- baseMarketAddress: getConfigContractAddress('cUSDTv3', networkId),
168
- secondLabel: 'Market',
169
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
170
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
171
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDT],
172
- // icon: SvgAdapter(protocolIcons.compoundv3),
173
- });
174
-
175
- export const COMPOUND_V3_WSTETH = (networkId: NetworkNumber): CompoundMarketData => ({
176
- chainIds: [NetworkNumber.Eth],
177
- label: 'Compound V3 - wstETH',
178
- shortLabel: 'v3',
179
- value: CompoundVersions.CompoundV3wstETH,
180
- baseAsset: 'wstETH',
181
- collAssets: networkId ? v3wstETHCollAssets[networkId] : [],
182
- baseMarket: 'cWstETHv3',
183
- baseMarketAddress: getConfigContractAddress('cWstETHv3', networkId),
184
- secondLabel: 'Market',
185
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
186
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
187
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3wstETH],
188
- });
189
-
190
- export const COMPOUND_V3_USDS = (networkId: NetworkNumber): CompoundMarketData => ({
191
- chainIds: [NetworkNumber.Eth],
192
- label: 'Compound V3 - USDS',
193
- shortLabel: 'v3',
194
- value: CompoundVersions.CompoundV3USDS,
195
- baseAsset: 'USDS',
196
- collAssets: networkId ? v3USDSCollAssets[networkId] : [],
197
- baseMarket: 'cUSDSv3',
198
- baseMarketAddress: getConfigContractAddress('cUSDSv3', networkId),
199
- secondLabel: 'Market',
200
- bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
201
- bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
202
- bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDS],
203
- });
204
-
205
- export const CompoundMarkets = (networkId: NetworkNumber) => ({
206
- [CompoundVersions.CompoundV2]: COMPOUND_V2,
207
- [CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
208
- [CompoundVersions.CompoundV3USDC]: COMPOUND_V3_USDC(networkId),
209
- [CompoundVersions.CompoundV3USDbC]: COMPOUND_V3_USDBC(networkId),
210
- [CompoundVersions.CompoundV3USDCe]: COMPOUND_V3_USDCe(networkId),
211
- [CompoundVersions.CompoundV3USDT]: COMPOUND_V3_USDT(networkId),
212
- [CompoundVersions.CompoundV3wstETH]: COMPOUND_V3_WSTETH(networkId),
213
- [CompoundVersions.CompoundV3USDS]: COMPOUND_V3_USDS(networkId),
1
+ import { getConfigContractAddress } from '../../contracts';
2
+ import { CompoundBulkerOptions, CompoundMarketData, CompoundVersions } from '../../types';
3
+ import { NetworkNumber } from '../../types/common';
4
+ import {
5
+ compoundV2CollateralAssets,
6
+ v3ETHCollAssets,
7
+ v3USDbCCollAssets,
8
+ v3USDCCollAssets,
9
+ v3USDCeCollAssets, v3USDSCollAssets,
10
+ v3USDTCollAssets, v3wstETHCollAssets,
11
+ } from './marketsAssets';
12
+
13
+ export {
14
+ compoundV2CollateralAssets,
15
+ v3ETHCollAssets,
16
+ v3USDbCCollAssets,
17
+ v3USDCCollAssets,
18
+ v3USDCeCollAssets,
19
+ v3USDTCollAssets,
20
+ };
21
+
22
+ const EMPTY_BULKER_OPTIONS: CompoundBulkerOptions = { supply: '', withdraw: '' };
23
+
24
+ const STANDARD_BULKER_OPTIONS: CompoundBulkerOptions = {
25
+ supply: '0x414354494f4e5f535550504c595f4e41544956455f544f4b454e000000000000',
26
+ withdraw: '0x414354494f4e5f57495448445241575f4e41544956455f544f4b454e00000000',
27
+ };
28
+
29
+ const BULKER_OPTIONS: Record<NetworkNumber, Record<CompoundVersions, CompoundBulkerOptions>> = {
30
+ [NetworkNumber.Eth]: {
31
+ [CompoundVersions.CompoundV3USDC]: { supply: 2, withdraw: 5 },
32
+ [CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
33
+ [CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
34
+ [CompoundVersions.CompoundV3wstETH]: STANDARD_BULKER_OPTIONS,
35
+ [CompoundVersions.CompoundV3USDS]: STANDARD_BULKER_OPTIONS,
36
+
37
+ // Non-existing markets, keeping it because of typescript
38
+ [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
39
+ [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
40
+ [CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
41
+ },
42
+ [NetworkNumber.Arb]: {
43
+ [CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
44
+ [CompoundVersions.CompoundV3USDCe]: STANDARD_BULKER_OPTIONS,
45
+ [CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
46
+ [CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
47
+
48
+ // Non-existing markets, keeping it because of typescript
49
+ [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
50
+ [CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
51
+ [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
52
+ [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
53
+ },
54
+ [NetworkNumber.Base]: {
55
+ [CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
56
+ [CompoundVersions.CompoundV3USDbC]: STANDARD_BULKER_OPTIONS,
57
+ [CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
58
+
59
+ // Non-existing markets, keeping it because of typescript
60
+ [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
61
+ [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
62
+ [CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
63
+ [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
64
+ [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
65
+ },
66
+ [NetworkNumber.Opt]: {
67
+ [CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
68
+ [CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
69
+ // Non-existing markets, keeping it because of typescript
70
+ [CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
71
+ [CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
72
+ [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
73
+ [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
74
+ [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
75
+ [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
76
+ },
77
+ };
78
+
79
+ export const COMPOUND_V2: CompoundMarketData = {
80
+ chainIds: [NetworkNumber.Eth],
81
+ label: 'Compound V2',
82
+ shortLabel: 'v2',
83
+ value: CompoundVersions.CompoundV2,
84
+ baseAsset: '',
85
+ collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
86
+ baseMarket: '',
87
+ baseMarketAddress: '',
88
+ secondLabel: '',
89
+ bulkerName: '',
90
+ bulkerAddress: '',
91
+ bulkerOptions: BULKER_OPTIONS[NetworkNumber.Eth][CompoundVersions.CompoundV2],
92
+ // icon: SvgAdapter(protocolIcons.compound),
93
+ };
94
+
95
+ export const COMPOUND_V3_USDC = (networkId: NetworkNumber): CompoundMarketData => ({
96
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
97
+ label: 'Compound V3 - USDC',
98
+ shortLabel: 'v3',
99
+ value: CompoundVersions.CompoundV3USDC,
100
+ baseAsset: 'USDC',
101
+ collAssets: networkId ? v3USDCCollAssets[networkId] : [],
102
+ baseMarket: 'cUSDCv3',
103
+ baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
104
+ secondLabel: 'Market',
105
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
106
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
107
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
108
+ // icon: SvgAdapter(protocolIcons.compoundv3),
109
+ });
110
+
111
+ export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData => ({
112
+ chainIds: [NetworkNumber.Arb],
113
+ label: 'Compound V3 - USDC.e',
114
+ shortLabel: 'v3',
115
+ value: CompoundVersions.CompoundV3USDCe,
116
+ baseAsset: 'USDC.e',
117
+ collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
118
+ baseMarket: 'cUSDCev3',
119
+ baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
120
+ secondLabel: 'Market',
121
+ bulkerName: 'CompV3BulkerL2',
122
+ bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
123
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
124
+ // icon: SvgAdapter(protocolIcons.compoundv3),
125
+ });
126
+
127
+ export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
128
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
129
+ label: 'Compound V3 - ETH',
130
+ shortLabel: 'v3',
131
+ value: CompoundVersions.CompoundV3ETH,
132
+ baseAsset: 'ETH',
133
+ collAssets: networkId ? v3ETHCollAssets[networkId] : [],
134
+ baseMarket: 'cETHv3',
135
+ baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
136
+ secondLabel: 'Market',
137
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
138
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
139
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
140
+ // icon: SvgAdapter(protocolIcons.compoundv3),
141
+ });
142
+
143
+ export const COMPOUND_V3_USDBC = (networkId: NetworkNumber): CompoundMarketData => ({
144
+ chainIds: [NetworkNumber.Base],
145
+ label: 'Compound V3 - USDbC',
146
+ shortLabel: 'v3',
147
+ value: CompoundVersions.CompoundV3USDbC,
148
+ baseAsset: 'USDbC',
149
+ collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
150
+ baseMarket: 'cUSDbCv3',
151
+ baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
152
+ secondLabel: 'Market',
153
+ bulkerName: 'CompV3BulkerL2',
154
+ bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
155
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
156
+ // icon: SvgAdapter(protocolIcons.compoundv3),
157
+ });
158
+
159
+ export const COMPOUND_V3_USDT = (networkId: NetworkNumber): CompoundMarketData => ({
160
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt],
161
+ label: 'Compound V3 - USDT',
162
+ shortLabel: 'v3',
163
+ value: CompoundVersions.CompoundV3USDT,
164
+ baseAsset: 'USDT',
165
+ collAssets: networkId ? v3USDTCollAssets[networkId] : [],
166
+ baseMarket: 'cUSDTv3',
167
+ baseMarketAddress: getConfigContractAddress('cUSDTv3', networkId),
168
+ secondLabel: 'Market',
169
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
170
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
171
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDT],
172
+ // icon: SvgAdapter(protocolIcons.compoundv3),
173
+ });
174
+
175
+ export const COMPOUND_V3_WSTETH = (networkId: NetworkNumber): CompoundMarketData => ({
176
+ chainIds: [NetworkNumber.Eth],
177
+ label: 'Compound V3 - wstETH',
178
+ shortLabel: 'v3',
179
+ value: CompoundVersions.CompoundV3wstETH,
180
+ baseAsset: 'wstETH',
181
+ collAssets: networkId ? v3wstETHCollAssets[networkId] : [],
182
+ baseMarket: 'cWstETHv3',
183
+ baseMarketAddress: getConfigContractAddress('cWstETHv3', networkId),
184
+ secondLabel: 'Market',
185
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
186
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
187
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3wstETH],
188
+ });
189
+
190
+ export const COMPOUND_V3_USDS = (networkId: NetworkNumber): CompoundMarketData => ({
191
+ chainIds: [NetworkNumber.Eth],
192
+ label: 'Compound V3 - USDS',
193
+ shortLabel: 'v3',
194
+ value: CompoundVersions.CompoundV3USDS,
195
+ baseAsset: 'USDS',
196
+ collAssets: networkId ? v3USDSCollAssets[networkId] : [],
197
+ baseMarket: 'cUSDSv3',
198
+ baseMarketAddress: getConfigContractAddress('cUSDSv3', networkId),
199
+ secondLabel: 'Market',
200
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
201
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
202
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDS],
203
+ });
204
+
205
+ export const CompoundMarkets = (networkId: NetworkNumber) => ({
206
+ [CompoundVersions.CompoundV2]: COMPOUND_V2,
207
+ [CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
208
+ [CompoundVersions.CompoundV3USDC]: COMPOUND_V3_USDC(networkId),
209
+ [CompoundVersions.CompoundV3USDbC]: COMPOUND_V3_USDBC(networkId),
210
+ [CompoundVersions.CompoundV3USDCe]: COMPOUND_V3_USDCe(networkId),
211
+ [CompoundVersions.CompoundV3USDT]: COMPOUND_V3_USDT(networkId),
212
+ [CompoundVersions.CompoundV3wstETH]: COMPOUND_V3_WSTETH(networkId),
213
+ [CompoundVersions.CompoundV3USDS]: COMPOUND_V3_USDS(networkId),
214
214
  }) as const;
@@ -1,83 +1,83 @@
1
- import { getAssetInfo } from '@defisaver/tokens';
2
- import { NetworkNumber } from '../../types/common';
3
-
4
- export const compoundV2CollateralAssets = [
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'];
10
- export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC', 'wstETH', 'ezETH', 'wUSDM'];
11
- export const v3USDCCollAssetsBase = ['ETH', 'cbETH', 'wstETH', 'cbBTC'];
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'];
33
- export const v3ETHCollAssetsBase = ['cbETH', 'ezETH', 'wstETH', 'USDC', 'weETH', 'wrsETH', 'cbBTC'];
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', 'wUSDM', 'sFRAX', 'mETH'];
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
-
69
- export const v3USDSCollAssets = {
70
- [NetworkNumber.Eth]: v3USDSCollAssetsEth,
71
- [NetworkNumber.Opt]: [],
72
- [NetworkNumber.Arb]: [],
73
- [NetworkNumber.Base]: [],
74
- };
75
-
76
- export const v3wstETHCollAssetsEth = ['rsETH', 'ezETH'];
77
-
78
- export const v3wstETHCollAssets = {
79
- [NetworkNumber.Eth]: v3wstETHCollAssetsEth,
80
- [NetworkNumber.Opt]: [],
81
- [NetworkNumber.Arb]: [],
82
- [NetworkNumber.Base]: [],
1
+ import { getAssetInfo } from '@defisaver/tokens';
2
+ import { NetworkNumber } from '../../types/common';
3
+
4
+ export const compoundV2CollateralAssets = [
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'];
10
+ export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC', 'wstETH', 'ezETH', 'wUSDM'];
11
+ export const v3USDCCollAssetsBase = ['ETH', 'cbETH', 'wstETH', 'cbBTC'];
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'];
33
+ export const v3ETHCollAssetsBase = ['cbETH', 'ezETH', 'wstETH', 'USDC', 'weETH', 'wrsETH', 'cbBTC'];
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', 'wUSDM', 'sFRAX', 'mETH'];
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
+
69
+ export const v3USDSCollAssets = {
70
+ [NetworkNumber.Eth]: v3USDSCollAssetsEth,
71
+ [NetworkNumber.Opt]: [],
72
+ [NetworkNumber.Arb]: [],
73
+ [NetworkNumber.Base]: [],
74
+ };
75
+
76
+ export const v3wstETHCollAssetsEth = ['rsETH', 'ezETH'];
77
+
78
+ export const v3wstETHCollAssets = {
79
+ [NetworkNumber.Eth]: v3wstETHCollAssetsEth,
80
+ [NetworkNumber.Opt]: [],
81
+ [NetworkNumber.Arb]: [],
82
+ [NetworkNumber.Base]: [],
83
83
  };