@defisaver/positions-sdk 2.1.51 → 2.1.52-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +64 -64
- package/cjs/helpers/aaveHelpers/index.d.ts +2 -2
- package/cjs/helpers/aaveHelpers/index.js +6 -0
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/moneymarket/moneymarketCommonService.js +8 -1
- package/cjs/savings/morphoVaults/index.js +17 -17
- package/cjs/types/aave.d.ts +1 -0
- package/cjs/types/common.d.ts +1 -1
- package/cjs/types/common.js +1 -1
- package/esm/helpers/aaveHelpers/index.d.ts +2 -2
- package/esm/helpers/aaveHelpers/index.js +6 -0
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/moneymarket/moneymarketCommonService.js +8 -1
- package/esm/savings/morphoVaults/index.js +17 -17
- package/esm/types/aave.d.ts +1 -0
- package/esm/types/common.d.ts +1 -1
- package/esm/types/common.js +1 -1
- 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 -1320
- package/src/constants/index.ts +10 -10
- package/src/contracts.ts +171 -171
- 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 +197 -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 -10
- 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 +158 -158
- package/src/index.ts +49 -49
- 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 -25
- 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 -586
- 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 +199 -198
- package/src/types/claiming.ts +114 -114
- package/src/types/common.ts +107 -107
- package/src/types/compound.ts +144 -144
- package/src/types/curveUsd.ts +123 -123
- package/src/types/euler.ts +175 -175
- package/src/types/fluid.ts +483 -483
- package/src/types/index.ts +14 -14
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +126 -126
- package/src/types/llamaLend.ts +159 -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 -60
- 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 +134 -134
- package/src/umbrella/index.ts +69 -69
- package/src/umbrella/umbrellaUtils.ts +29 -29
package/src/types/morphoBlue.ts
CHANGED
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EthAddress, IncentiveData, MMUsedAssets, NetworkNumber,
|
|
3
|
-
} from './common';
|
|
4
|
-
|
|
5
|
-
export enum MorphoBlueVersions {
|
|
6
|
-
// MAINNET
|
|
7
|
-
MorphoBlueWstEthUSDC = 'morphobluewstethusdc', // wstETH/USDC
|
|
8
|
-
MorphoBlueSDAIUSDC = 'morphobluesdaiusdc', // sDAI/USDC
|
|
9
|
-
MorphoBlueWBTCUSDC = 'morphobluewbtcusdc', // WBTC/USDC
|
|
10
|
-
MorphoBlueEthUSDC = 'morphoblueethusdc', // ETH/USDC
|
|
11
|
-
MorphoBlueWBTCUSDT = 'morphobluewbtcusdt', // WBTC/USDT
|
|
12
|
-
MorphoBlueWstEthUSDT = 'morphobluewstethusdt', // wstETH/USDT
|
|
13
|
-
MorphoBlueWstEthUSDA_Exchange_Rate = 'morphobluewstethusda_exchange_rate', // wstETH/USDA
|
|
14
|
-
MorphoBlueWstEthPYUSD = 'morphobluwstethpyusd', // wstETH/PYUSD
|
|
15
|
-
MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
|
|
16
|
-
MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
|
|
17
|
-
MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
|
|
18
|
-
MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
|
|
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
|
-
MorphoBlueLBTCUSDC_860 = 'morphobluelbtcusdc_860', // LBTC/USDC
|
|
26
|
-
MorphoBlueLBTCCbBTC_945 = 'morphobluelbtccbbtc_945', // LBTC/cbBTC
|
|
27
|
-
MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
|
|
28
|
-
MorphoBlueSyrupUSDCUSDC_915 = 'morphobluesyrupusdcusdc_915', // syrupUSDC/USDC
|
|
29
|
-
MorphoBluesUSDSUSDT_965 = 'morphobluesusdsusdt_965', // sUSDS/USDT
|
|
30
|
-
// ezETH/ETH
|
|
31
|
-
MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
|
|
32
|
-
MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
|
|
33
|
-
// weETH/ETH
|
|
34
|
-
MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
|
|
35
|
-
// wstETH/WETH
|
|
36
|
-
MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
|
|
37
|
-
MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
|
|
38
|
-
MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
|
|
39
|
-
// sUSDe/DAI
|
|
40
|
-
MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
|
|
41
|
-
MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
|
|
42
|
-
MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
|
|
43
|
-
// USDe/DAI
|
|
44
|
-
MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
|
|
45
|
-
MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
|
|
46
|
-
|
|
47
|
-
MorphoBlueMORPHOUSDC_625 = 'morphobluemorphousdc_625',
|
|
48
|
-
|
|
49
|
-
// BASE
|
|
50
|
-
MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
|
|
51
|
-
MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
|
|
52
|
-
MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
|
|
53
|
-
MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
|
|
54
|
-
MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
|
|
55
|
-
MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
|
|
56
|
-
MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
|
|
57
|
-
MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
|
|
58
|
-
MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
|
|
59
|
-
MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
|
|
60
|
-
MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
|
|
61
|
-
MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
|
|
62
|
-
MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
|
|
63
|
-
MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
|
|
64
|
-
MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
|
|
65
|
-
MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
|
|
66
|
-
MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
|
|
67
|
-
MorphoBlueWETHEURC_860_Base = 'morphobluewetheurc_860_base', // WETH/EURC
|
|
68
|
-
|
|
69
|
-
// ARBITRUM
|
|
70
|
-
MorphoBlueSyrupUSDCUSDC_915_Arb = 'morphobluesyrupusdcusdc_915_arb', // syrupUSDC/USDC
|
|
71
|
-
MorphoBlueWBTCUSDC_860_Arb = 'morphobluewbtcusdc_860_arb', // WBTC/USDC
|
|
72
|
-
MorphoBlueWstEthUSDC_860_Arb = 'morphobluewstethusdc_860_arb', // wstETH/USDC
|
|
73
|
-
MorphoBlueEthUSDC_860_Arb = 'morphoblueethusdc_860_arb', // ETH/USDC
|
|
74
|
-
MorphoBluesUSDSUSDC_945_Arb = 'morphobluesusdsusdc_945_arb', // sUSDS/USDC
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export enum MorphoBlueOracleType {
|
|
78
|
-
MARKET_RATE = 'Market rate',
|
|
79
|
-
LIDO_RATE = 'Lido rate',
|
|
80
|
-
ETHENA_RATE = 'Ethena rate',
|
|
81
|
-
CONTRACT_RATE = 'Contract rate',
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface MorphoBlueMarketData {
|
|
85
|
-
chainIds: NetworkNumber[],
|
|
86
|
-
label: string,
|
|
87
|
-
shortLabel: string,
|
|
88
|
-
url: string,
|
|
89
|
-
value: MorphoBlueVersions,
|
|
90
|
-
loanToken: EthAddress,
|
|
91
|
-
collateralToken: EthAddress,
|
|
92
|
-
oracle: EthAddress,
|
|
93
|
-
oracleType: MorphoBlueOracleType,
|
|
94
|
-
irm: EthAddress,
|
|
95
|
-
lltv: number | string,
|
|
96
|
-
marketId: string,
|
|
97
|
-
// icon: Function,
|
|
98
|
-
protocolName: string,
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface MorphoBlueAssetData {
|
|
102
|
-
symbol: string,
|
|
103
|
-
address: string,
|
|
104
|
-
price: string,
|
|
105
|
-
supplyRate: string,
|
|
106
|
-
borrowRate: string,
|
|
107
|
-
supplyIncentives: IncentiveData[],
|
|
108
|
-
borrowIncentives: IncentiveData[],
|
|
109
|
-
totalSupply?: string,
|
|
110
|
-
totalBorrow?: string,
|
|
111
|
-
canBeSupplied?: boolean,
|
|
112
|
-
canBeBorrowed?: boolean,
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
|
|
116
|
-
|
|
117
|
-
export interface MorphoBlueMarketInfo {
|
|
118
|
-
id: string,
|
|
119
|
-
fee: string,
|
|
120
|
-
loanToken: string,
|
|
121
|
-
collateralToken: string,
|
|
122
|
-
utillization: string,
|
|
123
|
-
oracle: string,
|
|
124
|
-
oracleType: MorphoBlueOracleType,
|
|
125
|
-
lltv: string,
|
|
126
|
-
minRatio: string,
|
|
127
|
-
assetsData: MorphoBlueAssetsData,
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface MorphoBlueAggregatedPositionData {
|
|
131
|
-
suppliedUsd: string,
|
|
132
|
-
suppliedCollateralUsd: string,
|
|
133
|
-
borrowedUsd: string,
|
|
134
|
-
borrowLimitUsd: string,
|
|
135
|
-
liquidationLimitUsd: string,
|
|
136
|
-
leftToBorrowUsd: string,
|
|
137
|
-
leftToBorrow: string,
|
|
138
|
-
netApy: string,
|
|
139
|
-
incentiveUsd: string,
|
|
140
|
-
totalInterestUsd: string,
|
|
141
|
-
ltv: string,
|
|
142
|
-
ratio: string,
|
|
143
|
-
leveragedType: string,
|
|
144
|
-
leveragedAsset?: string,
|
|
145
|
-
leveragedLsdAssetRatio?: string,
|
|
146
|
-
liquidationPrice?: string,
|
|
147
|
-
minCollRatio?: string,
|
|
148
|
-
collLiquidationRatio?: string,
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export interface MorphoBluePositionData {
|
|
152
|
-
usedAssets: MMUsedAssets,
|
|
153
|
-
suppliedUsd: string,
|
|
154
|
-
suppliedCollateralUsd: string,
|
|
155
|
-
borrowedUsd: string,
|
|
156
|
-
borrowLimitUsd: string,
|
|
157
|
-
liquidationLimitUsd: string,
|
|
158
|
-
leftToBorrowUsd: string,
|
|
159
|
-
leftToBorrow: string,
|
|
160
|
-
netApy: string,
|
|
161
|
-
incentiveUsd: string,
|
|
162
|
-
totalInterestUsd: string,
|
|
163
|
-
ltv: string,
|
|
164
|
-
ratio: string,
|
|
165
|
-
leveragedType: string,
|
|
166
|
-
leveragedAsset?: string,
|
|
167
|
-
leveragedLsdAssetRatio?: string,
|
|
168
|
-
liquidationPrice?: string,
|
|
169
|
-
supplyShares: string,
|
|
170
|
-
borrowShares: string,
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export interface MorphoBlueVault {
|
|
174
|
-
address: string,
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export interface MorphoBlueAllocationMarket {
|
|
178
|
-
loanAsset: { address: string },
|
|
179
|
-
collateralAsset: { address: string },
|
|
180
|
-
oracle: { address: string },
|
|
181
|
-
irmAddress: string,
|
|
182
|
-
lltv: string,
|
|
183
|
-
uniqueKey: string,
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface MorphoBluePublicAllocatorItem {
|
|
187
|
-
vault: MorphoBlueVault,
|
|
188
|
-
assets: string,
|
|
189
|
-
allocationMarket: MorphoBlueAllocationMarket,
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export interface MorphoBlueAllocatorMarketState {
|
|
193
|
-
borrowAssets: string,
|
|
194
|
-
supplyAssets: string,
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export interface MorphoBlueRealloactionMarketData {
|
|
198
|
-
reallocatableLiquidityAssets: string,
|
|
199
|
-
targetBorrowUtilization: string,
|
|
200
|
-
publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
|
|
201
|
-
state: MorphoBlueAllocatorMarketState,
|
|
202
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
EthAddress, IncentiveData, MMUsedAssets, NetworkNumber,
|
|
3
|
+
} from './common';
|
|
4
|
+
|
|
5
|
+
export enum MorphoBlueVersions {
|
|
6
|
+
// MAINNET
|
|
7
|
+
MorphoBlueWstEthUSDC = 'morphobluewstethusdc', // wstETH/USDC
|
|
8
|
+
MorphoBlueSDAIUSDC = 'morphobluesdaiusdc', // sDAI/USDC
|
|
9
|
+
MorphoBlueWBTCUSDC = 'morphobluewbtcusdc', // WBTC/USDC
|
|
10
|
+
MorphoBlueEthUSDC = 'morphoblueethusdc', // ETH/USDC
|
|
11
|
+
MorphoBlueWBTCUSDT = 'morphobluewbtcusdt', // WBTC/USDT
|
|
12
|
+
MorphoBlueWstEthUSDT = 'morphobluewstethusdt', // wstETH/USDT
|
|
13
|
+
MorphoBlueWstEthUSDA_Exchange_Rate = 'morphobluewstethusda_exchange_rate', // wstETH/USDA
|
|
14
|
+
MorphoBlueWstEthPYUSD = 'morphobluwstethpyusd', // wstETH/PYUSD
|
|
15
|
+
MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
|
|
16
|
+
MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
|
|
17
|
+
MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
|
|
18
|
+
MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
|
|
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
|
+
MorphoBlueLBTCUSDC_860 = 'morphobluelbtcusdc_860', // LBTC/USDC
|
|
26
|
+
MorphoBlueLBTCCbBTC_945 = 'morphobluelbtccbbtc_945', // LBTC/cbBTC
|
|
27
|
+
MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
|
|
28
|
+
MorphoBlueSyrupUSDCUSDC_915 = 'morphobluesyrupusdcusdc_915', // syrupUSDC/USDC
|
|
29
|
+
MorphoBluesUSDSUSDT_965 = 'morphobluesusdsusdt_965', // sUSDS/USDT
|
|
30
|
+
// ezETH/ETH
|
|
31
|
+
MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
|
|
32
|
+
MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
|
|
33
|
+
// weETH/ETH
|
|
34
|
+
MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
|
|
35
|
+
// wstETH/WETH
|
|
36
|
+
MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
|
|
37
|
+
MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
|
|
38
|
+
MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
|
|
39
|
+
// sUSDe/DAI
|
|
40
|
+
MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
|
|
41
|
+
MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
|
|
42
|
+
MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
|
|
43
|
+
// USDe/DAI
|
|
44
|
+
MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
|
|
45
|
+
MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
|
|
46
|
+
|
|
47
|
+
MorphoBlueMORPHOUSDC_625 = 'morphobluemorphousdc_625',
|
|
48
|
+
|
|
49
|
+
// BASE
|
|
50
|
+
MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
|
|
51
|
+
MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
|
|
52
|
+
MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
|
|
53
|
+
MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
|
|
54
|
+
MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
|
|
55
|
+
MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
|
|
56
|
+
MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
|
|
57
|
+
MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
|
|
58
|
+
MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
|
|
59
|
+
MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
|
|
60
|
+
MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
|
|
61
|
+
MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
|
|
62
|
+
MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
|
|
63
|
+
MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
|
|
64
|
+
MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
|
|
65
|
+
MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
|
|
66
|
+
MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
|
|
67
|
+
MorphoBlueWETHEURC_860_Base = 'morphobluewetheurc_860_base', // WETH/EURC
|
|
68
|
+
|
|
69
|
+
// ARBITRUM
|
|
70
|
+
MorphoBlueSyrupUSDCUSDC_915_Arb = 'morphobluesyrupusdcusdc_915_arb', // syrupUSDC/USDC
|
|
71
|
+
MorphoBlueWBTCUSDC_860_Arb = 'morphobluewbtcusdc_860_arb', // WBTC/USDC
|
|
72
|
+
MorphoBlueWstEthUSDC_860_Arb = 'morphobluewstethusdc_860_arb', // wstETH/USDC
|
|
73
|
+
MorphoBlueEthUSDC_860_Arb = 'morphoblueethusdc_860_arb', // ETH/USDC
|
|
74
|
+
MorphoBluesUSDSUSDC_945_Arb = 'morphobluesusdsusdc_945_arb', // sUSDS/USDC
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export enum MorphoBlueOracleType {
|
|
78
|
+
MARKET_RATE = 'Market rate',
|
|
79
|
+
LIDO_RATE = 'Lido rate',
|
|
80
|
+
ETHENA_RATE = 'Ethena rate',
|
|
81
|
+
CONTRACT_RATE = 'Contract rate',
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface MorphoBlueMarketData {
|
|
85
|
+
chainIds: NetworkNumber[],
|
|
86
|
+
label: string,
|
|
87
|
+
shortLabel: string,
|
|
88
|
+
url: string,
|
|
89
|
+
value: MorphoBlueVersions,
|
|
90
|
+
loanToken: EthAddress,
|
|
91
|
+
collateralToken: EthAddress,
|
|
92
|
+
oracle: EthAddress,
|
|
93
|
+
oracleType: MorphoBlueOracleType,
|
|
94
|
+
irm: EthAddress,
|
|
95
|
+
lltv: number | string,
|
|
96
|
+
marketId: string,
|
|
97
|
+
// icon: Function,
|
|
98
|
+
protocolName: string,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface MorphoBlueAssetData {
|
|
102
|
+
symbol: string,
|
|
103
|
+
address: string,
|
|
104
|
+
price: string,
|
|
105
|
+
supplyRate: string,
|
|
106
|
+
borrowRate: string,
|
|
107
|
+
supplyIncentives: IncentiveData[],
|
|
108
|
+
borrowIncentives: IncentiveData[],
|
|
109
|
+
totalSupply?: string,
|
|
110
|
+
totalBorrow?: string,
|
|
111
|
+
canBeSupplied?: boolean,
|
|
112
|
+
canBeBorrowed?: boolean,
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
|
|
116
|
+
|
|
117
|
+
export interface MorphoBlueMarketInfo {
|
|
118
|
+
id: string,
|
|
119
|
+
fee: string,
|
|
120
|
+
loanToken: string,
|
|
121
|
+
collateralToken: string,
|
|
122
|
+
utillization: string,
|
|
123
|
+
oracle: string,
|
|
124
|
+
oracleType: MorphoBlueOracleType,
|
|
125
|
+
lltv: string,
|
|
126
|
+
minRatio: string,
|
|
127
|
+
assetsData: MorphoBlueAssetsData,
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface MorphoBlueAggregatedPositionData {
|
|
131
|
+
suppliedUsd: string,
|
|
132
|
+
suppliedCollateralUsd: string,
|
|
133
|
+
borrowedUsd: string,
|
|
134
|
+
borrowLimitUsd: string,
|
|
135
|
+
liquidationLimitUsd: string,
|
|
136
|
+
leftToBorrowUsd: string,
|
|
137
|
+
leftToBorrow: string,
|
|
138
|
+
netApy: string,
|
|
139
|
+
incentiveUsd: string,
|
|
140
|
+
totalInterestUsd: string,
|
|
141
|
+
ltv: string,
|
|
142
|
+
ratio: string,
|
|
143
|
+
leveragedType: string,
|
|
144
|
+
leveragedAsset?: string,
|
|
145
|
+
leveragedLsdAssetRatio?: string,
|
|
146
|
+
liquidationPrice?: string,
|
|
147
|
+
minCollRatio?: string,
|
|
148
|
+
collLiquidationRatio?: string,
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface MorphoBluePositionData {
|
|
152
|
+
usedAssets: MMUsedAssets,
|
|
153
|
+
suppliedUsd: string,
|
|
154
|
+
suppliedCollateralUsd: string,
|
|
155
|
+
borrowedUsd: string,
|
|
156
|
+
borrowLimitUsd: string,
|
|
157
|
+
liquidationLimitUsd: string,
|
|
158
|
+
leftToBorrowUsd: string,
|
|
159
|
+
leftToBorrow: string,
|
|
160
|
+
netApy: string,
|
|
161
|
+
incentiveUsd: string,
|
|
162
|
+
totalInterestUsd: string,
|
|
163
|
+
ltv: string,
|
|
164
|
+
ratio: string,
|
|
165
|
+
leveragedType: string,
|
|
166
|
+
leveragedAsset?: string,
|
|
167
|
+
leveragedLsdAssetRatio?: string,
|
|
168
|
+
liquidationPrice?: string,
|
|
169
|
+
supplyShares: string,
|
|
170
|
+
borrowShares: string,
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface MorphoBlueVault {
|
|
174
|
+
address: string,
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface MorphoBlueAllocationMarket {
|
|
178
|
+
loanAsset: { address: string },
|
|
179
|
+
collateralAsset: { address: string },
|
|
180
|
+
oracle: { address: string },
|
|
181
|
+
irmAddress: string,
|
|
182
|
+
lltv: string,
|
|
183
|
+
uniqueKey: string,
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface MorphoBluePublicAllocatorItem {
|
|
187
|
+
vault: MorphoBlueVault,
|
|
188
|
+
assets: string,
|
|
189
|
+
allocationMarket: MorphoBlueAllocationMarket,
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface MorphoBlueAllocatorMarketState {
|
|
193
|
+
borrowAssets: string,
|
|
194
|
+
supplyAssets: string,
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface MorphoBlueRealloactionMarketData {
|
|
198
|
+
reallocatableLiquidityAssets: string,
|
|
199
|
+
targetBorrowUtilization: string,
|
|
200
|
+
publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
|
|
201
|
+
state: MorphoBlueAllocatorMarketState,
|
|
202
|
+
}
|
package/src/types/portfolio.ts
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
-
import { EthAddress } from './common';
|
|
3
|
-
import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
4
|
-
import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
5
|
-
import { EulerV2PositionData, EulerV2Versions } from './euler';
|
|
6
|
-
import { FluidVaultData } from './fluid';
|
|
7
|
-
import { LiquityTroveInfo } from './liquity';
|
|
8
|
-
import { LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
|
|
9
|
-
import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
10
|
-
import { CdpData } from './maker';
|
|
11
|
-
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
-
import { SparkPositionData, SparkVersions } from './spark';
|
|
13
|
-
|
|
14
|
-
export interface PortfolioProtocolData<T> {
|
|
15
|
-
error: string,
|
|
16
|
-
data: T | null,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface PortfolioPositionsDataForAddress {
|
|
20
|
-
aaveV3: {
|
|
21
|
-
[key in AaveVersions]?: PortfolioProtocolData<AaveV3PositionData>;
|
|
22
|
-
};
|
|
23
|
-
morphoBlue: {
|
|
24
|
-
[key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBluePositionData>;
|
|
25
|
-
};
|
|
26
|
-
compoundV3: {
|
|
27
|
-
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV3PositionData>;
|
|
28
|
-
};
|
|
29
|
-
spark: {
|
|
30
|
-
[key in SparkVersions]?: PortfolioProtocolData<SparkPositionData>;
|
|
31
|
-
};
|
|
32
|
-
eulerV2: {
|
|
33
|
-
[key in EulerV2Versions]?: Record<EthAddress, PortfolioProtocolData<EulerV2PositionData>>;
|
|
34
|
-
};
|
|
35
|
-
maker: {
|
|
36
|
-
[key: string]: PortfolioProtocolData<CdpData>;
|
|
37
|
-
};
|
|
38
|
-
aaveV2: {
|
|
39
|
-
[key in AaveVersions]?: PortfolioProtocolData<AaveV2PositionData>;
|
|
40
|
-
};
|
|
41
|
-
compoundV2: {
|
|
42
|
-
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV2PositionData>;
|
|
43
|
-
};
|
|
44
|
-
liquity: PortfolioProtocolData<LiquityTroveInfo> | {};
|
|
45
|
-
crvUsd: {
|
|
46
|
-
[key in CrvUSDVersions]?: PortfolioProtocolData<CrvUSDUserData>;
|
|
47
|
-
};
|
|
48
|
-
llamaLend: {
|
|
49
|
-
[key in LlamaLendVersionsType]?: PortfolioProtocolData<LlamaLendUserData>;
|
|
50
|
-
};
|
|
51
|
-
fluid: {
|
|
52
|
-
error: string;
|
|
53
|
-
data: {
|
|
54
|
-
[key: string]: FluidVaultData;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface PortfolioPositionsData {
|
|
60
|
-
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
1
|
+
import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
+
import { EthAddress } from './common';
|
|
3
|
+
import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
4
|
+
import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
5
|
+
import { EulerV2PositionData, EulerV2Versions } from './euler';
|
|
6
|
+
import { FluidVaultData } from './fluid';
|
|
7
|
+
import { LiquityTroveInfo } from './liquity';
|
|
8
|
+
import { LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
|
|
9
|
+
import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
10
|
+
import { CdpData } from './maker';
|
|
11
|
+
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
+
import { SparkPositionData, SparkVersions } from './spark';
|
|
13
|
+
|
|
14
|
+
export interface PortfolioProtocolData<T> {
|
|
15
|
+
error: string,
|
|
16
|
+
data: T | null,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PortfolioPositionsDataForAddress {
|
|
20
|
+
aaveV3: {
|
|
21
|
+
[key in AaveVersions]?: PortfolioProtocolData<AaveV3PositionData>;
|
|
22
|
+
};
|
|
23
|
+
morphoBlue: {
|
|
24
|
+
[key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBluePositionData>;
|
|
25
|
+
};
|
|
26
|
+
compoundV3: {
|
|
27
|
+
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV3PositionData>;
|
|
28
|
+
};
|
|
29
|
+
spark: {
|
|
30
|
+
[key in SparkVersions]?: PortfolioProtocolData<SparkPositionData>;
|
|
31
|
+
};
|
|
32
|
+
eulerV2: {
|
|
33
|
+
[key in EulerV2Versions]?: Record<EthAddress, PortfolioProtocolData<EulerV2PositionData>>;
|
|
34
|
+
};
|
|
35
|
+
maker: {
|
|
36
|
+
[key: string]: PortfolioProtocolData<CdpData>;
|
|
37
|
+
};
|
|
38
|
+
aaveV2: {
|
|
39
|
+
[key in AaveVersions]?: PortfolioProtocolData<AaveV2PositionData>;
|
|
40
|
+
};
|
|
41
|
+
compoundV2: {
|
|
42
|
+
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV2PositionData>;
|
|
43
|
+
};
|
|
44
|
+
liquity: PortfolioProtocolData<LiquityTroveInfo> | {};
|
|
45
|
+
crvUsd: {
|
|
46
|
+
[key in CrvUSDVersions]?: PortfolioProtocolData<CrvUSDUserData>;
|
|
47
|
+
};
|
|
48
|
+
llamaLend: {
|
|
49
|
+
[key in LlamaLendVersionsType]?: PortfolioProtocolData<LlamaLendUserData>;
|
|
50
|
+
};
|
|
51
|
+
fluid: {
|
|
52
|
+
error: string;
|
|
53
|
+
data: {
|
|
54
|
+
[key: string]: FluidVaultData;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface PortfolioPositionsData {
|
|
60
|
+
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
61
61
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
import { MakerDsrType } from './makerDsr';
|
|
3
|
-
import { MorphoVaultType } from './morphoVaults';
|
|
4
|
-
import { SkySavingsType } from './sky';
|
|
5
|
-
import { SparkSavingsVaultType } from './sparkSavingsVaults';
|
|
6
|
-
import { YearnV3VaultType } from './yearnV3Vaults';
|
|
7
|
-
import { YearnVaultType } from './yearnVaults';
|
|
8
|
-
|
|
9
|
-
export * from './morphoVaults';
|
|
10
|
-
export * from './yearnVaults';
|
|
11
|
-
export * from './makerDsr';
|
|
12
|
-
export * from './sky';
|
|
13
|
-
export * from './sparkSavingsVaults';
|
|
14
|
-
export * from './yearnV3Vaults';
|
|
15
|
-
|
|
16
|
-
export interface SavingsVaultData {
|
|
17
|
-
poolSize: string,
|
|
18
|
-
liquidity: string,
|
|
19
|
-
supplied: Record<EthAddress, string>,
|
|
20
|
-
asset: string,
|
|
21
|
-
optionType: string,
|
|
22
|
-
}
|
|
23
|
-
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
import { MakerDsrType } from './makerDsr';
|
|
3
|
+
import { MorphoVaultType } from './morphoVaults';
|
|
4
|
+
import { SkySavingsType } from './sky';
|
|
5
|
+
import { SparkSavingsVaultType } from './sparkSavingsVaults';
|
|
6
|
+
import { YearnV3VaultType } from './yearnV3Vaults';
|
|
7
|
+
import { YearnVaultType } from './yearnVaults';
|
|
8
|
+
|
|
9
|
+
export * from './morphoVaults';
|
|
10
|
+
export * from './yearnVaults';
|
|
11
|
+
export * from './makerDsr';
|
|
12
|
+
export * from './sky';
|
|
13
|
+
export * from './sparkSavingsVaults';
|
|
14
|
+
export * from './yearnV3Vaults';
|
|
15
|
+
|
|
16
|
+
export interface SavingsVaultData {
|
|
17
|
+
poolSize: string,
|
|
18
|
+
liquidity: string,
|
|
19
|
+
supplied: Record<EthAddress, string>,
|
|
20
|
+
asset: string,
|
|
21
|
+
optionType: string,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
24
|
export type SavingsData = Partial<Record<MorphoVaultType | YearnVaultType | MakerDsrType | SkySavingsType | SparkSavingsVaultType | YearnV3VaultType, SavingsVaultData>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
|
|
3
|
-
export enum MakerDsrType {
|
|
4
|
-
MakerDsrVault = 'maker_dsr',
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface MakerDsrVault {
|
|
8
|
-
type: MakerDsrType;
|
|
9
|
-
name: string;
|
|
10
|
-
address: EthAddress;
|
|
11
|
-
asset: string;
|
|
12
|
-
deploymentBlock: number;
|
|
13
|
-
isLegacy: boolean;
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
|
|
3
|
+
export enum MakerDsrType {
|
|
4
|
+
MakerDsrVault = 'maker_dsr',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface MakerDsrVault {
|
|
8
|
+
type: MakerDsrType;
|
|
9
|
+
name: string;
|
|
10
|
+
address: EthAddress;
|
|
11
|
+
asset: string;
|
|
12
|
+
deploymentBlock: number;
|
|
13
|
+
isLegacy: boolean;
|
|
14
14
|
}
|