@defisaver/positions-sdk 1.0.11-dev → 1.0.11-fluid-dev

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 (109) 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 +113 -49
  5. package/cjs/config/contracts.js +10 -2
  6. package/cjs/contracts.d.ts +1 -0
  7. package/cjs/contracts.js +2 -1
  8. package/cjs/fluid/index.d.ts +2 -0
  9. package/cjs/fluid/index.js +636 -13
  10. package/cjs/helpers/fluidHelpers/index.d.ts +59 -2
  11. package/cjs/helpers/fluidHelpers/index.js +142 -4
  12. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  13. package/cjs/markets/fluid/index.js +276 -245
  14. package/cjs/services/priceService.d.ts +23 -0
  15. package/cjs/services/priceService.js +44 -5
  16. package/cjs/types/contracts/generated/FluidView.d.ts +220 -3
  17. package/cjs/types/contracts/generated/WeETHPriceFeed.d.ts +135 -0
  18. package/cjs/types/contracts/generated/WeETHPriceFeed.js +5 -0
  19. package/cjs/types/contracts/generated/index.d.ts +1 -0
  20. package/cjs/types/fluid.d.ts +39 -10
  21. package/esm/config/contracts.d.ts +113 -49
  22. package/esm/config/contracts.js +10 -2
  23. package/esm/contracts.d.ts +1 -0
  24. package/esm/contracts.js +1 -0
  25. package/esm/fluid/index.d.ts +2 -0
  26. package/esm/fluid/index.js +639 -16
  27. package/esm/helpers/fluidHelpers/index.d.ts +59 -2
  28. package/esm/helpers/fluidHelpers/index.js +137 -3
  29. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  30. package/esm/markets/fluid/index.js +276 -245
  31. package/esm/services/priceService.d.ts +23 -0
  32. package/esm/services/priceService.js +40 -5
  33. package/esm/types/contracts/generated/FluidView.d.ts +220 -3
  34. package/esm/types/contracts/generated/WeETHPriceFeed.d.ts +135 -0
  35. package/esm/types/contracts/generated/WeETHPriceFeed.js +4 -0
  36. package/esm/types/contracts/generated/index.d.ts +1 -0
  37. package/esm/types/fluid.d.ts +39 -10
  38. package/package.json +54 -54
  39. package/src/aaveV2/index.ts +227 -227
  40. package/src/aaveV3/index.ts +624 -624
  41. package/src/assets/index.ts +60 -60
  42. package/src/chickenBonds/index.ts +123 -123
  43. package/src/compoundV2/index.ts +220 -220
  44. package/src/compoundV3/index.ts +291 -291
  45. package/src/config/contracts.js +1155 -1147
  46. package/src/constants/index.ts +6 -6
  47. package/src/contracts.ts +135 -134
  48. package/src/curveUsd/index.ts +239 -239
  49. package/src/eulerV2/index.ts +303 -303
  50. package/src/exchange/index.ts +17 -17
  51. package/src/fluid/index.ts +1216 -354
  52. package/src/helpers/aaveHelpers/index.ts +203 -203
  53. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  54. package/src/helpers/compoundHelpers/index.ts +248 -248
  55. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  56. package/src/helpers/eulerHelpers/index.ts +234 -234
  57. package/src/helpers/fluidHelpers/index.ts +295 -57
  58. package/src/helpers/index.ts +11 -11
  59. package/src/helpers/liquityV2Helpers/index.ts +80 -80
  60. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  61. package/src/helpers/makerHelpers/index.ts +94 -94
  62. package/src/helpers/morphoBlueHelpers/index.ts +367 -367
  63. package/src/helpers/sparkHelpers/index.ts +154 -154
  64. package/src/index.ts +52 -52
  65. package/src/liquity/index.ts +116 -116
  66. package/src/liquityV2/index.ts +295 -295
  67. package/src/llamaLend/index.ts +275 -275
  68. package/src/maker/index.ts +117 -117
  69. package/src/markets/aave/index.ts +152 -152
  70. package/src/markets/aave/marketAssets.ts +46 -46
  71. package/src/markets/compound/index.ts +213 -213
  72. package/src/markets/compound/marketsAssets.ts +82 -82
  73. package/src/markets/curveUsd/index.ts +69 -69
  74. package/src/markets/euler/index.ts +26 -26
  75. package/src/markets/fluid/index.ts +2043 -2012
  76. package/src/markets/index.ts +27 -27
  77. package/src/markets/liquityV2/index.ts +54 -54
  78. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  79. package/src/markets/llamaLend/index.ts +235 -235
  80. package/src/markets/morphoBlue/index.ts +895 -895
  81. package/src/markets/spark/index.ts +29 -29
  82. package/src/markets/spark/marketAssets.ts +10 -10
  83. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  84. package/src/morphoAaveV2/index.ts +256 -256
  85. package/src/morphoAaveV3/index.ts +630 -630
  86. package/src/morphoBlue/index.ts +202 -202
  87. package/src/multicall/index.ts +33 -33
  88. package/src/services/priceService.ts +130 -91
  89. package/src/services/utils.ts +59 -59
  90. package/src/setup.ts +8 -8
  91. package/src/spark/index.ts +460 -460
  92. package/src/staking/staking.ts +217 -217
  93. package/src/types/aave.ts +275 -275
  94. package/src/types/chickenBonds.ts +45 -45
  95. package/src/types/common.ts +84 -84
  96. package/src/types/compound.ts +133 -133
  97. package/src/types/contracts/generated/FluidView.ts +263 -2
  98. package/src/types/contracts/generated/WeETHPriceFeed.ts +202 -0
  99. package/src/types/contracts/generated/index.ts +1 -0
  100. package/src/types/curveUsd.ts +119 -119
  101. package/src/types/euler.ts +173 -173
  102. package/src/types/fluid.ts +299 -268
  103. package/src/types/index.ts +11 -11
  104. package/src/types/liquity.ts +30 -30
  105. package/src/types/liquityV2.ts +119 -119
  106. package/src/types/llamaLend.ts +155 -155
  107. package/src/types/maker.ts +50 -50
  108. package/src/types/morphoBlue.ts +194 -194
  109. package/src/types/spark.ts +135 -135
@@ -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 { 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'];
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', 'tETH'];
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', 'wUSDM', 'sFRAX', 'mETH', 'weETH'];
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 { 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'];
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', 'tETH'];
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', 'wUSDM', 'sFRAX', 'mETH', 'weETH'];
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
  };