@defisaver/positions-sdk 0.0.98 → 0.0.100
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/config/contracts.d.ts +361 -15
- package/cjs/config/contracts.js +37 -15
- package/cjs/helpers/morphoBlueHelpers/index.d.ts +9 -2
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -1
- package/cjs/maker/index.js +1 -1
- package/cjs/morphoBlue/index.js +4 -27
- package/cjs/types/contracts/generated/AaveV3View.d.ts +29 -2
- package/cjs/types/contracts/generated/MorphoBlueView.d.ts +61 -0
- package/cjs/types/contracts/generated/SparkView.d.ts +29 -2
- package/esm/config/contracts.d.ts +361 -15
- package/esm/config/contracts.js +37 -15
- package/esm/helpers/morphoBlueHelpers/index.d.ts +9 -2
- package/esm/helpers/morphoBlueHelpers/index.js +62 -0
- package/esm/maker/index.js +1 -1
- package/esm/morphoBlue/index.js +4 -27
- package/esm/types/contracts/generated/AaveV3View.d.ts +29 -2
- package/esm/types/contracts/generated/MorphoBlueView.d.ts +61 -0
- package/esm/types/contracts/generated/SparkView.d.ts +29 -2
- package/package.json +41 -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 -266
- package/src/config/contracts.js +871 -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 +117 -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 +24 -24
- 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 +611 -611
- 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 -612
- package/src/morphoBlue/index.ts +171 -199
- 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 -424
- package/src/staking/staking.ts +187 -187
- 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/contracts/generated/AaveV3View.ts +43 -3
- package/src/types/contracts/generated/MorphoBlueView.ts +87 -0
- package/src/types/contracts/generated/SparkView.ts +43 -3
- 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 +139 -139
- package/src/types/spark.ts +106 -106
package/src/types/maker.ts
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { EthAddress } from './common';
|
|
2
|
-
|
|
3
|
-
export interface IlkInfo {
|
|
4
|
-
ilkLabel: string;
|
|
5
|
-
currentRate: string;
|
|
6
|
-
futureRate: string;
|
|
7
|
-
minDebt: string;
|
|
8
|
-
globalDebtCeiling: string;
|
|
9
|
-
globalDebtCurrent: string;
|
|
10
|
-
assetPrice: string;
|
|
11
|
-
liqRatio: string;
|
|
12
|
-
liqPercent: number;
|
|
13
|
-
stabilityFee: number;
|
|
14
|
-
liquidationFee: string;
|
|
15
|
-
creatableDebt: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface CdpData {
|
|
19
|
-
owner: EthAddress,
|
|
20
|
-
userAddress: EthAddress,
|
|
21
|
-
id: string,
|
|
22
|
-
urn: EthAddress,
|
|
23
|
-
type: string,
|
|
24
|
-
ilk: string,
|
|
25
|
-
ilkLabel: string,
|
|
26
|
-
asset: string,
|
|
27
|
-
collateral: string,
|
|
28
|
-
collateralUsd: string,
|
|
29
|
-
futureDebt: string,
|
|
30
|
-
debtDai: string,
|
|
31
|
-
debtUsd: string,
|
|
32
|
-
debtInAsset: string,
|
|
33
|
-
debtAssetPrice: string,
|
|
34
|
-
debtAssetMarketPrice: string,
|
|
35
|
-
liquidationPrice: string,
|
|
36
|
-
ratio: string,
|
|
37
|
-
liqRatio: string,
|
|
38
|
-
liqPercent: number,
|
|
39
|
-
assetPrice: string,
|
|
40
|
-
daiLabel: string,
|
|
41
|
-
debtAsset: string,
|
|
42
|
-
unclaimedCollateral: string,
|
|
43
|
-
debtTooLow: boolean,
|
|
44
|
-
minDebt: string,
|
|
45
|
-
stabilityFee: number,
|
|
46
|
-
creatableDebt: string,
|
|
47
|
-
globalDebtCeiling: string,
|
|
48
|
-
globalDebtCurrent: string,
|
|
49
|
-
liquidationFee: string,
|
|
50
|
-
lastUpdated: number,
|
|
1
|
+
import { EthAddress } from './common';
|
|
2
|
+
|
|
3
|
+
export interface IlkInfo {
|
|
4
|
+
ilkLabel: string;
|
|
5
|
+
currentRate: string;
|
|
6
|
+
futureRate: string;
|
|
7
|
+
minDebt: string;
|
|
8
|
+
globalDebtCeiling: string;
|
|
9
|
+
globalDebtCurrent: string;
|
|
10
|
+
assetPrice: string;
|
|
11
|
+
liqRatio: string;
|
|
12
|
+
liqPercent: number;
|
|
13
|
+
stabilityFee: number;
|
|
14
|
+
liquidationFee: string;
|
|
15
|
+
creatableDebt: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CdpData {
|
|
19
|
+
owner: EthAddress,
|
|
20
|
+
userAddress: EthAddress,
|
|
21
|
+
id: string,
|
|
22
|
+
urn: EthAddress,
|
|
23
|
+
type: string,
|
|
24
|
+
ilk: string,
|
|
25
|
+
ilkLabel: string,
|
|
26
|
+
asset: string,
|
|
27
|
+
collateral: string,
|
|
28
|
+
collateralUsd: string,
|
|
29
|
+
futureDebt: string,
|
|
30
|
+
debtDai: string,
|
|
31
|
+
debtUsd: string,
|
|
32
|
+
debtInAsset: string,
|
|
33
|
+
debtAssetPrice: string,
|
|
34
|
+
debtAssetMarketPrice: string,
|
|
35
|
+
liquidationPrice: string,
|
|
36
|
+
ratio: string,
|
|
37
|
+
liqRatio: string,
|
|
38
|
+
liqPercent: number,
|
|
39
|
+
assetPrice: string,
|
|
40
|
+
daiLabel: string,
|
|
41
|
+
debtAsset: string,
|
|
42
|
+
unclaimedCollateral: string,
|
|
43
|
+
debtTooLow: boolean,
|
|
44
|
+
minDebt: string,
|
|
45
|
+
stabilityFee: number,
|
|
46
|
+
creatableDebt: string,
|
|
47
|
+
globalDebtCeiling: string,
|
|
48
|
+
globalDebtCurrent: string,
|
|
49
|
+
liquidationFee: string,
|
|
50
|
+
lastUpdated: number,
|
|
51
51
|
}
|
package/src/types/morphoBlue.ts
CHANGED
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
import { MMUsedAssets, NetworkNumber } from './common';
|
|
2
|
-
|
|
3
|
-
export enum MorphoBlueVersions {
|
|
4
|
-
// MAINNET
|
|
5
|
-
MorphoBlueWstEthUSDC = 'morphobluewstethusdc', // wstETH/USDC
|
|
6
|
-
MorphoBlueSDAIUSDC = 'morphobluesdaiusdc', // sDAI/USDC
|
|
7
|
-
MorphoBlueWBTCUSDC = 'morphobluewbtcusdc', // WBTC/USDC
|
|
8
|
-
MorphoBlueEthUSDC = 'morphoblueethusdc', // ETH/USDC
|
|
9
|
-
MorphoBlueWBTCUSDT = 'morphobluewbtcusdt', // WBTC/USDT
|
|
10
|
-
MorphoBlueWstEthUSDT = 'morphobluewstethusdt', // wstETH/USDT
|
|
11
|
-
MorphoBlueWstEthUSDA_Exchange_Rate = 'morphobluewstethusda_exchange_rate', // wstETH/USDA
|
|
12
|
-
MorphoBlueWstEthPYUSD = 'morphobluwstethpyusd', // wstETH/PYUSD
|
|
13
|
-
MorphoBlueWeEthEth = 'morphoblueweetheth', // weETH/ETH
|
|
14
|
-
MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
|
|
15
|
-
MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
|
|
16
|
-
MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
|
|
17
|
-
MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
|
|
18
|
-
MorphoBlueSDAIEth = 'morphobluesdaieth', // sDAI/ETH
|
|
19
|
-
MorphoBlueEzEthEth = 'morphoblueezetheth', // ezETH/ETH
|
|
20
|
-
MorphoBlueMKRUSDC = 'morphobluemkrusdc', // MKR/USDC
|
|
21
|
-
// wstETH/WETH
|
|
22
|
-
MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
|
|
23
|
-
MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
|
|
24
|
-
MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
|
|
25
|
-
// sUSDe/DAI
|
|
26
|
-
MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
|
|
27
|
-
MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
|
|
28
|
-
MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
|
|
29
|
-
MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
|
|
30
|
-
// USDe/DAI
|
|
31
|
-
MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
|
|
32
|
-
MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
|
|
33
|
-
MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
|
|
34
|
-
MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
|
|
35
|
-
|
|
36
|
-
// BASE
|
|
37
|
-
MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
|
|
38
|
-
MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
|
|
39
|
-
MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
|
|
40
|
-
MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
|
|
41
|
-
MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
|
|
42
|
-
MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
|
|
43
|
-
MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
|
|
44
|
-
MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
|
|
45
|
-
MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export enum MorphoBlueOracleType {
|
|
49
|
-
MARKET_RATE = 'Market rate',
|
|
50
|
-
LIDO_RATE = 'Lido rate',
|
|
51
|
-
ETHENA_RATE = 'Ethena rate',
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface MorphoBlueMarketData {
|
|
55
|
-
chainIds: NetworkNumber[],
|
|
56
|
-
label: string,
|
|
57
|
-
shortLabel: string,
|
|
58
|
-
url: string,
|
|
59
|
-
value: MorphoBlueVersions,
|
|
60
|
-
loanToken: string,
|
|
61
|
-
collateralToken: string,
|
|
62
|
-
oracle: string,
|
|
63
|
-
oracleType: MorphoBlueOracleType,
|
|
64
|
-
irm: string,
|
|
65
|
-
lltv: number | string,
|
|
66
|
-
marketId: string,
|
|
67
|
-
// icon: Function,
|
|
68
|
-
protocolName: string,
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface MorphoBlueAssetData {
|
|
72
|
-
symbol: string,
|
|
73
|
-
address: string,
|
|
74
|
-
price: string,
|
|
75
|
-
supplyRate: string,
|
|
76
|
-
borrowRate: string,
|
|
77
|
-
incentiveSupplyApy?: string,
|
|
78
|
-
incentiveSupplyToken?: string,
|
|
79
|
-
totalSupply?: string,
|
|
80
|
-
totalBorrow?: string,
|
|
81
|
-
canBeSupplied?: boolean,
|
|
82
|
-
canBeBorrowed?: boolean,
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
|
|
86
|
-
|
|
87
|
-
export interface MorphoBlueMarketInfo {
|
|
88
|
-
id: string,
|
|
89
|
-
fee: string,
|
|
90
|
-
loanToken: string,
|
|
91
|
-
collateralToken: string,
|
|
92
|
-
utillization: string,
|
|
93
|
-
oracle: string,
|
|
94
|
-
oracleType: MorphoBlueOracleType,
|
|
95
|
-
lltv: string,
|
|
96
|
-
minRatio: string,
|
|
97
|
-
assetsData: MorphoBlueAssetsData,
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface MorphoBlueAggregatedPositionData {
|
|
101
|
-
suppliedUsd: string,
|
|
102
|
-
suppliedCollateralUsd: string,
|
|
103
|
-
borrowedUsd: string,
|
|
104
|
-
borrowLimitUsd: string,
|
|
105
|
-
liquidationLimitUsd: string,
|
|
106
|
-
leftToBorrowUsd: string,
|
|
107
|
-
leftToBorrow: string,
|
|
108
|
-
netApy: string,
|
|
109
|
-
incentiveUsd: string,
|
|
110
|
-
totalInterestUsd: string,
|
|
111
|
-
ltv: string,
|
|
112
|
-
ratio: string,
|
|
113
|
-
leveragedType: string,
|
|
114
|
-
leveragedAsset?: string,
|
|
115
|
-
leveragedLsdAssetRatio?: string,
|
|
116
|
-
liquidationPrice?: string,
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface MorphoBluePositionData {
|
|
120
|
-
usedAssets: MMUsedAssets,
|
|
121
|
-
suppliedUsd: string,
|
|
122
|
-
suppliedCollateralUsd: string,
|
|
123
|
-
borrowedUsd: string,
|
|
124
|
-
borrowLimitUsd: string,
|
|
125
|
-
liquidationLimitUsd: string,
|
|
126
|
-
leftToBorrowUsd: string,
|
|
127
|
-
leftToBorrow: string,
|
|
128
|
-
netApy: string,
|
|
129
|
-
incentiveUsd: string,
|
|
130
|
-
totalInterestUsd: string,
|
|
131
|
-
ltv: string,
|
|
132
|
-
ratio: string,
|
|
133
|
-
leveragedType: string,
|
|
134
|
-
leveragedAsset?: string,
|
|
135
|
-
leveragedLsdAssetRatio?: string,
|
|
136
|
-
liquidationPrice?: string,
|
|
137
|
-
supplyShares: string,
|
|
138
|
-
borrowShares: string,
|
|
139
|
-
}
|
|
1
|
+
import { MMUsedAssets, NetworkNumber } from './common';
|
|
2
|
+
|
|
3
|
+
export enum MorphoBlueVersions {
|
|
4
|
+
// MAINNET
|
|
5
|
+
MorphoBlueWstEthUSDC = 'morphobluewstethusdc', // wstETH/USDC
|
|
6
|
+
MorphoBlueSDAIUSDC = 'morphobluesdaiusdc', // sDAI/USDC
|
|
7
|
+
MorphoBlueWBTCUSDC = 'morphobluewbtcusdc', // WBTC/USDC
|
|
8
|
+
MorphoBlueEthUSDC = 'morphoblueethusdc', // ETH/USDC
|
|
9
|
+
MorphoBlueWBTCUSDT = 'morphobluewbtcusdt', // WBTC/USDT
|
|
10
|
+
MorphoBlueWstEthUSDT = 'morphobluewstethusdt', // wstETH/USDT
|
|
11
|
+
MorphoBlueWstEthUSDA_Exchange_Rate = 'morphobluewstethusda_exchange_rate', // wstETH/USDA
|
|
12
|
+
MorphoBlueWstEthPYUSD = 'morphobluwstethpyusd', // wstETH/PYUSD
|
|
13
|
+
MorphoBlueWeEthEth = 'morphoblueweetheth', // weETH/ETH
|
|
14
|
+
MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
|
|
15
|
+
MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
|
|
16
|
+
MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
|
|
17
|
+
MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
|
|
18
|
+
MorphoBlueSDAIEth = 'morphobluesdaieth', // sDAI/ETH
|
|
19
|
+
MorphoBlueEzEthEth = 'morphoblueezetheth', // ezETH/ETH
|
|
20
|
+
MorphoBlueMKRUSDC = 'morphobluemkrusdc', // MKR/USDC
|
|
21
|
+
// wstETH/WETH
|
|
22
|
+
MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
|
|
23
|
+
MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
|
|
24
|
+
MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
|
|
25
|
+
// sUSDe/DAI
|
|
26
|
+
MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
|
|
27
|
+
MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
|
|
28
|
+
MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
|
|
29
|
+
MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
|
|
30
|
+
// USDe/DAI
|
|
31
|
+
MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
|
|
32
|
+
MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
|
|
33
|
+
MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
|
|
34
|
+
MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
|
|
35
|
+
|
|
36
|
+
// BASE
|
|
37
|
+
MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
|
|
38
|
+
MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
|
|
39
|
+
MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
|
|
40
|
+
MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
|
|
41
|
+
MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
|
|
42
|
+
MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
|
|
43
|
+
MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
|
|
44
|
+
MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
|
|
45
|
+
MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export enum MorphoBlueOracleType {
|
|
49
|
+
MARKET_RATE = 'Market rate',
|
|
50
|
+
LIDO_RATE = 'Lido rate',
|
|
51
|
+
ETHENA_RATE = 'Ethena rate',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface MorphoBlueMarketData {
|
|
55
|
+
chainIds: NetworkNumber[],
|
|
56
|
+
label: string,
|
|
57
|
+
shortLabel: string,
|
|
58
|
+
url: string,
|
|
59
|
+
value: MorphoBlueVersions,
|
|
60
|
+
loanToken: string,
|
|
61
|
+
collateralToken: string,
|
|
62
|
+
oracle: string,
|
|
63
|
+
oracleType: MorphoBlueOracleType,
|
|
64
|
+
irm: string,
|
|
65
|
+
lltv: number | string,
|
|
66
|
+
marketId: string,
|
|
67
|
+
// icon: Function,
|
|
68
|
+
protocolName: string,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface MorphoBlueAssetData {
|
|
72
|
+
symbol: string,
|
|
73
|
+
address: string,
|
|
74
|
+
price: string,
|
|
75
|
+
supplyRate: string,
|
|
76
|
+
borrowRate: string,
|
|
77
|
+
incentiveSupplyApy?: string,
|
|
78
|
+
incentiveSupplyToken?: string,
|
|
79
|
+
totalSupply?: string,
|
|
80
|
+
totalBorrow?: string,
|
|
81
|
+
canBeSupplied?: boolean,
|
|
82
|
+
canBeBorrowed?: boolean,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
|
|
86
|
+
|
|
87
|
+
export interface MorphoBlueMarketInfo {
|
|
88
|
+
id: string,
|
|
89
|
+
fee: string,
|
|
90
|
+
loanToken: string,
|
|
91
|
+
collateralToken: string,
|
|
92
|
+
utillization: string,
|
|
93
|
+
oracle: string,
|
|
94
|
+
oracleType: MorphoBlueOracleType,
|
|
95
|
+
lltv: string,
|
|
96
|
+
minRatio: string,
|
|
97
|
+
assetsData: MorphoBlueAssetsData,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface MorphoBlueAggregatedPositionData {
|
|
101
|
+
suppliedUsd: string,
|
|
102
|
+
suppliedCollateralUsd: string,
|
|
103
|
+
borrowedUsd: string,
|
|
104
|
+
borrowLimitUsd: string,
|
|
105
|
+
liquidationLimitUsd: string,
|
|
106
|
+
leftToBorrowUsd: string,
|
|
107
|
+
leftToBorrow: string,
|
|
108
|
+
netApy: string,
|
|
109
|
+
incentiveUsd: string,
|
|
110
|
+
totalInterestUsd: string,
|
|
111
|
+
ltv: string,
|
|
112
|
+
ratio: string,
|
|
113
|
+
leveragedType: string,
|
|
114
|
+
leveragedAsset?: string,
|
|
115
|
+
leveragedLsdAssetRatio?: string,
|
|
116
|
+
liquidationPrice?: string,
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface MorphoBluePositionData {
|
|
120
|
+
usedAssets: MMUsedAssets,
|
|
121
|
+
suppliedUsd: string,
|
|
122
|
+
suppliedCollateralUsd: string,
|
|
123
|
+
borrowedUsd: string,
|
|
124
|
+
borrowLimitUsd: string,
|
|
125
|
+
liquidationLimitUsd: string,
|
|
126
|
+
leftToBorrowUsd: string,
|
|
127
|
+
leftToBorrow: string,
|
|
128
|
+
netApy: string,
|
|
129
|
+
incentiveUsd: string,
|
|
130
|
+
totalInterestUsd: string,
|
|
131
|
+
ltv: string,
|
|
132
|
+
ratio: string,
|
|
133
|
+
leveragedType: string,
|
|
134
|
+
leveragedAsset?: string,
|
|
135
|
+
leveragedLsdAssetRatio?: string,
|
|
136
|
+
liquidationPrice?: string,
|
|
137
|
+
supplyShares: string,
|
|
138
|
+
borrowShares: string,
|
|
139
|
+
}
|
package/src/types/spark.ts
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import { EModeCategoryData, EModeCategoryDataMapping } from './aave';
|
|
2
|
-
import {
|
|
3
|
-
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
4
|
-
} from './common';
|
|
5
|
-
|
|
6
|
-
export enum SparkVersions {
|
|
7
|
-
SparkV1 = 'v1default',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface SparkMarketData {
|
|
11
|
-
chainIds: NetworkNumber[],
|
|
12
|
-
label: string,
|
|
13
|
-
shortLabel: string,
|
|
14
|
-
url: string,
|
|
15
|
-
value: SparkVersions,
|
|
16
|
-
assets: readonly string[],
|
|
17
|
-
provider: '' | 'SparkPoolAddressesProvider',
|
|
18
|
-
providerAddress: string,
|
|
19
|
-
lendingPool: 'SparkLendingPool',
|
|
20
|
-
lendingPoolAddress: string,
|
|
21
|
-
protocolData: '' | 'SparkProtocolDataProvider',
|
|
22
|
-
protocolDataAddress: string
|
|
23
|
-
subVersionLabel?: string
|
|
24
|
-
// icon: Function,
|
|
25
|
-
protocolName: string,
|
|
26
|
-
disabled?: boolean,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface SparkAssetData extends MMAssetData {
|
|
30
|
-
totalBorrowVar: string,
|
|
31
|
-
sortIndex?: number,
|
|
32
|
-
usageAsCollateralEnabled: boolean,
|
|
33
|
-
isIsolated: boolean,
|
|
34
|
-
eModeCategory: number,
|
|
35
|
-
eModeCategoryData: EModeCategoryData,
|
|
36
|
-
liquidationRatio: string,
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface SparkAssetsData {
|
|
40
|
-
[token: string]: SparkAssetData,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type SparkMarketsData = { assetsData: SparkAssetsData };
|
|
44
|
-
|
|
45
|
-
export interface SparkUsedAsset extends MMUsedAsset {
|
|
46
|
-
stableBorrowRate: string,
|
|
47
|
-
borrowedStable: string,
|
|
48
|
-
borrowedVariable: string,
|
|
49
|
-
borrowedUsdStable: string,
|
|
50
|
-
borrowedUsdVariable: string,
|
|
51
|
-
stableLimit: string,
|
|
52
|
-
variableLimit: string,
|
|
53
|
-
limit: string,
|
|
54
|
-
eModeCategory: number,
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface SparkUsedAssets {
|
|
58
|
-
[token: string]: SparkUsedAsset,
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface SparkHelperCommon {
|
|
62
|
-
usedAssets: SparkUsedAssets,
|
|
63
|
-
eModeCategory: number,
|
|
64
|
-
eModeCategories?: object,
|
|
65
|
-
assetsData: SparkAssetsData,
|
|
66
|
-
selectedMarket?: SparkMarketData,
|
|
67
|
-
network?: NetworkNumber,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface SparkAggregatedPositionData {
|
|
71
|
-
suppliedUsd: string,
|
|
72
|
-
suppliedCollateralUsd: string,
|
|
73
|
-
borrowedUsd: string,
|
|
74
|
-
borrowLimitUsd: string,
|
|
75
|
-
liquidationLimitUsd: string,
|
|
76
|
-
leftToBorrowUsd: string,
|
|
77
|
-
ratio: string,
|
|
78
|
-
collRatio: string,
|
|
79
|
-
netApy: string,
|
|
80
|
-
incentiveUsd: string,
|
|
81
|
-
totalInterestUsd: string,
|
|
82
|
-
liqRatio: string,
|
|
83
|
-
liqPercent: string,
|
|
84
|
-
leveragedType: string,
|
|
85
|
-
leveragedAsset?: string,
|
|
86
|
-
leveragedLsdAssetRatio?: string,
|
|
87
|
-
liquidationPrice?: string,
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface SparkPositionData extends MMPositionData {
|
|
91
|
-
ratio: string,
|
|
92
|
-
minRatio: string,
|
|
93
|
-
collRatio: string,
|
|
94
|
-
borrowedUsd: string,
|
|
95
|
-
borrowLimitUsd: string,
|
|
96
|
-
suppliedCollateralUsd: string,
|
|
97
|
-
incentiveUsd: string,
|
|
98
|
-
totalInterestUsd: string,
|
|
99
|
-
isSubscribedToAutomation?: boolean,
|
|
100
|
-
automationResubscribeRequired?: boolean,
|
|
101
|
-
totalSupplied: string,
|
|
102
|
-
usedAssets: SparkUsedAssets,
|
|
103
|
-
eModeCategory: number,
|
|
104
|
-
isInIsolationMode: boolean,
|
|
105
|
-
isInSiloedMode: boolean,
|
|
106
|
-
eModeCategories: { [key: number]: EModeCategoryDataMapping },
|
|
1
|
+
import { EModeCategoryData, EModeCategoryDataMapping } from './aave';
|
|
2
|
+
import {
|
|
3
|
+
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
4
|
+
} from './common';
|
|
5
|
+
|
|
6
|
+
export enum SparkVersions {
|
|
7
|
+
SparkV1 = 'v1default',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SparkMarketData {
|
|
11
|
+
chainIds: NetworkNumber[],
|
|
12
|
+
label: string,
|
|
13
|
+
shortLabel: string,
|
|
14
|
+
url: string,
|
|
15
|
+
value: SparkVersions,
|
|
16
|
+
assets: readonly string[],
|
|
17
|
+
provider: '' | 'SparkPoolAddressesProvider',
|
|
18
|
+
providerAddress: string,
|
|
19
|
+
lendingPool: 'SparkLendingPool',
|
|
20
|
+
lendingPoolAddress: string,
|
|
21
|
+
protocolData: '' | 'SparkProtocolDataProvider',
|
|
22
|
+
protocolDataAddress: string
|
|
23
|
+
subVersionLabel?: string
|
|
24
|
+
// icon: Function,
|
|
25
|
+
protocolName: string,
|
|
26
|
+
disabled?: boolean,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SparkAssetData extends MMAssetData {
|
|
30
|
+
totalBorrowVar: string,
|
|
31
|
+
sortIndex?: number,
|
|
32
|
+
usageAsCollateralEnabled: boolean,
|
|
33
|
+
isIsolated: boolean,
|
|
34
|
+
eModeCategory: number,
|
|
35
|
+
eModeCategoryData: EModeCategoryData,
|
|
36
|
+
liquidationRatio: string,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface SparkAssetsData {
|
|
40
|
+
[token: string]: SparkAssetData,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type SparkMarketsData = { assetsData: SparkAssetsData };
|
|
44
|
+
|
|
45
|
+
export interface SparkUsedAsset extends MMUsedAsset {
|
|
46
|
+
stableBorrowRate: string,
|
|
47
|
+
borrowedStable: string,
|
|
48
|
+
borrowedVariable: string,
|
|
49
|
+
borrowedUsdStable: string,
|
|
50
|
+
borrowedUsdVariable: string,
|
|
51
|
+
stableLimit: string,
|
|
52
|
+
variableLimit: string,
|
|
53
|
+
limit: string,
|
|
54
|
+
eModeCategory: number,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface SparkUsedAssets {
|
|
58
|
+
[token: string]: SparkUsedAsset,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface SparkHelperCommon {
|
|
62
|
+
usedAssets: SparkUsedAssets,
|
|
63
|
+
eModeCategory: number,
|
|
64
|
+
eModeCategories?: object,
|
|
65
|
+
assetsData: SparkAssetsData,
|
|
66
|
+
selectedMarket?: SparkMarketData,
|
|
67
|
+
network?: NetworkNumber,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface SparkAggregatedPositionData {
|
|
71
|
+
suppliedUsd: string,
|
|
72
|
+
suppliedCollateralUsd: string,
|
|
73
|
+
borrowedUsd: string,
|
|
74
|
+
borrowLimitUsd: string,
|
|
75
|
+
liquidationLimitUsd: string,
|
|
76
|
+
leftToBorrowUsd: string,
|
|
77
|
+
ratio: string,
|
|
78
|
+
collRatio: string,
|
|
79
|
+
netApy: string,
|
|
80
|
+
incentiveUsd: string,
|
|
81
|
+
totalInterestUsd: string,
|
|
82
|
+
liqRatio: string,
|
|
83
|
+
liqPercent: string,
|
|
84
|
+
leveragedType: string,
|
|
85
|
+
leveragedAsset?: string,
|
|
86
|
+
leveragedLsdAssetRatio?: string,
|
|
87
|
+
liquidationPrice?: string,
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface SparkPositionData extends MMPositionData {
|
|
91
|
+
ratio: string,
|
|
92
|
+
minRatio: string,
|
|
93
|
+
collRatio: string,
|
|
94
|
+
borrowedUsd: string,
|
|
95
|
+
borrowLimitUsd: string,
|
|
96
|
+
suppliedCollateralUsd: string,
|
|
97
|
+
incentiveUsd: string,
|
|
98
|
+
totalInterestUsd: string,
|
|
99
|
+
isSubscribedToAutomation?: boolean,
|
|
100
|
+
automationResubscribeRequired?: boolean,
|
|
101
|
+
totalSupplied: string,
|
|
102
|
+
usedAssets: SparkUsedAssets,
|
|
103
|
+
eModeCategory: number,
|
|
104
|
+
isInIsolationMode: boolean,
|
|
105
|
+
isInSiloedMode: boolean,
|
|
106
|
+
eModeCategories: { [key: number]: EModeCategoryDataMapping },
|
|
107
107
|
}
|