@defisaver/positions-sdk 1.0.3-dev → 1.0.3
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 +69 -69
- package/cjs/curveUsd/index.js +1 -8
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/markets/compound/marketsAssets.js +1 -1
- package/cjs/markets/spark/marketAssets.js +1 -1
- package/cjs/types/curveUsd.d.ts +0 -1
- package/esm/curveUsd/index.js +3 -10
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/markets/compound/marketsAssets.js +1 -1
- package/esm/markets/spark/marketAssets.js +1 -1
- package/esm/types/curveUsd.d.ts +0 -1
- package/package.json +52 -52
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +625 -625
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +220 -220
- package/src/compoundV3/index.ts +291 -291
- package/src/config/contracts.js +1147 -1147
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +134 -134
- package/src/curveUsd/index.ts +230 -239
- package/src/eulerV2/index.ts +303 -303
- package/src/exchange/index.ts +17 -17
- package/src/fluid/index.ts +354 -354
- package/src/helpers/aaveHelpers/index.ts +198 -198
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +246 -246
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +232 -232
- package/src/helpers/fluidHelpers/index.ts +53 -53
- package/src/helpers/index.ts +11 -11
- package/src/helpers/liquityV2Helpers/index.ts +80 -80
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +365 -365
- package/src/helpers/sparkHelpers/index.ts +150 -150
- package/src/index.ts +52 -52
- package/src/liquity/index.ts +116 -116
- package/src/liquityV2/index.ts +295 -295
- package/src/llamaLend/index.ts +275 -275
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +152 -152
- package/src/markets/aave/marketAssets.ts +44 -44
- package/src/markets/compound/index.ts +213 -213
- package/src/markets/compound/marketsAssets.ts +82 -82
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2012 -2012
- package/src/markets/index.ts +27 -27
- package/src/markets/liquityV2/index.ts +54 -54
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +895 -895
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +630 -630
- package/src/morphoBlue/index.ts +202 -202
- package/src/multicall/index.ts +33 -33
- package/src/services/priceService.ts +91 -91
- package/src/services/utils.ts +59 -59
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +460 -460
- package/src/staking/staking.ts +220 -220
- package/src/types/aave.ts +271 -271
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +131 -131
- package/src/types/curveUsd.ts +118 -119
- package/src/types/euler.ts +171 -171
- package/src/types/fluid.ts +266 -266
- package/src/types/index.ts +11 -11
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +119 -119
- package/src/types/llamaLend.ts +155 -155
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +192 -192
- package/src/types/spark.ts +131 -131
package/src/types/morphoBlue.ts
CHANGED
|
@@ -1,192 +1,192 @@
|
|
|
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
|
-
MorphoBlueREthEth_945 = 'morphoblueretheth_945', // rETH/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
|
-
MorphoBlueMKRUSDC = 'morphobluemkrusdc', // MKR/USDC
|
|
20
|
-
MorphoBlueTBTCUSDC = 'morphobluetbtcusdc', // tBTC/USDC
|
|
21
|
-
MorphoBlueCbBTCEth_915 = 'morphobluecbbtceth', // cbBTC/Eth
|
|
22
|
-
MorphoBlueCbBTCUSDC_860 = 'morphobluecbbtcusdc', // cbBTC/USDC
|
|
23
|
-
MorphoBlueSUSDeUSDC_915 = 'morphobluesusdeusdc_915', // sUSDe/USDC
|
|
24
|
-
MorphoBlueLBTCWBTC_945 = 'morphobluelbtcwbtc_945', // LBTC/WBTC
|
|
25
|
-
MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
|
|
26
|
-
// ezETH/ETH
|
|
27
|
-
MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
|
|
28
|
-
MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
|
|
29
|
-
// weETH/ETH
|
|
30
|
-
MorphoBlueWeEthEth_860 = 'morphoblueweetheth_860',
|
|
31
|
-
MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
|
|
32
|
-
// wstETH/WETH
|
|
33
|
-
MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
|
|
34
|
-
MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
|
|
35
|
-
MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
|
|
36
|
-
// sUSDe/DAI
|
|
37
|
-
MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
|
|
38
|
-
MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
|
|
39
|
-
MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
|
|
40
|
-
MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
|
|
41
|
-
// USDe/DAI
|
|
42
|
-
MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
|
|
43
|
-
MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
|
|
44
|
-
MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
|
|
45
|
-
MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
|
|
46
|
-
|
|
47
|
-
// BASE
|
|
48
|
-
MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
|
|
49
|
-
MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
|
|
50
|
-
MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
|
|
51
|
-
MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
|
|
52
|
-
MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
|
|
53
|
-
MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
|
|
54
|
-
MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
|
|
55
|
-
MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
|
|
56
|
-
MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
|
|
57
|
-
MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
|
|
58
|
-
MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
|
|
59
|
-
MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
|
|
60
|
-
MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
|
|
61
|
-
MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
|
|
62
|
-
MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
|
|
63
|
-
MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
|
|
64
|
-
MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export enum MorphoBlueOracleType {
|
|
68
|
-
MARKET_RATE = 'Market rate',
|
|
69
|
-
LIDO_RATE = 'Lido rate',
|
|
70
|
-
ETHENA_RATE = 'Ethena rate',
|
|
71
|
-
CONTRACT_RATE = 'Contract rate',
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface MorphoBlueMarketData {
|
|
75
|
-
chainIds: NetworkNumber[],
|
|
76
|
-
label: string,
|
|
77
|
-
shortLabel: string,
|
|
78
|
-
url: string,
|
|
79
|
-
value: MorphoBlueVersions,
|
|
80
|
-
loanToken: string,
|
|
81
|
-
collateralToken: string,
|
|
82
|
-
oracle: string,
|
|
83
|
-
oracleType: MorphoBlueOracleType,
|
|
84
|
-
irm: string,
|
|
85
|
-
lltv: number | string,
|
|
86
|
-
marketId: string,
|
|
87
|
-
// icon: Function,
|
|
88
|
-
protocolName: string,
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface MorphoBlueAssetData {
|
|
92
|
-
symbol: string,
|
|
93
|
-
address: string,
|
|
94
|
-
price: string,
|
|
95
|
-
supplyRate: string,
|
|
96
|
-
borrowRate: string,
|
|
97
|
-
incentiveSupplyApy?: string,
|
|
98
|
-
incentiveSupplyToken?: string,
|
|
99
|
-
incentiveBorrowApy?: string,
|
|
100
|
-
incentiveBorrowToken?: string,
|
|
101
|
-
totalSupply?: string,
|
|
102
|
-
totalBorrow?: string,
|
|
103
|
-
canBeSupplied?: boolean,
|
|
104
|
-
canBeBorrowed?: boolean,
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
|
|
108
|
-
|
|
109
|
-
export interface MorphoBlueMarketInfo {
|
|
110
|
-
id: string,
|
|
111
|
-
fee: string,
|
|
112
|
-
loanToken: string,
|
|
113
|
-
collateralToken: string,
|
|
114
|
-
utillization: string,
|
|
115
|
-
oracle: string,
|
|
116
|
-
oracleType: MorphoBlueOracleType,
|
|
117
|
-
lltv: string,
|
|
118
|
-
minRatio: string,
|
|
119
|
-
assetsData: MorphoBlueAssetsData,
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface MorphoBlueAggregatedPositionData {
|
|
123
|
-
suppliedUsd: string,
|
|
124
|
-
suppliedCollateralUsd: string,
|
|
125
|
-
borrowedUsd: string,
|
|
126
|
-
borrowLimitUsd: string,
|
|
127
|
-
liquidationLimitUsd: string,
|
|
128
|
-
leftToBorrowUsd: string,
|
|
129
|
-
leftToBorrow: string,
|
|
130
|
-
netApy: string,
|
|
131
|
-
incentiveUsd: string,
|
|
132
|
-
totalInterestUsd: string,
|
|
133
|
-
ltv: string,
|
|
134
|
-
ratio: string,
|
|
135
|
-
leveragedType: string,
|
|
136
|
-
leveragedAsset?: string,
|
|
137
|
-
leveragedLsdAssetRatio?: string,
|
|
138
|
-
liquidationPrice?: string,
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface MorphoBluePositionData {
|
|
142
|
-
usedAssets: MMUsedAssets,
|
|
143
|
-
suppliedUsd: string,
|
|
144
|
-
suppliedCollateralUsd: string,
|
|
145
|
-
borrowedUsd: string,
|
|
146
|
-
borrowLimitUsd: string,
|
|
147
|
-
liquidationLimitUsd: string,
|
|
148
|
-
leftToBorrowUsd: string,
|
|
149
|
-
leftToBorrow: string,
|
|
150
|
-
netApy: string,
|
|
151
|
-
incentiveUsd: string,
|
|
152
|
-
totalInterestUsd: string,
|
|
153
|
-
ltv: string,
|
|
154
|
-
ratio: string,
|
|
155
|
-
leveragedType: string,
|
|
156
|
-
leveragedAsset?: string,
|
|
157
|
-
leveragedLsdAssetRatio?: string,
|
|
158
|
-
liquidationPrice?: string,
|
|
159
|
-
supplyShares: string,
|
|
160
|
-
borrowShares: string,
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export interface MorphoBlueVault {
|
|
164
|
-
address: string,
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export interface MorphoBlueAllocationMarket {
|
|
168
|
-
loanAsset: { address: string },
|
|
169
|
-
collateralAsset: { address: string },
|
|
170
|
-
oracle: { address: string },
|
|
171
|
-
irmAddress: string,
|
|
172
|
-
lltv: string,
|
|
173
|
-
uniqueKey: string,
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export interface MorphoBluePublicAllocatorItem {
|
|
177
|
-
vault: MorphoBlueVault,
|
|
178
|
-
assets: string,
|
|
179
|
-
allocationMarket: MorphoBlueAllocationMarket,
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export interface MorphoBlueAllocatorMarketState {
|
|
183
|
-
borrowAssets: string,
|
|
184
|
-
supplyAssets: string,
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export interface MorphoBlueRealloactionMarketData {
|
|
188
|
-
reallocatableLiquidityAssets: string,
|
|
189
|
-
targetBorrowUtilization: string,
|
|
190
|
-
publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
|
|
191
|
-
state: MorphoBlueAllocatorMarketState,
|
|
192
|
-
}
|
|
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
|
+
MorphoBlueREthEth_945 = 'morphoblueretheth_945', // rETH/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
|
+
MorphoBlueMKRUSDC = 'morphobluemkrusdc', // MKR/USDC
|
|
20
|
+
MorphoBlueTBTCUSDC = 'morphobluetbtcusdc', // tBTC/USDC
|
|
21
|
+
MorphoBlueCbBTCEth_915 = 'morphobluecbbtceth', // cbBTC/Eth
|
|
22
|
+
MorphoBlueCbBTCUSDC_860 = 'morphobluecbbtcusdc', // cbBTC/USDC
|
|
23
|
+
MorphoBlueSUSDeUSDC_915 = 'morphobluesusdeusdc_915', // sUSDe/USDC
|
|
24
|
+
MorphoBlueLBTCWBTC_945 = 'morphobluelbtcwbtc_945', // LBTC/WBTC
|
|
25
|
+
MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
|
|
26
|
+
// ezETH/ETH
|
|
27
|
+
MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
|
|
28
|
+
MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
|
|
29
|
+
// weETH/ETH
|
|
30
|
+
MorphoBlueWeEthEth_860 = 'morphoblueweetheth_860',
|
|
31
|
+
MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
|
|
32
|
+
// wstETH/WETH
|
|
33
|
+
MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
|
|
34
|
+
MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
|
|
35
|
+
MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
|
|
36
|
+
// sUSDe/DAI
|
|
37
|
+
MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
|
|
38
|
+
MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
|
|
39
|
+
MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
|
|
40
|
+
MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
|
|
41
|
+
// USDe/DAI
|
|
42
|
+
MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
|
|
43
|
+
MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
|
|
44
|
+
MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
|
|
45
|
+
MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
|
|
46
|
+
|
|
47
|
+
// BASE
|
|
48
|
+
MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
|
|
49
|
+
MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
|
|
50
|
+
MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
|
|
51
|
+
MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
|
|
52
|
+
MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
|
|
53
|
+
MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
|
|
54
|
+
MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
|
|
55
|
+
MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
|
|
56
|
+
MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
|
|
57
|
+
MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
|
|
58
|
+
MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
|
|
59
|
+
MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
|
|
60
|
+
MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
|
|
61
|
+
MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
|
|
62
|
+
MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
|
|
63
|
+
MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
|
|
64
|
+
MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export enum MorphoBlueOracleType {
|
|
68
|
+
MARKET_RATE = 'Market rate',
|
|
69
|
+
LIDO_RATE = 'Lido rate',
|
|
70
|
+
ETHENA_RATE = 'Ethena rate',
|
|
71
|
+
CONTRACT_RATE = 'Contract rate',
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface MorphoBlueMarketData {
|
|
75
|
+
chainIds: NetworkNumber[],
|
|
76
|
+
label: string,
|
|
77
|
+
shortLabel: string,
|
|
78
|
+
url: string,
|
|
79
|
+
value: MorphoBlueVersions,
|
|
80
|
+
loanToken: string,
|
|
81
|
+
collateralToken: string,
|
|
82
|
+
oracle: string,
|
|
83
|
+
oracleType: MorphoBlueOracleType,
|
|
84
|
+
irm: string,
|
|
85
|
+
lltv: number | string,
|
|
86
|
+
marketId: string,
|
|
87
|
+
// icon: Function,
|
|
88
|
+
protocolName: string,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface MorphoBlueAssetData {
|
|
92
|
+
symbol: string,
|
|
93
|
+
address: string,
|
|
94
|
+
price: string,
|
|
95
|
+
supplyRate: string,
|
|
96
|
+
borrowRate: string,
|
|
97
|
+
incentiveSupplyApy?: string,
|
|
98
|
+
incentiveSupplyToken?: string,
|
|
99
|
+
incentiveBorrowApy?: string,
|
|
100
|
+
incentiveBorrowToken?: string,
|
|
101
|
+
totalSupply?: string,
|
|
102
|
+
totalBorrow?: string,
|
|
103
|
+
canBeSupplied?: boolean,
|
|
104
|
+
canBeBorrowed?: boolean,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
|
|
108
|
+
|
|
109
|
+
export interface MorphoBlueMarketInfo {
|
|
110
|
+
id: string,
|
|
111
|
+
fee: string,
|
|
112
|
+
loanToken: string,
|
|
113
|
+
collateralToken: string,
|
|
114
|
+
utillization: string,
|
|
115
|
+
oracle: string,
|
|
116
|
+
oracleType: MorphoBlueOracleType,
|
|
117
|
+
lltv: string,
|
|
118
|
+
minRatio: string,
|
|
119
|
+
assetsData: MorphoBlueAssetsData,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface MorphoBlueAggregatedPositionData {
|
|
123
|
+
suppliedUsd: string,
|
|
124
|
+
suppliedCollateralUsd: string,
|
|
125
|
+
borrowedUsd: string,
|
|
126
|
+
borrowLimitUsd: string,
|
|
127
|
+
liquidationLimitUsd: string,
|
|
128
|
+
leftToBorrowUsd: string,
|
|
129
|
+
leftToBorrow: string,
|
|
130
|
+
netApy: string,
|
|
131
|
+
incentiveUsd: string,
|
|
132
|
+
totalInterestUsd: string,
|
|
133
|
+
ltv: string,
|
|
134
|
+
ratio: string,
|
|
135
|
+
leveragedType: string,
|
|
136
|
+
leveragedAsset?: string,
|
|
137
|
+
leveragedLsdAssetRatio?: string,
|
|
138
|
+
liquidationPrice?: string,
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface MorphoBluePositionData {
|
|
142
|
+
usedAssets: MMUsedAssets,
|
|
143
|
+
suppliedUsd: string,
|
|
144
|
+
suppliedCollateralUsd: string,
|
|
145
|
+
borrowedUsd: string,
|
|
146
|
+
borrowLimitUsd: string,
|
|
147
|
+
liquidationLimitUsd: string,
|
|
148
|
+
leftToBorrowUsd: string,
|
|
149
|
+
leftToBorrow: string,
|
|
150
|
+
netApy: string,
|
|
151
|
+
incentiveUsd: string,
|
|
152
|
+
totalInterestUsd: string,
|
|
153
|
+
ltv: string,
|
|
154
|
+
ratio: string,
|
|
155
|
+
leveragedType: string,
|
|
156
|
+
leveragedAsset?: string,
|
|
157
|
+
leveragedLsdAssetRatio?: string,
|
|
158
|
+
liquidationPrice?: string,
|
|
159
|
+
supplyShares: string,
|
|
160
|
+
borrowShares: string,
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface MorphoBlueVault {
|
|
164
|
+
address: string,
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface MorphoBlueAllocationMarket {
|
|
168
|
+
loanAsset: { address: string },
|
|
169
|
+
collateralAsset: { address: string },
|
|
170
|
+
oracle: { address: string },
|
|
171
|
+
irmAddress: string,
|
|
172
|
+
lltv: string,
|
|
173
|
+
uniqueKey: string,
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface MorphoBluePublicAllocatorItem {
|
|
177
|
+
vault: MorphoBlueVault,
|
|
178
|
+
assets: string,
|
|
179
|
+
allocationMarket: MorphoBlueAllocationMarket,
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface MorphoBlueAllocatorMarketState {
|
|
183
|
+
borrowAssets: string,
|
|
184
|
+
supplyAssets: string,
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface MorphoBlueRealloactionMarketData {
|
|
188
|
+
reallocatableLiquidityAssets: string,
|
|
189
|
+
targetBorrowUtilization: string,
|
|
190
|
+
publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
|
|
191
|
+
state: MorphoBlueAllocatorMarketState,
|
|
192
|
+
}
|
package/src/types/spark.ts
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
3
|
-
} from './common';
|
|
4
|
-
import { IncentiveData } from './aave';
|
|
5
|
-
|
|
6
|
-
export enum SparkVersions {
|
|
7
|
-
SparkV1 = 'v1default',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface SparkEModeCategoryData {
|
|
11
|
-
label: string,
|
|
12
|
-
liquidationBonus: string,
|
|
13
|
-
liquidationRatio: string,
|
|
14
|
-
collateralFactor: string,
|
|
15
|
-
priceSource: string,
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface SparkEModeCategoryDataMapping {
|
|
19
|
-
enteringTerms: boolean[],
|
|
20
|
-
canEnterCategory: boolean,
|
|
21
|
-
id: number,
|
|
22
|
-
data: SparkEModeCategoryData,
|
|
23
|
-
assets: string[],
|
|
24
|
-
enabledData: {
|
|
25
|
-
ratio: string,
|
|
26
|
-
liqRatio: string,
|
|
27
|
-
liqPercent: string,
|
|
28
|
-
collRatio: string,
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface SparkMarketData {
|
|
33
|
-
chainIds: NetworkNumber[],
|
|
34
|
-
label: string,
|
|
35
|
-
shortLabel: string,
|
|
36
|
-
url: string,
|
|
37
|
-
value: SparkVersions,
|
|
38
|
-
assets: readonly string[],
|
|
39
|
-
provider: '' | 'SparkPoolAddressesProvider',
|
|
40
|
-
providerAddress: string,
|
|
41
|
-
lendingPool: 'SparkLendingPool',
|
|
42
|
-
lendingPoolAddress: string,
|
|
43
|
-
protocolData: '' | 'SparkProtocolDataProvider',
|
|
44
|
-
protocolDataAddress: string
|
|
45
|
-
subVersionLabel?: string
|
|
46
|
-
// icon: Function,
|
|
47
|
-
protocolName: string,
|
|
48
|
-
disabled?: boolean,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface SparkAssetData extends MMAssetData {
|
|
52
|
-
totalBorrowVar: string,
|
|
53
|
-
sortIndex?: number,
|
|
54
|
-
usageAsCollateralEnabled: boolean,
|
|
55
|
-
isIsolated: boolean,
|
|
56
|
-
eModeCategory: number,
|
|
57
|
-
eModeCategoryData: SparkEModeCategoryData,
|
|
58
|
-
liquidationRatio: string,
|
|
59
|
-
supplyIncentives?: IncentiveData[];
|
|
60
|
-
borrowIncentives?: IncentiveData[];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface SparkAssetsData {
|
|
64
|
-
[token: string]: SparkAssetData,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export type SparkMarketsData = { assetsData: SparkAssetsData };
|
|
68
|
-
|
|
69
|
-
export interface SparkUsedAsset extends MMUsedAsset {
|
|
70
|
-
stableBorrowRate: string,
|
|
71
|
-
borrowedStable: string,
|
|
72
|
-
borrowedVariable: string,
|
|
73
|
-
borrowedUsdStable: string,
|
|
74
|
-
borrowedUsdVariable: string,
|
|
75
|
-
stableLimit: string,
|
|
76
|
-
variableLimit: string,
|
|
77
|
-
limit: string,
|
|
78
|
-
eModeCategory: number,
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface SparkUsedAssets {
|
|
82
|
-
[token: string]: SparkUsedAsset,
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface SparkHelperCommon {
|
|
86
|
-
usedAssets: SparkUsedAssets,
|
|
87
|
-
eModeCategory: number,
|
|
88
|
-
eModeCategories?: object,
|
|
89
|
-
assetsData: SparkAssetsData,
|
|
90
|
-
selectedMarket?: SparkMarketData,
|
|
91
|
-
network?: NetworkNumber,
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface SparkAggregatedPositionData {
|
|
95
|
-
suppliedUsd: string,
|
|
96
|
-
suppliedCollateralUsd: string,
|
|
97
|
-
borrowedUsd: string,
|
|
98
|
-
borrowLimitUsd: string,
|
|
99
|
-
liquidationLimitUsd: string,
|
|
100
|
-
leftToBorrowUsd: string,
|
|
101
|
-
ratio: string,
|
|
102
|
-
collRatio: string,
|
|
103
|
-
netApy: string,
|
|
104
|
-
incentiveUsd: string,
|
|
105
|
-
totalInterestUsd: string,
|
|
106
|
-
liqRatio: string,
|
|
107
|
-
liqPercent: string,
|
|
108
|
-
leveragedType: string,
|
|
109
|
-
leveragedAsset?: string,
|
|
110
|
-
leveragedLsdAssetRatio?: string,
|
|
111
|
-
liquidationPrice?: string,
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export interface SparkPositionData extends MMPositionData {
|
|
115
|
-
ratio: string,
|
|
116
|
-
minRatio: string,
|
|
117
|
-
collRatio: string,
|
|
118
|
-
borrowedUsd: string,
|
|
119
|
-
borrowLimitUsd: string,
|
|
120
|
-
suppliedCollateralUsd: string,
|
|
121
|
-
incentiveUsd: string,
|
|
122
|
-
totalInterestUsd: string,
|
|
123
|
-
isSubscribedToAutomation?: boolean,
|
|
124
|
-
automationResubscribeRequired?: boolean,
|
|
125
|
-
totalSupplied: string,
|
|
126
|
-
usedAssets: SparkUsedAssets,
|
|
127
|
-
eModeCategory: number,
|
|
128
|
-
isInIsolationMode: boolean,
|
|
129
|
-
isInSiloedMode: boolean,
|
|
130
|
-
eModeCategories: { [key: number]: SparkEModeCategoryDataMapping },
|
|
131
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
3
|
+
} from './common';
|
|
4
|
+
import { IncentiveData } from './aave';
|
|
5
|
+
|
|
6
|
+
export enum SparkVersions {
|
|
7
|
+
SparkV1 = 'v1default',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SparkEModeCategoryData {
|
|
11
|
+
label: string,
|
|
12
|
+
liquidationBonus: string,
|
|
13
|
+
liquidationRatio: string,
|
|
14
|
+
collateralFactor: string,
|
|
15
|
+
priceSource: string,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SparkEModeCategoryDataMapping {
|
|
19
|
+
enteringTerms: boolean[],
|
|
20
|
+
canEnterCategory: boolean,
|
|
21
|
+
id: number,
|
|
22
|
+
data: SparkEModeCategoryData,
|
|
23
|
+
assets: string[],
|
|
24
|
+
enabledData: {
|
|
25
|
+
ratio: string,
|
|
26
|
+
liqRatio: string,
|
|
27
|
+
liqPercent: string,
|
|
28
|
+
collRatio: string,
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface SparkMarketData {
|
|
33
|
+
chainIds: NetworkNumber[],
|
|
34
|
+
label: string,
|
|
35
|
+
shortLabel: string,
|
|
36
|
+
url: string,
|
|
37
|
+
value: SparkVersions,
|
|
38
|
+
assets: readonly string[],
|
|
39
|
+
provider: '' | 'SparkPoolAddressesProvider',
|
|
40
|
+
providerAddress: string,
|
|
41
|
+
lendingPool: 'SparkLendingPool',
|
|
42
|
+
lendingPoolAddress: string,
|
|
43
|
+
protocolData: '' | 'SparkProtocolDataProvider',
|
|
44
|
+
protocolDataAddress: string
|
|
45
|
+
subVersionLabel?: string
|
|
46
|
+
// icon: Function,
|
|
47
|
+
protocolName: string,
|
|
48
|
+
disabled?: boolean,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface SparkAssetData extends MMAssetData {
|
|
52
|
+
totalBorrowVar: string,
|
|
53
|
+
sortIndex?: number,
|
|
54
|
+
usageAsCollateralEnabled: boolean,
|
|
55
|
+
isIsolated: boolean,
|
|
56
|
+
eModeCategory: number,
|
|
57
|
+
eModeCategoryData: SparkEModeCategoryData,
|
|
58
|
+
liquidationRatio: string,
|
|
59
|
+
supplyIncentives?: IncentiveData[];
|
|
60
|
+
borrowIncentives?: IncentiveData[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface SparkAssetsData {
|
|
64
|
+
[token: string]: SparkAssetData,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type SparkMarketsData = { assetsData: SparkAssetsData };
|
|
68
|
+
|
|
69
|
+
export interface SparkUsedAsset extends MMUsedAsset {
|
|
70
|
+
stableBorrowRate: string,
|
|
71
|
+
borrowedStable: string,
|
|
72
|
+
borrowedVariable: string,
|
|
73
|
+
borrowedUsdStable: string,
|
|
74
|
+
borrowedUsdVariable: string,
|
|
75
|
+
stableLimit: string,
|
|
76
|
+
variableLimit: string,
|
|
77
|
+
limit: string,
|
|
78
|
+
eModeCategory: number,
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface SparkUsedAssets {
|
|
82
|
+
[token: string]: SparkUsedAsset,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface SparkHelperCommon {
|
|
86
|
+
usedAssets: SparkUsedAssets,
|
|
87
|
+
eModeCategory: number,
|
|
88
|
+
eModeCategories?: object,
|
|
89
|
+
assetsData: SparkAssetsData,
|
|
90
|
+
selectedMarket?: SparkMarketData,
|
|
91
|
+
network?: NetworkNumber,
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface SparkAggregatedPositionData {
|
|
95
|
+
suppliedUsd: string,
|
|
96
|
+
suppliedCollateralUsd: string,
|
|
97
|
+
borrowedUsd: string,
|
|
98
|
+
borrowLimitUsd: string,
|
|
99
|
+
liquidationLimitUsd: string,
|
|
100
|
+
leftToBorrowUsd: string,
|
|
101
|
+
ratio: string,
|
|
102
|
+
collRatio: string,
|
|
103
|
+
netApy: string,
|
|
104
|
+
incentiveUsd: string,
|
|
105
|
+
totalInterestUsd: string,
|
|
106
|
+
liqRatio: string,
|
|
107
|
+
liqPercent: string,
|
|
108
|
+
leveragedType: string,
|
|
109
|
+
leveragedAsset?: string,
|
|
110
|
+
leveragedLsdAssetRatio?: string,
|
|
111
|
+
liquidationPrice?: string,
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface SparkPositionData extends MMPositionData {
|
|
115
|
+
ratio: string,
|
|
116
|
+
minRatio: string,
|
|
117
|
+
collRatio: string,
|
|
118
|
+
borrowedUsd: string,
|
|
119
|
+
borrowLimitUsd: string,
|
|
120
|
+
suppliedCollateralUsd: string,
|
|
121
|
+
incentiveUsd: string,
|
|
122
|
+
totalInterestUsd: string,
|
|
123
|
+
isSubscribedToAutomation?: boolean,
|
|
124
|
+
automationResubscribeRequired?: boolean,
|
|
125
|
+
totalSupplied: string,
|
|
126
|
+
usedAssets: SparkUsedAssets,
|
|
127
|
+
eModeCategory: number,
|
|
128
|
+
isInIsolationMode: boolean,
|
|
129
|
+
isInSiloedMode: boolean,
|
|
130
|
+
eModeCategories: { [key: number]: SparkEModeCategoryDataMapping },
|
|
131
|
+
}
|