@defisaver/positions-sdk 2.1.52-aave-v4 → 2.1.52-dev-2
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/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +64 -64
- package/cjs/config/contracts.d.ts +0 -1277
- package/cjs/config/contracts.js +0 -9
- package/cjs/contracts.d.ts +0 -23120
- package/cjs/contracts.js +1 -2
- package/cjs/fluid/index.d.ts +3 -3
- package/cjs/helpers/aaveHelpers/index.d.ts +2 -2
- package/cjs/helpers/aaveHelpers/index.js +18 -2
- package/cjs/helpers/compoundHelpers/index.js +1 -1
- package/cjs/helpers/eulerHelpers/index.d.ts +2 -2
- package/cjs/helpers/eulerHelpers/index.js +6 -5
- package/cjs/helpers/fluidHelpers/index.js +2 -1
- package/cjs/helpers/index.d.ts +0 -1
- package/cjs/helpers/index.js +1 -2
- package/cjs/helpers/morphoBlueHelpers/index.js +67 -67
- package/cjs/helpers/sparkHelpers/index.js +1 -1
- package/cjs/index.d.ts +1 -2
- package/cjs/index.js +1 -3
- package/cjs/markets/index.d.ts +0 -1
- package/cjs/markets/index.js +1 -3
- package/cjs/moneymarket/moneymarketCommonService.d.ts +3 -3
- package/cjs/moneymarket/moneymarketCommonService.js +14 -6
- package/cjs/portfolio/index.js +0 -20
- package/cjs/savings/morphoVaults/index.js +17 -17
- package/cjs/types/aave.d.ts +3 -2
- package/cjs/types/common.d.ts +8 -0
- package/cjs/types/common.js +10 -1
- package/cjs/types/compound.d.ts +2 -2
- package/cjs/types/curveUsd.d.ts +2 -2
- package/cjs/types/euler.d.ts +2 -2
- package/cjs/types/fluid.d.ts +2 -2
- package/cjs/types/index.d.ts +0 -1
- package/cjs/types/index.js +0 -1
- package/cjs/types/liquityV2.d.ts +3 -3
- package/cjs/types/llamaLend.d.ts +2 -2
- package/cjs/types/morphoBlue.d.ts +3 -3
- package/cjs/types/portfolio.d.ts +0 -4
- package/cjs/types/spark.d.ts +2 -2
- package/esm/config/contracts.d.ts +0 -1277
- package/esm/config/contracts.js +0 -8
- package/esm/contracts.d.ts +0 -23120
- package/esm/contracts.js +0 -1
- package/esm/fluid/index.d.ts +3 -3
- package/esm/helpers/aaveHelpers/index.d.ts +2 -2
- package/esm/helpers/aaveHelpers/index.js +18 -2
- package/esm/helpers/compoundHelpers/index.js +2 -2
- package/esm/helpers/eulerHelpers/index.d.ts +2 -2
- package/esm/helpers/eulerHelpers/index.js +6 -5
- package/esm/helpers/fluidHelpers/index.js +2 -1
- package/esm/helpers/index.d.ts +0 -1
- package/esm/helpers/index.js +0 -1
- package/esm/helpers/morphoBlueHelpers/index.js +68 -68
- package/esm/helpers/sparkHelpers/index.js +2 -2
- package/esm/index.d.ts +1 -2
- package/esm/index.js +1 -2
- package/esm/markets/index.d.ts +0 -1
- package/esm/markets/index.js +0 -1
- package/esm/moneymarket/moneymarketCommonService.d.ts +3 -3
- package/esm/moneymarket/moneymarketCommonService.js +14 -6
- package/esm/portfolio/index.js +1 -21
- package/esm/savings/morphoVaults/index.js +17 -17
- package/esm/types/aave.d.ts +3 -2
- package/esm/types/common.d.ts +8 -0
- package/esm/types/common.js +9 -0
- package/esm/types/compound.d.ts +2 -2
- package/esm/types/curveUsd.d.ts +2 -2
- package/esm/types/euler.d.ts +2 -2
- package/esm/types/fluid.d.ts +2 -2
- package/esm/types/fluid.js +1 -1
- package/esm/types/index.d.ts +0 -1
- package/esm/types/index.js +0 -1
- package/esm/types/liquityV2.d.ts +3 -3
- package/esm/types/llamaLend.d.ts +2 -2
- package/esm/types/morphoBlue.d.ts +3 -3
- package/esm/types/portfolio.d.ts +0 -4
- package/esm/types/spark.d.ts +2 -2
- package/package.json +48 -48
- package/src/aaveV2/index.ts +240 -240
- package/src/aaveV3/index.ts +635 -635
- package/src/aaveV3/merit.ts +97 -97
- package/src/aaveV3/merkl.ts +74 -74
- package/src/claiming/aaveV3.ts +154 -154
- package/src/claiming/compV3.ts +22 -22
- package/src/claiming/ethena.ts +61 -61
- package/src/claiming/index.ts +12 -12
- package/src/claiming/king.ts +66 -66
- package/src/claiming/morphoBlue.ts +118 -118
- package/src/claiming/spark.ts +225 -225
- package/src/compoundV2/index.ts +244 -244
- package/src/compoundV3/index.ts +274 -274
- package/src/config/contracts.ts +1320 -1328
- package/src/constants/index.ts +10 -10
- package/src/contracts.ts +172 -174
- package/src/curveUsd/index.ts +254 -254
- package/src/eulerV2/index.ts +324 -324
- package/src/exchange/index.ts +25 -25
- package/src/fluid/index.ts +1800 -1800
- package/src/helpers/aaveHelpers/index.ts +207 -191
- package/src/helpers/compoundHelpers/index.ts +283 -283
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +222 -222
- package/src/helpers/fluidHelpers/index.ts +326 -326
- package/src/helpers/index.ts +10 -11
- package/src/helpers/liquityV2Helpers/index.ts +82 -82
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +52 -52
- package/src/helpers/morphoBlueHelpers/index.ts +396 -396
- package/src/helpers/sparkHelpers/index.ts +160 -158
- package/src/index.ts +49 -51
- package/src/liquity/index.ts +159 -159
- package/src/liquityV2/index.ts +703 -703
- package/src/llamaLend/index.ts +305 -305
- package/src/maker/index.ts +223 -223
- package/src/markets/aave/index.ts +118 -118
- package/src/markets/aave/marketAssets.ts +54 -54
- package/src/markets/compound/index.ts +243 -243
- package/src/markets/compound/marketsAssets.ts +97 -97
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2900 -2900
- package/src/markets/index.ts +25 -26
- package/src/markets/liquityV2/index.ts +102 -102
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +988 -988
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +12 -12
- package/src/moneymarket/moneymarketCommonService.ts +92 -85
- package/src/morphoBlue/index.ts +274 -274
- package/src/portfolio/index.ts +586 -606
- package/src/savings/index.ts +95 -95
- package/src/savings/makerDsr/index.ts +53 -53
- package/src/savings/makerDsr/options.ts +9 -9
- package/src/savings/morphoVaults/index.ts +80 -80
- package/src/savings/morphoVaults/options.ts +193 -193
- package/src/savings/skyOptions/index.ts +95 -95
- package/src/savings/skyOptions/options.ts +10 -10
- package/src/savings/sparkSavingsVaults/index.ts +60 -60
- package/src/savings/sparkSavingsVaults/options.ts +35 -35
- package/src/savings/yearnV3Vaults/index.ts +61 -61
- package/src/savings/yearnV3Vaults/options.ts +55 -55
- package/src/savings/yearnVaults/index.ts +73 -73
- package/src/savings/yearnVaults/options.ts +32 -32
- package/src/services/priceService.ts +278 -278
- package/src/services/utils.ts +115 -115
- package/src/services/viem.ts +57 -57
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +459 -459
- package/src/staking/eligibility.ts +53 -53
- package/src/staking/index.ts +1 -1
- package/src/staking/staking.ts +192 -192
- package/src/types/aave.ts +200 -198
- package/src/types/claiming.ts +114 -114
- package/src/types/common.ts +116 -107
- package/src/types/compound.ts +145 -144
- package/src/types/curveUsd.ts +123 -123
- package/src/types/euler.ts +176 -175
- package/src/types/fluid.ts +485 -483
- package/src/types/index.ts +15 -16
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +128 -126
- package/src/types/llamaLend.ts +161 -159
- package/src/types/maker.ts +63 -63
- package/src/types/merit.ts +1 -1
- package/src/types/merkl.ts +70 -70
- package/src/types/morphoBlue.ts +202 -202
- package/src/types/portfolio.ts +60 -64
- package/src/types/savings/index.ts +23 -23
- package/src/types/savings/makerDsr.ts +13 -13
- package/src/types/savings/morphoVaults.ts +32 -32
- package/src/types/savings/sky.ts +14 -14
- package/src/types/savings/sparkSavingsVaults.ts +15 -15
- package/src/types/savings/yearnV3Vaults.ts +17 -17
- package/src/types/savings/yearnVaults.ts +14 -14
- package/src/types/spark.ts +135 -134
- package/src/umbrella/index.ts +69 -69
- package/src/umbrella/umbrellaUtils.ts +29 -29
- package/cjs/aaveV4/index.d.ts +0 -7
- package/cjs/aaveV4/index.js +0 -174
- package/cjs/helpers/aaveV4Helpers/index.d.ts +0 -13
- package/cjs/helpers/aaveV4Helpers/index.js +0 -109
- package/cjs/markets/aaveV4/index.d.ts +0 -13
- package/cjs/markets/aaveV4/index.js +0 -39
- package/cjs/types/aaveV4.d.ts +0 -137
- package/cjs/types/aaveV4.js +0 -11
- package/esm/aaveV4/index.d.ts +0 -7
- package/esm/aaveV4/index.js +0 -165
- package/esm/helpers/aaveV4Helpers/index.d.ts +0 -13
- package/esm/helpers/aaveV4Helpers/index.js +0 -100
- package/esm/markets/aaveV4/index.d.ts +0 -13
- package/esm/markets/aaveV4/index.js +0 -29
- package/esm/types/aaveV4.d.ts +0 -137
- package/esm/types/aaveV4.js +0 -8
- package/src/aaveV4/index.ts +0 -176
- package/src/helpers/aaveV4Helpers/index.ts +0 -121
- package/src/markets/aaveV4/index.ts +0 -42
- package/src/types/aaveV4.ts +0 -151
package/src/types/common.ts
CHANGED
|
@@ -1,107 +1,116 @@
|
|
|
1
|
-
export enum IncentiveKind {
|
|
2
|
-
Staking = 'staking',
|
|
3
|
-
Reward = 'reward',
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export enum IncentiveEligibilityId {
|
|
7
|
-
AaveV3EthenaLiquidLeverage = '0x8014e0076e5393e62c49a7134070d8fccc922e46BORROW_BL',
|
|
8
|
-
AaveV3ArbitrumEthSupply = '0x5d16261c6715a653248269861bbacf68a9774cde',
|
|
9
|
-
AaveV3ArbitrumETHLSBorrow = '0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351',
|
|
10
|
-
AaveV3EthenaLiquidLeveragePlasma = '0x67264783f1e9a2af8627a235853057a6fc975bd2BORROW_BL',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
export
|
|
1
|
+
export enum IncentiveKind {
|
|
2
|
+
Staking = 'staking',
|
|
3
|
+
Reward = 'reward',
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export enum IncentiveEligibilityId {
|
|
7
|
+
AaveV3EthenaLiquidLeverage = '0x8014e0076e5393e62c49a7134070d8fccc922e46BORROW_BL',
|
|
8
|
+
AaveV3ArbitrumEthSupply = '0x5d16261c6715a653248269861bbacf68a9774cde',
|
|
9
|
+
AaveV3ArbitrumETHLSBorrow = '0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351',
|
|
10
|
+
AaveV3EthenaLiquidLeveragePlasma = '0x67264783f1e9a2af8627a235853057a6fc975bd2BORROW_BL',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export enum LeverageType {
|
|
14
|
+
Long = 'long',
|
|
15
|
+
Short = 'short',
|
|
16
|
+
LsdLeverage = 'lsd-leverage',
|
|
17
|
+
VolatilePair = 'volatile-pair',
|
|
18
|
+
VolatilePairReverse = 'volatile-pair-reverse',
|
|
19
|
+
None = '',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IncentiveData {
|
|
23
|
+
token: string,
|
|
24
|
+
apy: string,
|
|
25
|
+
incentiveKind?: IncentiveKind;
|
|
26
|
+
description?: string;
|
|
27
|
+
eligibilityId?: IncentiveEligibilityId;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// General
|
|
31
|
+
export type EthAddress = HexString;
|
|
32
|
+
export type Blockish = number | 'latest';
|
|
33
|
+
export type AssetSymbol = string;
|
|
34
|
+
export type Amount = string | number;
|
|
35
|
+
|
|
36
|
+
export enum NetworkNumber {
|
|
37
|
+
Eth = 1,
|
|
38
|
+
Opt = 10,
|
|
39
|
+
Arb = 42161,
|
|
40
|
+
Base = 8453,
|
|
41
|
+
Linea = 59144,
|
|
42
|
+
Plasma = 9745,
|
|
43
|
+
}
|
|
44
|
+
export type Networkish = string | NetworkNumber;
|
|
45
|
+
|
|
46
|
+
// Common
|
|
47
|
+
export interface MMAssetData {
|
|
48
|
+
symbol: string,
|
|
49
|
+
supplyRate: string,
|
|
50
|
+
borrowRate: string,
|
|
51
|
+
price: string,
|
|
52
|
+
collateralFactor: string,
|
|
53
|
+
underlyingTokenAddress: string,
|
|
54
|
+
marketLiquidity: string,
|
|
55
|
+
utilization: string,
|
|
56
|
+
borrowCap: string,
|
|
57
|
+
totalSupply: string,
|
|
58
|
+
canBeBorrowed: boolean,
|
|
59
|
+
canBeSupplied: boolean,
|
|
60
|
+
totalBorrow: string,
|
|
61
|
+
borrowRateP2P?: string,
|
|
62
|
+
supplyRateP2P?: string,
|
|
63
|
+
supplyIncentives: IncentiveData[];
|
|
64
|
+
borrowIncentives: IncentiveData[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface MMAssetsData {
|
|
68
|
+
[token: string]: MMAssetData,
|
|
69
|
+
}
|
|
70
|
+
export interface MMMarketData {
|
|
71
|
+
assetsData: MMAssetData[],
|
|
72
|
+
}
|
|
73
|
+
export interface MMUsedAsset {
|
|
74
|
+
symbol: string,
|
|
75
|
+
supplied: string,
|
|
76
|
+
suppliedUsd: string,
|
|
77
|
+
isSupplied: boolean,
|
|
78
|
+
borrowed: string,
|
|
79
|
+
borrowedUsd: string,
|
|
80
|
+
isBorrowed: boolean,
|
|
81
|
+
stableBorrowRate?: string,
|
|
82
|
+
debt?: string,
|
|
83
|
+
supplyRate?: string,
|
|
84
|
+
borrowRate?: string,
|
|
85
|
+
interestMode?: string,
|
|
86
|
+
collateral?: boolean,
|
|
87
|
+
}
|
|
88
|
+
export interface MMUsedAssets {
|
|
89
|
+
[token: string]: MMUsedAsset,
|
|
90
|
+
}
|
|
91
|
+
export interface MMUsedAssetWStableB extends MMUsedAsset {
|
|
92
|
+
stableBorrowRate: string,
|
|
93
|
+
borrowedStable: string,
|
|
94
|
+
borrowedVariable: string,
|
|
95
|
+
borrowedUsdStable: string,
|
|
96
|
+
borrowedUsdVariable: string,
|
|
97
|
+
interestMode: string,
|
|
98
|
+
}
|
|
99
|
+
export interface MMPositionData {
|
|
100
|
+
usedAssets: any,
|
|
101
|
+
netApy: string,
|
|
102
|
+
lastUpdated: number,
|
|
103
|
+
// ...
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type Balances = Record<AssetSymbol, Amount>;
|
|
107
|
+
export interface PositionBalances {
|
|
108
|
+
collateral?: Balances,
|
|
109
|
+
debt?: Balances,
|
|
110
|
+
selling?: Balances,
|
|
111
|
+
deposited?: Balances,
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type EthereumProvider = { request(...args: any): Promise<any> }; // TODO
|
|
115
|
+
|
|
116
|
+
export type HexString = `0x${string}`;
|
package/src/types/compound.ts
CHANGED
|
@@ -1,145 +1,146 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EthAddress,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export type
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
export type
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
export type
|
|
90
|
-
export type
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
1
|
+
import {
|
|
2
|
+
EthAddress,
|
|
3
|
+
LeverageType,
|
|
4
|
+
MMAssetData,
|
|
5
|
+
MMPositionData,
|
|
6
|
+
MMUsedAsset,
|
|
7
|
+
NetworkNumber,
|
|
8
|
+
} from './common';
|
|
9
|
+
|
|
10
|
+
export enum CompoundVersions {
|
|
11
|
+
'CompoundV2' = 'v2',
|
|
12
|
+
'CompoundV3USDC' = 'v3-USDC',
|
|
13
|
+
'CompoundV3USDCe' = 'v3-USDC.e',
|
|
14
|
+
'CompoundV3ETH' = 'v3-ETH',
|
|
15
|
+
'CompoundV3USDbC' = 'v3-USDbC',
|
|
16
|
+
'CompoundV3USDT' = 'v3-USDT',
|
|
17
|
+
'CompoundV3USDS' = 'v3-USDS',
|
|
18
|
+
'CompoundV3wstETH' = 'v3-wstETH',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum CompoundVersionType {
|
|
22
|
+
V2 = 'v2',
|
|
23
|
+
V3 = 'v3',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CompoundBulkerOptions {
|
|
27
|
+
supply: number | string,
|
|
28
|
+
withdraw: number | string,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CompoundMarketData {
|
|
32
|
+
chainIds: NetworkNumber[],
|
|
33
|
+
label: string,
|
|
34
|
+
shortLabel: string,
|
|
35
|
+
value: CompoundVersions,
|
|
36
|
+
baseAsset: string,
|
|
37
|
+
collAssets: readonly string[],
|
|
38
|
+
baseMarket: string,
|
|
39
|
+
baseMarketAddress: EthAddress,
|
|
40
|
+
secondLabel: string,
|
|
41
|
+
bulkerName: string,
|
|
42
|
+
bulkerAddress: EthAddress,
|
|
43
|
+
bulkerOptions: CompoundBulkerOptions,
|
|
44
|
+
// icon: Function,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface CompoundUsedAsset extends MMUsedAsset {
|
|
48
|
+
collateral: boolean,
|
|
49
|
+
limit?: string,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CompoundV2UsedAsset extends CompoundUsedAsset {
|
|
53
|
+
}
|
|
54
|
+
export interface CompoundV3UsedAsset extends CompoundUsedAsset {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface CompoundUsedAssets<T> {
|
|
58
|
+
[token: string]: T,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type CompoundV2UsedAssets = CompoundUsedAssets<CompoundV2UsedAsset>;
|
|
62
|
+
export type CompoundV3UsedAssets = CompoundUsedAssets<CompoundV3UsedAsset>;
|
|
63
|
+
|
|
64
|
+
export interface CompoundAssetData extends MMAssetData {
|
|
65
|
+
supplyCapAlternative?: string,
|
|
66
|
+
totalSupplyAlternative?: string,
|
|
67
|
+
sortIndex?: number,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface CompoundV2AssetData extends CompoundAssetData {
|
|
71
|
+
}
|
|
72
|
+
export interface CompoundV3AssetData extends CompoundAssetData {
|
|
73
|
+
borrowCollateralFactor: string,
|
|
74
|
+
liquidateCollateralFactor: string,
|
|
75
|
+
liquidationFactor: string,
|
|
76
|
+
minDebt: string,
|
|
77
|
+
supplyReserved: string,
|
|
78
|
+
liquidationRatio: string,
|
|
79
|
+
supplyCap: string,
|
|
80
|
+
priceInBaseAsset: string,
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface CompoundAssetsData<T> {
|
|
84
|
+
[token: string]: T
|
|
85
|
+
}
|
|
86
|
+
export type CompoundV2AssetsData = CompoundAssetsData<CompoundV2AssetData>;
|
|
87
|
+
export type CompoundV3AssetsData = CompoundAssetsData<CompoundV3AssetData>;
|
|
88
|
+
|
|
89
|
+
export type CompoundMarketsData<T> = { assetsData: T };
|
|
90
|
+
export type CompoundV2MarketsData = CompoundMarketsData<CompoundV2AssetsData>;
|
|
91
|
+
export type CompoundV3MarketsData = CompoundMarketsData<CompoundV3AssetsData>;
|
|
92
|
+
|
|
93
|
+
export interface BaseAdditionalAssetData {
|
|
94
|
+
totalBorrow: string,
|
|
95
|
+
utilization: string,
|
|
96
|
+
marketLiquidity: string,
|
|
97
|
+
rewardSupplySpeed: string,
|
|
98
|
+
rewardBorrowSpeed: string,
|
|
99
|
+
minDebt: string,
|
|
100
|
+
isBase: boolean,
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface CompoundAggregatedPositionData {
|
|
104
|
+
suppliedUsd: string,
|
|
105
|
+
suppliedCollateralUsd: string,
|
|
106
|
+
borrowedUsd: string,
|
|
107
|
+
borrowLimitUsd: string,
|
|
108
|
+
liquidationLimitUsd: string,
|
|
109
|
+
leftToBorrowUsd: string,
|
|
110
|
+
ratio: string,
|
|
111
|
+
collRatio: string,
|
|
112
|
+
netApy: string,
|
|
113
|
+
incentiveUsd: string,
|
|
114
|
+
totalInterestUsd: string,
|
|
115
|
+
liqRatio: string,
|
|
116
|
+
liqPercent: string,
|
|
117
|
+
leveragedType: LeverageType,
|
|
118
|
+
leveragedAsset?: string,
|
|
119
|
+
leveragedLsdAssetRatio?: string,
|
|
120
|
+
liquidationPrice?: string,
|
|
121
|
+
minRatio: string,
|
|
122
|
+
debtTooLow: boolean,
|
|
123
|
+
minDebt: string,
|
|
124
|
+
minCollRatio: string,
|
|
125
|
+
collLiquidationRatio: string,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface CompoundPositionData extends MMPositionData {
|
|
129
|
+
ratio: string,
|
|
130
|
+
minRatio: string,
|
|
131
|
+
suppliedUsd: string,
|
|
132
|
+
borrowedUsd: string,
|
|
133
|
+
borrowLimitUsd: string,
|
|
134
|
+
incentiveUsd: string,
|
|
135
|
+
totalInterestUsd: string,
|
|
136
|
+
isSubscribedToAutomation?: boolean,
|
|
137
|
+
automationResubscribeRequired?: boolean,
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface CompoundV2PositionData extends CompoundPositionData {
|
|
141
|
+
usedAssets: CompoundV2UsedAssets,
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface CompoundV3PositionData extends CompoundPositionData {
|
|
145
|
+
usedAssets: CompoundV3UsedAssets,
|
|
145
146
|
}
|