@defisaver/positions-sdk 0.0.87 → 0.0.89
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.
- package/README.md +63 -63
- package/cjs/compoundV3/index.js +3 -11
- package/cjs/markets/spark/marketAssets.js +1 -1
- package/cjs/morphoAaveV3/index.js +3 -11
- package/cjs/spark/index.js +3 -11
- package/esm/compoundV3/index.js +4 -12
- package/esm/markets/spark/marketAssets.js +1 -1
- package/esm/morphoAaveV3/index.js +5 -13
- package/esm/spark/index.js +5 -13
- package/package.json +40 -40
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +558 -558
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +219 -219
- package/src/compoundV3/index.ts +266 -274
- package/src/config/contracts.js +848 -848
- package/src/constants/index.ts +5 -5
- package/src/contracts.ts +128 -128
- package/src/curveUsd/index.ts +229 -229
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +134 -134
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +181 -181
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/index.ts +7 -7
- package/src/helpers/llamaLendHelpers/index.ts +45 -45
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +56 -56
- package/src/helpers/sparkHelpers/index.ts +106 -106
- package/src/index.ts +46 -46
- package/src/liquity/index.ts +116 -116
- package/src/llamaLend/index.ts +268 -268
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +80 -80
- package/src/markets/aave/marketAssets.ts +25 -25
- package/src/markets/compound/index.ts +142 -142
- package/src/markets/compound/marketsAssets.ts +50 -50
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/index.ts +5 -5
- package/src/markets/llamaLend/contractAddresses.ts +95 -95
- package/src/markets/llamaLend/index.ts +150 -150
- package/src/markets/morphoBlue/index.ts +561 -561
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +76 -76
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +612 -620
- package/src/morphoBlue/index.ts +162 -162
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +21 -21
- package/src/services/utils.ts +51 -51
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +424 -434
- package/src/staking/staking.ts +186 -186
- package/src/types/aave.ts +256 -256
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +128 -128
- package/src/types/curveUsd.ts +118 -118
- package/src/types/index.ts +8 -8
- package/src/types/liquity.ts +30 -30
- package/src/types/llamaLend.ts +143 -143
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +136 -136
- package/src/types/spark.ts +106 -106
|
@@ -1,143 +1,143 @@
|
|
|
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,
|
|
10
|
-
} from './marketsAssets';
|
|
11
|
-
|
|
12
|
-
const EMPTY_BULKER_OPTIONS: CompoundBulkerOptions = { supply: '', withdraw: '' };
|
|
13
|
-
|
|
14
|
-
const STANDARD_BULKER_OPTIONS: CompoundBulkerOptions = {
|
|
15
|
-
supply: '0x414354494f4e5f535550504c595f4e41544956455f544f4b454e000000000000',
|
|
16
|
-
withdraw: '0x414354494f4e5f57495448445241575f4e41544956455f544f4b454e00000000',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const BULKER_OPTIONS: Record<NetworkNumber, Record<CompoundVersions, CompoundBulkerOptions>> = {
|
|
20
|
-
[NetworkNumber.Eth]: {
|
|
21
|
-
[CompoundVersions.CompoundV3USDC]: { supply: 2, withdraw: 5 },
|
|
22
|
-
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
23
|
-
|
|
24
|
-
// Non-existing markets, keeping it because of typescript
|
|
25
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
26
|
-
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
27
|
-
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
28
|
-
},
|
|
29
|
-
[NetworkNumber.Arb]: {
|
|
30
|
-
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
31
|
-
[CompoundVersions.CompoundV3USDCe]: STANDARD_BULKER_OPTIONS,
|
|
32
|
-
|
|
33
|
-
// Non-existing markets, keeping it because of typescript
|
|
34
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
35
|
-
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
36
|
-
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
37
|
-
},
|
|
38
|
-
[NetworkNumber.Base]: {
|
|
39
|
-
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
40
|
-
[CompoundVersions.CompoundV3USDbC]: STANDARD_BULKER_OPTIONS,
|
|
41
|
-
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
42
|
-
|
|
43
|
-
// Non-existing markets, keeping it because of typescript
|
|
44
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
45
|
-
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
46
|
-
},
|
|
47
|
-
[NetworkNumber.Opt]: {
|
|
48
|
-
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
49
|
-
// Non-existing markets, keeping it because of typescript
|
|
50
|
-
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
51
|
-
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
52
|
-
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
53
|
-
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const COMPOUND_V2: CompoundMarketData = {
|
|
58
|
-
chainIds: [NetworkNumber.Eth],
|
|
59
|
-
label: 'Compound V2',
|
|
60
|
-
shortLabel: 'v2',
|
|
61
|
-
value: CompoundVersions.CompoundV2,
|
|
62
|
-
baseAsset: '',
|
|
63
|
-
collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
|
|
64
|
-
baseMarket: '',
|
|
65
|
-
baseMarketAddress: '',
|
|
66
|
-
secondLabel: '',
|
|
67
|
-
bulkerName: '',
|
|
68
|
-
bulkerAddress: '',
|
|
69
|
-
bulkerOptions: BULKER_OPTIONS[NetworkNumber.Eth][CompoundVersions.CompoundV2],
|
|
70
|
-
// icon: SvgAdapter(protocolIcons.compound),
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const COMPOUND_V3_USDC = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
74
|
-
chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
|
|
75
|
-
label: 'Compound V3 - USDC',
|
|
76
|
-
shortLabel: 'v3',
|
|
77
|
-
value: CompoundVersions.CompoundV3USDC,
|
|
78
|
-
baseAsset: 'USDC',
|
|
79
|
-
collAssets: networkId ? v3USDCCollAssets[networkId] : [],
|
|
80
|
-
baseMarket: 'cUSDCv3',
|
|
81
|
-
baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
|
|
82
|
-
secondLabel: 'Market',
|
|
83
|
-
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
|
|
84
|
-
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
|
|
85
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
|
|
86
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
90
|
-
chainIds: [NetworkNumber.Arb],
|
|
91
|
-
label: 'Compound V3 - USDC.e',
|
|
92
|
-
shortLabel: 'v3',
|
|
93
|
-
value: CompoundVersions.CompoundV3USDCe,
|
|
94
|
-
baseAsset: 'USDC.e',
|
|
95
|
-
collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
|
|
96
|
-
baseMarket: 'cUSDCev3',
|
|
97
|
-
baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
|
|
98
|
-
secondLabel: 'Market',
|
|
99
|
-
bulkerName: 'CompV3BulkerL2',
|
|
100
|
-
bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
|
|
101
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
|
|
102
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
106
|
-
chainIds: [NetworkNumber.Eth, NetworkNumber.Base],
|
|
107
|
-
label: 'Compound V3 - ETH',
|
|
108
|
-
shortLabel: 'v3',
|
|
109
|
-
value: CompoundVersions.CompoundV3ETH,
|
|
110
|
-
baseAsset: 'ETH',
|
|
111
|
-
collAssets: networkId ? v3ETHCollAssets[networkId] : [],
|
|
112
|
-
baseMarket: 'cETHv3',
|
|
113
|
-
baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
|
|
114
|
-
secondLabel: 'Market',
|
|
115
|
-
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
116
|
-
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
117
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
|
|
118
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
export const COMPOUND_V3_USDBC = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
122
|
-
chainIds: [NetworkNumber.Base],
|
|
123
|
-
label: 'Compound V3 - USDbC',
|
|
124
|
-
shortLabel: 'v3',
|
|
125
|
-
value: CompoundVersions.CompoundV3USDbC,
|
|
126
|
-
baseAsset: 'USDbC',
|
|
127
|
-
collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
|
|
128
|
-
baseMarket: 'cUSDbCv3',
|
|
129
|
-
baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
|
|
130
|
-
secondLabel: 'Market',
|
|
131
|
-
bulkerName: 'CompV3BulkerL2',
|
|
132
|
-
bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
|
|
133
|
-
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
|
|
134
|
-
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
export const CompoundMarkets = (networkId: NetworkNumber) => ({
|
|
138
|
-
[CompoundVersions.CompoundV2]: COMPOUND_V2,
|
|
139
|
-
[CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
|
|
140
|
-
[CompoundVersions.CompoundV3USDC]: COMPOUND_V3_USDC(networkId),
|
|
141
|
-
[CompoundVersions.CompoundV3USDbC]: COMPOUND_V3_USDBC(networkId),
|
|
142
|
-
[CompoundVersions.CompoundV3USDCe]: COMPOUND_V3_USDCe(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,
|
|
10
|
+
} from './marketsAssets';
|
|
11
|
+
|
|
12
|
+
const EMPTY_BULKER_OPTIONS: CompoundBulkerOptions = { supply: '', withdraw: '' };
|
|
13
|
+
|
|
14
|
+
const STANDARD_BULKER_OPTIONS: CompoundBulkerOptions = {
|
|
15
|
+
supply: '0x414354494f4e5f535550504c595f4e41544956455f544f4b454e000000000000',
|
|
16
|
+
withdraw: '0x414354494f4e5f57495448445241575f4e41544956455f544f4b454e00000000',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const BULKER_OPTIONS: Record<NetworkNumber, Record<CompoundVersions, CompoundBulkerOptions>> = {
|
|
20
|
+
[NetworkNumber.Eth]: {
|
|
21
|
+
[CompoundVersions.CompoundV3USDC]: { supply: 2, withdraw: 5 },
|
|
22
|
+
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
23
|
+
|
|
24
|
+
// Non-existing markets, keeping it because of typescript
|
|
25
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
26
|
+
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
27
|
+
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
28
|
+
},
|
|
29
|
+
[NetworkNumber.Arb]: {
|
|
30
|
+
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
31
|
+
[CompoundVersions.CompoundV3USDCe]: STANDARD_BULKER_OPTIONS,
|
|
32
|
+
|
|
33
|
+
// Non-existing markets, keeping it because of typescript
|
|
34
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
35
|
+
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
36
|
+
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
37
|
+
},
|
|
38
|
+
[NetworkNumber.Base]: {
|
|
39
|
+
[CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
|
|
40
|
+
[CompoundVersions.CompoundV3USDbC]: STANDARD_BULKER_OPTIONS,
|
|
41
|
+
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
42
|
+
|
|
43
|
+
// Non-existing markets, keeping it because of typescript
|
|
44
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
45
|
+
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
46
|
+
},
|
|
47
|
+
[NetworkNumber.Opt]: {
|
|
48
|
+
[CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
|
|
49
|
+
// Non-existing markets, keeping it because of typescript
|
|
50
|
+
[CompoundVersions.CompoundV3ETH]: EMPTY_BULKER_OPTIONS,
|
|
51
|
+
[CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
|
|
52
|
+
[CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
|
|
53
|
+
[CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const COMPOUND_V2: CompoundMarketData = {
|
|
58
|
+
chainIds: [NetworkNumber.Eth],
|
|
59
|
+
label: 'Compound V2',
|
|
60
|
+
shortLabel: 'v2',
|
|
61
|
+
value: CompoundVersions.CompoundV2,
|
|
62
|
+
baseAsset: '',
|
|
63
|
+
collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
|
|
64
|
+
baseMarket: '',
|
|
65
|
+
baseMarketAddress: '',
|
|
66
|
+
secondLabel: '',
|
|
67
|
+
bulkerName: '',
|
|
68
|
+
bulkerAddress: '',
|
|
69
|
+
bulkerOptions: BULKER_OPTIONS[NetworkNumber.Eth][CompoundVersions.CompoundV2],
|
|
70
|
+
// icon: SvgAdapter(protocolIcons.compound),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const COMPOUND_V3_USDC = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
74
|
+
chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
|
|
75
|
+
label: 'Compound V3 - USDC',
|
|
76
|
+
shortLabel: 'v3',
|
|
77
|
+
value: CompoundVersions.CompoundV3USDC,
|
|
78
|
+
baseAsset: 'USDC',
|
|
79
|
+
collAssets: networkId ? v3USDCCollAssets[networkId] : [],
|
|
80
|
+
baseMarket: 'cUSDCv3',
|
|
81
|
+
baseMarketAddress: getConfigContractAddress('cUSDCv3', networkId),
|
|
82
|
+
secondLabel: 'Market',
|
|
83
|
+
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2',
|
|
84
|
+
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetUSDC' : 'CompV3BulkerL2', networkId),
|
|
85
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDC],
|
|
86
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
90
|
+
chainIds: [NetworkNumber.Arb],
|
|
91
|
+
label: 'Compound V3 - USDC.e',
|
|
92
|
+
shortLabel: 'v3',
|
|
93
|
+
value: CompoundVersions.CompoundV3USDCe,
|
|
94
|
+
baseAsset: 'USDC.e',
|
|
95
|
+
collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
|
|
96
|
+
baseMarket: 'cUSDCev3',
|
|
97
|
+
baseMarketAddress: getConfigContractAddress('cUSDCev3', networkId),
|
|
98
|
+
secondLabel: 'Market',
|
|
99
|
+
bulkerName: 'CompV3BulkerL2',
|
|
100
|
+
bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
|
|
101
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDCe],
|
|
102
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
106
|
+
chainIds: [NetworkNumber.Eth, NetworkNumber.Base],
|
|
107
|
+
label: 'Compound V3 - ETH',
|
|
108
|
+
shortLabel: 'v3',
|
|
109
|
+
value: CompoundVersions.CompoundV3ETH,
|
|
110
|
+
baseAsset: 'ETH',
|
|
111
|
+
collAssets: networkId ? v3ETHCollAssets[networkId] : [],
|
|
112
|
+
baseMarket: 'cETHv3',
|
|
113
|
+
baseMarketAddress: getConfigContractAddress('cETHv3', networkId),
|
|
114
|
+
secondLabel: 'Market',
|
|
115
|
+
bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
|
|
116
|
+
bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
|
|
117
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3ETH],
|
|
118
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
export const COMPOUND_V3_USDBC = (networkId: NetworkNumber): CompoundMarketData => ({
|
|
122
|
+
chainIds: [NetworkNumber.Base],
|
|
123
|
+
label: 'Compound V3 - USDbC',
|
|
124
|
+
shortLabel: 'v3',
|
|
125
|
+
value: CompoundVersions.CompoundV3USDbC,
|
|
126
|
+
baseAsset: 'USDbC',
|
|
127
|
+
collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
|
|
128
|
+
baseMarket: 'cUSDbCv3',
|
|
129
|
+
baseMarketAddress: getConfigContractAddress('cUSDbCv3', networkId),
|
|
130
|
+
secondLabel: 'Market',
|
|
131
|
+
bulkerName: 'CompV3BulkerL2',
|
|
132
|
+
bulkerAddress: getConfigContractAddress('CompV3BulkerL2', networkId),
|
|
133
|
+
bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDbC],
|
|
134
|
+
// icon: SvgAdapter(protocolIcons.compoundv3),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export const CompoundMarkets = (networkId: NetworkNumber) => ({
|
|
138
|
+
[CompoundVersions.CompoundV2]: COMPOUND_V2,
|
|
139
|
+
[CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
|
|
140
|
+
[CompoundVersions.CompoundV3USDC]: COMPOUND_V3_USDC(networkId),
|
|
141
|
+
[CompoundVersions.CompoundV3USDbC]: COMPOUND_V3_USDBC(networkId),
|
|
142
|
+
[CompoundVersions.CompoundV3USDCe]: COMPOUND_V3_USDCe(networkId),
|
|
143
143
|
}) as const;
|
|
@@ -1,51 +1,51 @@
|
|
|
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 = ['ETH', 'COMP', 'WBTC', 'UNI', 'LINK'];
|
|
10
|
-
export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
|
|
11
|
-
export const v3USDCCollAssetsBase = ['ETH', 'cbETH'];
|
|
12
|
-
export const v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC'];
|
|
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'];
|
|
33
|
-
export const v3ETHCollAssetsBase = ['cbETH'];
|
|
34
|
-
|
|
35
|
-
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
36
|
-
export const v3ETHCollAssets = {
|
|
37
|
-
[NetworkNumber.Eth]: v3ETHCollAssetsEth,
|
|
38
|
-
[NetworkNumber.Opt]: [],
|
|
39
|
-
[NetworkNumber.Arb]: [],
|
|
40
|
-
[NetworkNumber.Base]: v3ETHCollAssetsBase,
|
|
41
|
-
} as const;
|
|
42
|
-
|
|
43
|
-
export const v3USDbCCollAssetsBase = ['ETH', 'cbETH'];
|
|
44
|
-
|
|
45
|
-
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
46
|
-
export const v3USDbCCollAssets = {
|
|
47
|
-
[NetworkNumber.Eth]: [],
|
|
48
|
-
[NetworkNumber.Opt]: [],
|
|
49
|
-
[NetworkNumber.Arb]: [],
|
|
50
|
-
[NetworkNumber.Base]: v3USDbCCollAssetsBase,
|
|
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 = ['ETH', 'COMP', 'WBTC', 'UNI', 'LINK'];
|
|
10
|
+
export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
|
|
11
|
+
export const v3USDCCollAssetsBase = ['ETH', 'cbETH'];
|
|
12
|
+
export const v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC'];
|
|
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'];
|
|
33
|
+
export const v3ETHCollAssetsBase = ['cbETH'];
|
|
34
|
+
|
|
35
|
+
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
36
|
+
export const v3ETHCollAssets = {
|
|
37
|
+
[NetworkNumber.Eth]: v3ETHCollAssetsEth,
|
|
38
|
+
[NetworkNumber.Opt]: [],
|
|
39
|
+
[NetworkNumber.Arb]: [],
|
|
40
|
+
[NetworkNumber.Base]: v3ETHCollAssetsBase,
|
|
41
|
+
} as const;
|
|
42
|
+
|
|
43
|
+
export const v3USDbCCollAssetsBase = ['ETH', 'cbETH'];
|
|
44
|
+
|
|
45
|
+
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
46
|
+
export const v3USDbCCollAssets = {
|
|
47
|
+
[NetworkNumber.Eth]: [],
|
|
48
|
+
[NetworkNumber.Opt]: [],
|
|
49
|
+
[NetworkNumber.Arb]: [],
|
|
50
|
+
[NetworkNumber.Base]: v3USDbCCollAssetsBase,
|
|
51
51
|
};
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { getConfigContractAddress } from '../../contracts';
|
|
2
|
-
import { CrvUSDMarketData, CrvUSDVersions } from '../../types';
|
|
3
|
-
import { NetworkNumber } from '../../types/common';
|
|
4
|
-
|
|
5
|
-
export const CRVUSD_WSTETH_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
6
|
-
chainIds: [1],
|
|
7
|
-
label: 'CurveUSD - wstETH',
|
|
8
|
-
shortLabel: 'wstETH',
|
|
9
|
-
value: CrvUSDVersions.crvUSDwstETH,
|
|
10
|
-
collAsset: 'wstETH',
|
|
11
|
-
baseAsset: 'crvUSD',
|
|
12
|
-
controllerAddress: getConfigContractAddress('crvUSDwstETHController', networkId),
|
|
13
|
-
ammAddress: getConfigContractAddress('crvUSDwstETHAmm', networkId),
|
|
14
|
-
createCollAssets: ['wstETH', 'ETH'],
|
|
15
|
-
});
|
|
16
|
-
export const CRVUSD_ETH_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
17
|
-
chainIds: [1],
|
|
18
|
-
label: 'CurveUSD - ETH',
|
|
19
|
-
shortLabel: 'ETH',
|
|
20
|
-
value: CrvUSDVersions.crvUSDETH,
|
|
21
|
-
collAsset: 'ETH',
|
|
22
|
-
baseAsset: 'crvUSD',
|
|
23
|
-
controllerAddress: getConfigContractAddress('crvUSDETHController', networkId),
|
|
24
|
-
ammAddress: getConfigContractAddress('crvUSDETHAmm', networkId),
|
|
25
|
-
createCollAssets: ['ETH'],
|
|
26
|
-
});
|
|
27
|
-
export const CRVUSD_WBTC_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
28
|
-
chainIds: [1],
|
|
29
|
-
label: 'CurveUSD - WBTC',
|
|
30
|
-
shortLabel: 'WBTC',
|
|
31
|
-
value: CrvUSDVersions.crvUSDWBTC,
|
|
32
|
-
collAsset: 'WBTC',
|
|
33
|
-
baseAsset: 'crvUSD',
|
|
34
|
-
controllerAddress: getConfigContractAddress('crvUSDWBTCController', networkId),
|
|
35
|
-
ammAddress: getConfigContractAddress('crvUSDWBTCAmm', networkId),
|
|
36
|
-
createCollAssets: ['WBTC'],
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const CRVUSD_TBTC_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
40
|
-
chainIds: [1],
|
|
41
|
-
label: 'CurveUSD - tBTC',
|
|
42
|
-
shortLabel: 'tBTC',
|
|
43
|
-
value: CrvUSDVersions.crvUSDtBTC,
|
|
44
|
-
collAsset: 'tBTC',
|
|
45
|
-
baseAsset: 'crvUSD',
|
|
46
|
-
controllerAddress: getConfigContractAddress('crvUSDtBTCController', networkId),
|
|
47
|
-
ammAddress: getConfigContractAddress('crvUSDtBTCAmm', networkId),
|
|
48
|
-
createCollAssets: ['tBTC'],
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export const CRVUSD_SFRXETH_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
52
|
-
chainIds: [1],
|
|
53
|
-
label: 'CurveUSD - sfrxETH',
|
|
54
|
-
shortLabel: 'sfrxETH',
|
|
55
|
-
value: CrvUSDVersions.crvUSDsfrxETH,
|
|
56
|
-
collAsset: 'sfrxETH',
|
|
57
|
-
baseAsset: 'crvUSD',
|
|
58
|
-
controllerAddress: getConfigContractAddress('crvUSDsfrxETHController', networkId),
|
|
59
|
-
ammAddress: getConfigContractAddress('crvUSDsfrxETHAmm', networkId),
|
|
60
|
-
createCollAssets: ['sfrxETH'],
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export const CrvUsdMarkets = (networkId: NetworkNumber) => ({
|
|
65
|
-
[CrvUSDVersions.crvUSDwstETH]: CRVUSD_WSTETH_MARKET(networkId),
|
|
66
|
-
[CrvUSDVersions.crvUSDETH]: CRVUSD_ETH_MARKET(networkId),
|
|
67
|
-
[CrvUSDVersions.crvUSDWBTC]: CRVUSD_WBTC_MARKET(networkId),
|
|
68
|
-
[CrvUSDVersions.crvUSDtBTC]: CRVUSD_TBTC_MARKET(networkId),
|
|
69
|
-
[CrvUSDVersions.crvUSDsfrxETH]: CRVUSD_SFRXETH_MARKET(networkId),
|
|
1
|
+
import { getConfigContractAddress } from '../../contracts';
|
|
2
|
+
import { CrvUSDMarketData, CrvUSDVersions } from '../../types';
|
|
3
|
+
import { NetworkNumber } from '../../types/common';
|
|
4
|
+
|
|
5
|
+
export const CRVUSD_WSTETH_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
6
|
+
chainIds: [1],
|
|
7
|
+
label: 'CurveUSD - wstETH',
|
|
8
|
+
shortLabel: 'wstETH',
|
|
9
|
+
value: CrvUSDVersions.crvUSDwstETH,
|
|
10
|
+
collAsset: 'wstETH',
|
|
11
|
+
baseAsset: 'crvUSD',
|
|
12
|
+
controllerAddress: getConfigContractAddress('crvUSDwstETHController', networkId),
|
|
13
|
+
ammAddress: getConfigContractAddress('crvUSDwstETHAmm', networkId),
|
|
14
|
+
createCollAssets: ['wstETH', 'ETH'],
|
|
15
|
+
});
|
|
16
|
+
export const CRVUSD_ETH_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
17
|
+
chainIds: [1],
|
|
18
|
+
label: 'CurveUSD - ETH',
|
|
19
|
+
shortLabel: 'ETH',
|
|
20
|
+
value: CrvUSDVersions.crvUSDETH,
|
|
21
|
+
collAsset: 'ETH',
|
|
22
|
+
baseAsset: 'crvUSD',
|
|
23
|
+
controllerAddress: getConfigContractAddress('crvUSDETHController', networkId),
|
|
24
|
+
ammAddress: getConfigContractAddress('crvUSDETHAmm', networkId),
|
|
25
|
+
createCollAssets: ['ETH'],
|
|
26
|
+
});
|
|
27
|
+
export const CRVUSD_WBTC_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
28
|
+
chainIds: [1],
|
|
29
|
+
label: 'CurveUSD - WBTC',
|
|
30
|
+
shortLabel: 'WBTC',
|
|
31
|
+
value: CrvUSDVersions.crvUSDWBTC,
|
|
32
|
+
collAsset: 'WBTC',
|
|
33
|
+
baseAsset: 'crvUSD',
|
|
34
|
+
controllerAddress: getConfigContractAddress('crvUSDWBTCController', networkId),
|
|
35
|
+
ammAddress: getConfigContractAddress('crvUSDWBTCAmm', networkId),
|
|
36
|
+
createCollAssets: ['WBTC'],
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const CRVUSD_TBTC_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
40
|
+
chainIds: [1],
|
|
41
|
+
label: 'CurveUSD - tBTC',
|
|
42
|
+
shortLabel: 'tBTC',
|
|
43
|
+
value: CrvUSDVersions.crvUSDtBTC,
|
|
44
|
+
collAsset: 'tBTC',
|
|
45
|
+
baseAsset: 'crvUSD',
|
|
46
|
+
controllerAddress: getConfigContractAddress('crvUSDtBTCController', networkId),
|
|
47
|
+
ammAddress: getConfigContractAddress('crvUSDtBTCAmm', networkId),
|
|
48
|
+
createCollAssets: ['tBTC'],
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const CRVUSD_SFRXETH_MARKET = (networkId: NetworkNumber): CrvUSDMarketData => ({
|
|
52
|
+
chainIds: [1],
|
|
53
|
+
label: 'CurveUSD - sfrxETH',
|
|
54
|
+
shortLabel: 'sfrxETH',
|
|
55
|
+
value: CrvUSDVersions.crvUSDsfrxETH,
|
|
56
|
+
collAsset: 'sfrxETH',
|
|
57
|
+
baseAsset: 'crvUSD',
|
|
58
|
+
controllerAddress: getConfigContractAddress('crvUSDsfrxETHController', networkId),
|
|
59
|
+
ammAddress: getConfigContractAddress('crvUSDsfrxETHAmm', networkId),
|
|
60
|
+
createCollAssets: ['sfrxETH'],
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export const CrvUsdMarkets = (networkId: NetworkNumber) => ({
|
|
65
|
+
[CrvUSDVersions.crvUSDwstETH]: CRVUSD_WSTETH_MARKET(networkId),
|
|
66
|
+
[CrvUSDVersions.crvUSDETH]: CRVUSD_ETH_MARKET(networkId),
|
|
67
|
+
[CrvUSDVersions.crvUSDWBTC]: CRVUSD_WBTC_MARKET(networkId),
|
|
68
|
+
[CrvUSDVersions.crvUSDtBTC]: CRVUSD_TBTC_MARKET(networkId),
|
|
69
|
+
[CrvUSDVersions.crvUSDsfrxETH]: CRVUSD_SFRXETH_MARKET(networkId),
|
|
70
70
|
}) as const;
|
package/src/markets/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AaveMarkets } from './aave';
|
|
2
|
-
export { CompoundMarkets } from './compound';
|
|
3
|
-
export { SparkMarkets } from './spark';
|
|
4
|
-
export { CrvUsdMarkets } from './curveUsd';
|
|
5
|
-
export { MorphoBlueMarkets, findMorphoBlueMarket } from './morphoBlue';
|
|
1
|
+
export { AaveMarkets } from './aave';
|
|
2
|
+
export { CompoundMarkets } from './compound';
|
|
3
|
+
export { SparkMarkets } from './spark';
|
|
4
|
+
export { CrvUsdMarkets } from './curveUsd';
|
|
5
|
+
export { MorphoBlueMarkets, findMorphoBlueMarket } from './morphoBlue';
|
|
6
6
|
export { LlamaLendMarkets } from './llamaLend';
|