@defisaver/positions-sdk 2.1.161-portfolio-api-2-dev → 2.1.161-portfolio-api-3-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/cjs/aaveV2/index.js +2 -0
- package/cjs/aaveV3/index.d.ts +39 -0
- package/cjs/aaveV3/index.js +237 -2
- package/cjs/aaveV4/lend.d.ts +2 -43
- package/cjs/curveUsd/index.d.ts +5 -2
- package/cjs/curveUsd/index.js +30 -15
- package/cjs/fluid/index.d.ts +5 -0
- package/cjs/fluid/index.js +36 -1
- package/cjs/helpers/aaveHelpers/index.d.ts +9 -1
- package/cjs/helpers/aaveHelpers/index.js +26 -6
- package/cjs/helpers/aaveV4Helpers/index.js +1 -0
- package/cjs/helpers/compoundHelpers/index.js +2 -0
- package/cjs/helpers/curveUsdHelpers/index.d.ts +3 -1
- package/cjs/helpers/curveUsdHelpers/index.js +15 -2
- package/cjs/helpers/fluidHelpers/index.js +1 -0
- package/cjs/helpers/liquityV2Helpers/index.js +1 -0
- package/cjs/helpers/llamaLendHelpers/index.js +1 -0
- package/cjs/helpers/makerHelpers/index.d.ts +1 -1
- package/cjs/helpers/makerHelpers/index.js +2 -2
- package/cjs/helpers/morphoBlueHelpers/index.js +2 -0
- package/cjs/helpers/morphoMidnightHelpers/index.js +2 -0
- package/cjs/helpers/sparkHelpers/index.js +1 -0
- package/cjs/liquity/index.js +15 -2
- package/cjs/liquityV2/index.d.ts +5 -0
- package/cjs/liquityV2/index.js +37 -19
- package/cjs/maker/index.d.ts +7 -2
- package/cjs/maker/index.js +44 -12
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +3 -1
- package/cjs/markets/maker/index.d.ts +1 -0
- package/cjs/markets/maker/index.js +13 -0
- package/cjs/moneymarket/moneymarketCommonService.d.ts +9 -0
- package/cjs/moneymarket/moneymarketCommonService.js +13 -1
- package/cjs/portfolio/index.d.ts +17 -5
- package/cjs/portfolio/index.js +583 -394
- package/cjs/portfolio/lendingProtocols.d.ts +184 -0
- package/cjs/portfolio/lendingProtocols.js +196 -0
- package/cjs/savings/index.d.ts +8 -2
- package/cjs/savings/index.js +37 -5
- package/cjs/savings/morphoVaults/index.d.ts +1 -1
- package/cjs/savings/morphoVaults/index.js +56 -18
- package/cjs/savings/morphoVaults/options.d.ts +2 -0
- package/cjs/savings/morphoVaults/options.js +61 -1
- package/cjs/spark/index.js +1 -0
- package/cjs/staking/staking.d.ts +20 -0
- package/cjs/staking/staking.js +19 -1
- package/cjs/types/aave.d.ts +3 -0
- package/cjs/types/aaveV4.d.ts +45 -0
- package/cjs/types/compound.d.ts +2 -0
- package/cjs/types/curveUsd.d.ts +6 -0
- package/cjs/types/fluid.d.ts +1 -0
- package/cjs/types/liquity.d.ts +4 -0
- package/cjs/types/liquityV2.d.ts +2 -0
- package/cjs/types/maker.d.ts +4 -0
- package/cjs/types/morphoBlue.d.ts +2 -0
- package/cjs/types/morphoMidnight.d.ts +1 -0
- package/cjs/types/portfolio.d.ts +64 -6
- package/cjs/types/savings/index.d.ts +9 -1
- package/cjs/types/savings/morphoVaults.d.ts +10 -2
- package/cjs/types/savings/morphoVaults.js +9 -1
- package/cjs/types/spark.d.ts +2 -0
- package/esm/aaveV2/index.js +2 -0
- package/esm/aaveV3/index.d.ts +39 -0
- package/esm/aaveV3/index.js +231 -2
- package/esm/aaveV4/lend.d.ts +2 -43
- package/esm/curveUsd/index.d.ts +5 -2
- package/esm/curveUsd/index.js +30 -15
- package/esm/fluid/index.d.ts +5 -0
- package/esm/fluid/index.js +33 -0
- package/esm/helpers/aaveHelpers/index.d.ts +9 -1
- package/esm/helpers/aaveHelpers/index.js +23 -5
- package/esm/helpers/aaveV4Helpers/index.js +1 -0
- package/esm/helpers/compoundHelpers/index.js +2 -0
- package/esm/helpers/curveUsdHelpers/index.d.ts +3 -1
- package/esm/helpers/curveUsdHelpers/index.js +16 -3
- package/esm/helpers/fluidHelpers/index.js +1 -0
- package/esm/helpers/liquityV2Helpers/index.js +1 -0
- package/esm/helpers/llamaLendHelpers/index.js +2 -1
- package/esm/helpers/makerHelpers/index.d.ts +1 -1
- package/esm/helpers/makerHelpers/index.js +2 -2
- package/esm/helpers/morphoBlueHelpers/index.js +2 -0
- package/esm/helpers/morphoMidnightHelpers/index.js +2 -0
- package/esm/helpers/sparkHelpers/index.js +1 -0
- package/esm/liquity/index.js +16 -3
- package/esm/liquityV2/index.d.ts +5 -0
- package/esm/liquityV2/index.js +35 -18
- package/esm/maker/index.d.ts +7 -2
- package/esm/maker/index.js +44 -14
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/markets/maker/index.d.ts +1 -0
- package/esm/markets/maker/index.js +10 -0
- package/esm/moneymarket/moneymarketCommonService.d.ts +9 -0
- package/esm/moneymarket/moneymarketCommonService.js +11 -0
- package/esm/portfolio/index.d.ts +17 -5
- package/esm/portfolio/index.js +584 -398
- package/esm/portfolio/lendingProtocols.d.ts +184 -0
- package/esm/portfolio/lendingProtocols.js +189 -0
- package/esm/savings/index.d.ts +8 -2
- package/esm/savings/index.js +35 -4
- package/esm/savings/morphoVaults/index.d.ts +1 -1
- package/esm/savings/morphoVaults/index.js +57 -19
- package/esm/savings/morphoVaults/options.d.ts +2 -0
- package/esm/savings/morphoVaults/options.js +61 -1
- package/esm/spark/index.js +1 -0
- package/esm/staking/staking.d.ts +20 -0
- package/esm/staking/staking.js +17 -0
- package/esm/types/aave.d.ts +3 -0
- package/esm/types/aaveV4.d.ts +45 -0
- package/esm/types/compound.d.ts +2 -0
- package/esm/types/curveUsd.d.ts +6 -0
- package/esm/types/fluid.d.ts +1 -0
- package/esm/types/liquity.d.ts +4 -0
- package/esm/types/liquityV2.d.ts +2 -0
- package/esm/types/maker.d.ts +4 -0
- package/esm/types/morphoBlue.d.ts +2 -0
- package/esm/types/morphoMidnight.d.ts +1 -0
- package/esm/types/portfolio.d.ts +64 -6
- package/esm/types/savings/index.d.ts +9 -1
- package/esm/types/savings/morphoVaults.d.ts +10 -2
- package/esm/types/savings/morphoVaults.js +8 -0
- package/esm/types/spark.d.ts +2 -0
- package/package.json +3 -2
- package/src/aaveV2/index.ts +2 -0
- package/src/aaveV3/index.ts +291 -1
- package/src/aaveV4/lend.ts +2 -48
- package/src/curveUsd/index.ts +33 -16
- package/src/fluid/index.ts +40 -0
- package/src/helpers/aaveHelpers/index.ts +27 -7
- package/src/helpers/aaveV4Helpers/index.ts +1 -0
- package/src/helpers/compoundHelpers/index.ts +2 -0
- package/src/helpers/curveUsdHelpers/index.ts +23 -3
- package/src/helpers/fluidHelpers/index.ts +1 -0
- package/src/helpers/liquityV2Helpers/index.ts +1 -0
- package/src/helpers/llamaLendHelpers/index.ts +2 -1
- package/src/helpers/makerHelpers/index.ts +2 -1
- package/src/helpers/morphoBlueHelpers/index.ts +2 -0
- package/src/helpers/morphoMidnightHelpers/index.ts +2 -0
- package/src/helpers/sparkHelpers/index.ts +1 -0
- package/src/liquity/index.ts +17 -3
- package/src/liquityV2/index.ts +45 -19
- package/src/maker/index.ts +77 -30
- package/src/markets/index.ts +2 -1
- package/src/markets/maker/index.ts +10 -0
- package/src/moneymarket/moneymarketCommonService.ts +15 -0
- package/src/portfolio/index.ts +428 -215
- package/src/portfolio/lendingProtocols.ts +281 -0
- package/src/savings/index.ts +45 -5
- package/src/savings/morphoVaults/index.ts +73 -21
- package/src/savings/morphoVaults/options.ts +67 -1
- package/src/spark/index.ts +1 -0
- package/src/staking/staking.ts +28 -0
- package/src/types/aave.ts +4 -0
- package/src/types/aaveV4.ts +50 -0
- package/src/types/compound.ts +2 -0
- package/src/types/curveUsd.ts +7 -0
- package/src/types/fluid.ts +1 -0
- package/src/types/liquity.ts +6 -0
- package/src/types/liquityV2.ts +2 -0
- package/src/types/maker.ts +6 -0
- package/src/types/morphoBlue.ts +2 -0
- package/src/types/morphoMidnight.ts +1 -0
- package/src/types/portfolio.ts +71 -6
- package/src/types/savings/index.ts +12 -1
- package/src/types/savings/morphoVaults.ts +11 -1
- package/src/types/spark.ts +2 -0
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
MorphoVault, MorphoVaultType, MorphoVaultVersion, NetworkNumber,
|
|
3
|
+
} from '../../types';
|
|
2
4
|
|
|
3
5
|
export const MORPHO_VAULT_FLAGSHIP_ETH: MorphoVault = {
|
|
4
6
|
type: MorphoVaultType.MorphoVaultFlagshipEth,
|
|
5
7
|
name: 'Flagship ETH',
|
|
6
8
|
address: '0x38989BBA00BDF8181F4082995b3DEAe96163aC5D',
|
|
7
9
|
asset: 'WETH',
|
|
10
|
+
network: NetworkNumber.Eth,
|
|
11
|
+
version: MorphoVaultVersion.V1,
|
|
8
12
|
deploymentBlock: 18927491,
|
|
9
13
|
isLegacy: true,
|
|
10
14
|
};
|
|
@@ -14,6 +18,8 @@ export const MORPHO_VAULT_GAUNTLET_USDC_CORE: MorphoVault = {
|
|
|
14
18
|
name: 'Gauntlet USDC Core',
|
|
15
19
|
address: '0x8eB67A509616cd6A7c1B3c8C21D48FF57df3d458',
|
|
16
20
|
asset: 'USDC',
|
|
21
|
+
network: NetworkNumber.Eth,
|
|
22
|
+
version: MorphoVaultVersion.V1,
|
|
17
23
|
deploymentBlock: 19777569,
|
|
18
24
|
isLegacy: true,
|
|
19
25
|
};
|
|
@@ -23,6 +29,8 @@ export const MORPHO_VAULT_GAUNTLET_USDC_PRIME: MorphoVault = {
|
|
|
23
29
|
name: 'Gauntlet USDC Prime',
|
|
24
30
|
address: '0xdd0f28e19C1780eb6396170735D45153D261490d',
|
|
25
31
|
asset: 'USDC',
|
|
32
|
+
network: NetworkNumber.Eth,
|
|
33
|
+
version: MorphoVaultVersion.V1,
|
|
26
34
|
deploymentBlock: 19777569,
|
|
27
35
|
isLegacy: true,
|
|
28
36
|
};
|
|
@@ -32,6 +40,8 @@ export const MORPHO_VAULT_RE7_WETH: MorphoVault = {
|
|
|
32
40
|
name: 'RE7 WETH',
|
|
33
41
|
address: '0x78Fc2c2eD1A4cDb5402365934aE5648aDAd094d0',
|
|
34
42
|
asset: 'WETH',
|
|
43
|
+
network: NetworkNumber.Eth,
|
|
44
|
+
version: MorphoVaultVersion.V1,
|
|
35
45
|
deploymentBlock: 19121118,
|
|
36
46
|
isLegacy: true,
|
|
37
47
|
};
|
|
@@ -41,6 +51,8 @@ export const MORPHO_VAULT_GAUNTLET_WETH_CORE: MorphoVault = {
|
|
|
41
51
|
name: 'Gauntlet WETH Core',
|
|
42
52
|
address: '0x4881Ef0BF6d2365D3dd6499ccd7532bcdBCE0658',
|
|
43
53
|
asset: 'WETH',
|
|
54
|
+
network: NetworkNumber.Eth,
|
|
55
|
+
version: MorphoVaultVersion.V1,
|
|
44
56
|
deploymentBlock: 19541126,
|
|
45
57
|
isLegacy: true,
|
|
46
58
|
};
|
|
@@ -50,6 +62,8 @@ export const MORPHO_VAULT_GAUNTLET_WETH_PRIME: MorphoVault = {
|
|
|
50
62
|
name: 'Gauntlet WETH Prime',
|
|
51
63
|
address: '0x2371e134e3455e0593363cBF89d3b6cf53740618',
|
|
52
64
|
asset: 'WETH',
|
|
65
|
+
network: NetworkNumber.Eth,
|
|
66
|
+
version: MorphoVaultVersion.V1,
|
|
53
67
|
deploymentBlock: 19372149,
|
|
54
68
|
isLegacy: true,
|
|
55
69
|
};
|
|
@@ -59,6 +73,8 @@ export const MORPHO_VAULT_BOOSTED_USDC: MorphoVault = {
|
|
|
59
73
|
name: 'Boosted USDC',
|
|
60
74
|
address: '0xd63070114470f685b75B74D60EEc7c1113d33a3D',
|
|
61
75
|
asset: 'USDC',
|
|
76
|
+
network: NetworkNumber.Eth,
|
|
77
|
+
version: MorphoVaultVersion.V1,
|
|
62
78
|
deploymentBlock: 20377233,
|
|
63
79
|
isLegacy: true,
|
|
64
80
|
};
|
|
@@ -68,6 +84,8 @@ export const MORPHO_VAULT_FLAGSHIP_USDT: MorphoVault = {
|
|
|
68
84
|
name: 'Flagship USDT',
|
|
69
85
|
address: '0x2C25f6C25770fFEC5959D34B94Bf898865e5D6b1',
|
|
70
86
|
asset: 'USDT',
|
|
87
|
+
network: NetworkNumber.Eth,
|
|
88
|
+
version: MorphoVaultVersion.V1,
|
|
71
89
|
deploymentBlock: 19127039,
|
|
72
90
|
isLegacy: true,
|
|
73
91
|
};
|
|
@@ -77,6 +95,8 @@ export const MORPHO_VAULT_GAUNTLET_USDA_CORE: MorphoVault = {
|
|
|
77
95
|
name: 'Gauntlet USDA Core',
|
|
78
96
|
address: '0x125D41A6e5dbf455cD9Df8F80BCC6fd172D52Cc6',
|
|
79
97
|
asset: 'USDA',
|
|
98
|
+
network: NetworkNumber.Eth,
|
|
99
|
+
version: MorphoVaultVersion.V1,
|
|
80
100
|
deploymentBlock: 19633608,
|
|
81
101
|
isLegacy: true,
|
|
82
102
|
};
|
|
@@ -86,6 +106,8 @@ export const MORPHO_VAULT_GAUNTLET_USDT_PRIME: MorphoVault = {
|
|
|
86
106
|
name: 'Gauntlet USDT Prime',
|
|
87
107
|
address: '0x8CB3649114051cA5119141a34C200D65dc0Faa73',
|
|
88
108
|
asset: 'USDT',
|
|
109
|
+
network: NetworkNumber.Eth,
|
|
110
|
+
version: MorphoVaultVersion.V1,
|
|
89
111
|
deploymentBlock: 19486541,
|
|
90
112
|
isLegacy: true,
|
|
91
113
|
};
|
|
@@ -95,6 +117,8 @@ export const MORPHO_VAULT_GAUNTLET_RESOLV_USDC: MorphoVault = {
|
|
|
95
117
|
name: 'Gauntlet Resolv USDC',
|
|
96
118
|
address: '0x132E6C9C33A62D7727cd359b1f51e5B566E485Eb',
|
|
97
119
|
asset: 'USDC',
|
|
120
|
+
network: NetworkNumber.Eth,
|
|
121
|
+
version: MorphoVaultVersion.V1,
|
|
98
122
|
deploymentBlock: 21487882,
|
|
99
123
|
isLegacy: true,
|
|
100
124
|
};
|
|
@@ -106,6 +130,8 @@ export const MORPHO_VAULT_STEAKHOUSE_USDT: MorphoVault = {
|
|
|
106
130
|
name: 'Steakhouse USDT',
|
|
107
131
|
address: '0xbEef047a543E45807105E51A8BBEFCc5950fcfBa',
|
|
108
132
|
asset: 'USDT',
|
|
133
|
+
network: NetworkNumber.Eth,
|
|
134
|
+
version: MorphoVaultVersion.V1,
|
|
109
135
|
deploymentBlock: 19043398,
|
|
110
136
|
isLegacy: false,
|
|
111
137
|
};
|
|
@@ -115,6 +141,8 @@ export const MORPHO_VAULT_STEAKHOUSE_USDC: MorphoVault = {
|
|
|
115
141
|
name: 'Steakhouse USDC',
|
|
116
142
|
address: '0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB',
|
|
117
143
|
asset: 'USDC',
|
|
144
|
+
network: NetworkNumber.Eth,
|
|
145
|
+
version: MorphoVaultVersion.V1,
|
|
118
146
|
deploymentBlock: 18928285,
|
|
119
147
|
isLegacy: false,
|
|
120
148
|
};
|
|
@@ -124,6 +152,8 @@ export const MORPHO_VAULT_STEAKHOUSE_ETH: MorphoVault = {
|
|
|
124
152
|
name: 'Steakhouse WETH',
|
|
125
153
|
address: '0xBEEf050ecd6a16c4e7bfFbB52Ebba7846C4b8cD4',
|
|
126
154
|
asset: 'WETH',
|
|
155
|
+
network: NetworkNumber.Eth,
|
|
156
|
+
version: MorphoVaultVersion.V1,
|
|
127
157
|
deploymentBlock: 19380443,
|
|
128
158
|
isLegacy: false,
|
|
129
159
|
};
|
|
@@ -133,6 +163,8 @@ export const MORPHO_VAULT_STEAKHOUSE_PYUSD: MorphoVault = {
|
|
|
133
163
|
name: 'Steakhouse PYUSD',
|
|
134
164
|
address: '0xbEEF02e5E13584ab96848af90261f0C8Ee04722a',
|
|
135
165
|
asset: 'PYUSD',
|
|
166
|
+
network: NetworkNumber.Eth,
|
|
167
|
+
version: MorphoVaultVersion.V1,
|
|
136
168
|
deploymentBlock: 19043398,
|
|
137
169
|
isLegacy: false,
|
|
138
170
|
};
|
|
@@ -144,6 +176,8 @@ export const MORPHO_VAULT_SMOKEHOUSE_USDT: MorphoVault = {
|
|
|
144
176
|
name: 'Smokehouse USDT',
|
|
145
177
|
address: '0xA0804346780b4c2e3bE118ac957D1DB82F9d7484',
|
|
146
178
|
asset: 'USDT',
|
|
179
|
+
network: NetworkNumber.Eth,
|
|
180
|
+
version: MorphoVaultVersion.V1,
|
|
147
181
|
deploymentBlock: 21522238,
|
|
148
182
|
isLegacy: false,
|
|
149
183
|
};
|
|
@@ -153,6 +187,8 @@ export const MORPHO_VAULT_SMOKEHOUSE_USDC: MorphoVault = {
|
|
|
153
187
|
name: 'Smokehouse USDC',
|
|
154
188
|
address: '0xBEeFFF209270748ddd194831b3fa287a5386f5bC',
|
|
155
189
|
asset: 'USDC',
|
|
190
|
+
network: NetworkNumber.Eth,
|
|
191
|
+
version: MorphoVaultVersion.V1,
|
|
156
192
|
deploymentBlock: 21337719,
|
|
157
193
|
isLegacy: false,
|
|
158
194
|
};
|
|
@@ -162,10 +198,36 @@ export const MORPHO_VAULT_SMOKEHOUSE_DAI: MorphoVault = {
|
|
|
162
198
|
name: 'Smokehouse DAI',
|
|
163
199
|
address: '0xbeeFfF68CC520D68f82641EFF84330C631E2490E',
|
|
164
200
|
asset: 'DAI',
|
|
201
|
+
network: NetworkNumber.Eth,
|
|
202
|
+
version: MorphoVaultVersion.V1,
|
|
165
203
|
deploymentBlock: 21343808,
|
|
166
204
|
isLegacy: false,
|
|
167
205
|
};
|
|
168
206
|
|
|
207
|
+
// Vault V2
|
|
208
|
+
|
|
209
|
+
export const MORPHO_VAULT_GAUNTLET_USDG_PREMIUM: MorphoVault = {
|
|
210
|
+
type: MorphoVaultType.MorphoVaultGauntletUSDGPremium,
|
|
211
|
+
name: 'Gauntlet USDG Premium',
|
|
212
|
+
address: '0x390c1bb01F3F627144a40617e287d4cE3D5aBCfa',
|
|
213
|
+
asset: 'USDG',
|
|
214
|
+
network: NetworkNumber.Arb,
|
|
215
|
+
version: MorphoVaultVersion.V2,
|
|
216
|
+
deploymentBlock: 510799903,
|
|
217
|
+
isLegacy: false,
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export const MORPHO_VAULT_STEAKHOUSE_USDG_PRO: MorphoVault = {
|
|
221
|
+
type: MorphoVaultType.MorphoVaultSteakhouseUSDGPro,
|
|
222
|
+
name: 'Steakhouse USDG Pro',
|
|
223
|
+
address: '0xbeeFf72B77e7584a450E887125F25E8D8819016a',
|
|
224
|
+
asset: 'USDG',
|
|
225
|
+
network: NetworkNumber.Arb,
|
|
226
|
+
version: MorphoVaultVersion.V2,
|
|
227
|
+
deploymentBlock: 512247107,
|
|
228
|
+
isLegacy: false,
|
|
229
|
+
};
|
|
230
|
+
|
|
169
231
|
export const MORPHO_VAULTS: Record<MorphoVaultType, MorphoVault> = {
|
|
170
232
|
[MorphoVaultType.MorphoVaultFlagshipEth]: MORPHO_VAULT_FLAGSHIP_ETH,
|
|
171
233
|
[MorphoVaultType.MorphoVaultGauntletUSDCCore]: MORPHO_VAULT_GAUNTLET_USDC_CORE,
|
|
@@ -189,6 +251,10 @@ export const MORPHO_VAULTS: Record<MorphoVaultType, MorphoVault> = {
|
|
|
189
251
|
[MorphoVaultType.MorphoVaultSmokehouseUSDT]: MORPHO_VAULT_SMOKEHOUSE_USDT,
|
|
190
252
|
[MorphoVaultType.MorphoVaultSmokehouseUSDC]: MORPHO_VAULT_SMOKEHOUSE_USDC,
|
|
191
253
|
[MorphoVaultType.MorphoVaultSmokehouseDAI]: MORPHO_VAULT_SMOKEHOUSE_DAI,
|
|
254
|
+
|
|
255
|
+
// Vault V2
|
|
256
|
+
[MorphoVaultType.MorphoVaultGauntletUSDGPremium]: MORPHO_VAULT_GAUNTLET_USDG_PREMIUM,
|
|
257
|
+
[MorphoVaultType.MorphoVaultSteakhouseUSDGPro]: MORPHO_VAULT_STEAKHOUSE_USDG_PRO,
|
|
192
258
|
};
|
|
193
259
|
|
|
194
260
|
export const getMorphoVault = (type: MorphoVaultType): MorphoVault => MORPHO_VAULTS[type];
|
package/src/spark/index.ts
CHANGED
|
@@ -108,6 +108,7 @@ export const _getSparkMarketsData = async (provider: Client, network: NetworkNum
|
|
|
108
108
|
collateralAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].collateralAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
109
109
|
borrowAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].borrowAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
110
110
|
ltvZeroAssets: [],
|
|
111
|
+
isolated: false,
|
|
111
112
|
};
|
|
112
113
|
|
|
113
114
|
return ({
|
package/src/staking/staking.ts
CHANGED
|
@@ -137,6 +137,34 @@ export const calculateInterestEarned = (principal: string, interest: string, typ
|
|
|
137
137
|
return (+principal * (((1 + (+interest / 100) / BLOCKS_IN_A_YEAR)) ** (BLOCKS_IN_A_YEAR * interval))) - +principal; // eslint-disable-line
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Net APY for positions that have a single known borrow rate (and optionally a single supply rate)
|
|
142
|
+
* instead of per-asset `assetsData` to feed into `calculateNetApy` (Maker, crvUSD, Liquity v1).
|
|
143
|
+
* All rates are yearly percentages that are already compounded. `incentives` are extra yields
|
|
144
|
+
* (e.g. the native staking yield of the collateral) applied to their own USD base and summed into `incentiveUsd`.
|
|
145
|
+
*/
|
|
146
|
+
export const calculateNetApyFromRates = ({
|
|
147
|
+
suppliedUsd, borrowedUsd, supplyRate = '0', borrowRate = '0', incentives = [],
|
|
148
|
+
}: {
|
|
149
|
+
suppliedUsd: string,
|
|
150
|
+
borrowedUsd: string,
|
|
151
|
+
supplyRate?: string,
|
|
152
|
+
borrowRate?: string,
|
|
153
|
+
incentives?: { apy: string, amountUsd: string }[],
|
|
154
|
+
}) => {
|
|
155
|
+
const supplyInterest = new Dec(calculateInterestEarned(suppliedUsd, supplyRate, 'year', true));
|
|
156
|
+
const borrowInterest = new Dec(calculateInterestEarned(borrowedUsd, borrowRate, 'year', true));
|
|
157
|
+
const incentiveUsd = incentives
|
|
158
|
+
.reduce((acc, { apy, amountUsd }) => acc.add(calculateInterestEarned(amountUsd, apy, 'year', true)), new Dec(0))
|
|
159
|
+
.toString();
|
|
160
|
+
|
|
161
|
+
const totalInterestUsd = supplyInterest.sub(borrowInterest).add(incentiveUsd).toString();
|
|
162
|
+
const balance = new Dec(suppliedUsd).sub(borrowedUsd);
|
|
163
|
+
const netApy = balance.isZero() ? '0' : new Dec(totalInterestUsd).div(balance).times(100).toString();
|
|
164
|
+
|
|
165
|
+
return { netApy, totalInterestUsd, incentiveUsd };
|
|
166
|
+
};
|
|
167
|
+
|
|
140
168
|
export const calculateNetApy = ({
|
|
141
169
|
usedAssets, assetsData, optionalData,
|
|
142
170
|
}: { usedAssets: MMUsedAssets, assetsData: MMAssetsData, optionalData?: any }) => {
|
package/src/types/aave.ts
CHANGED
|
@@ -49,6 +49,7 @@ export interface EModeCategoryData {
|
|
|
49
49
|
borrowAssets: string[],
|
|
50
50
|
ltvzeroBitmap?: string,
|
|
51
51
|
ltvZeroAssets: string[],
|
|
52
|
+
isolated: boolean,
|
|
52
53
|
}
|
|
53
54
|
export interface EModeCategoryDataMapping {
|
|
54
55
|
enteringTerms: boolean[],
|
|
@@ -155,6 +156,8 @@ export interface AavePositionData extends MMPositionData, AavePositionAggregated
|
|
|
155
156
|
collRatio: string,
|
|
156
157
|
// Safety ratio as evaluated by automation bots (LTV-0 collateral credited at LLTV - 5%). Aave v3 only.
|
|
157
158
|
safetyRatioWithLtvZeroFallback?: string,
|
|
159
|
+
// Normalised safety ratio (100 = liquidation on every protocol). Aave v3: the LTV-0 fallback ratio, Aave v2: `ratio`.
|
|
160
|
+
safetyRatio?: string,
|
|
158
161
|
suppliedUsd: string,
|
|
159
162
|
borrowedUsd: string,
|
|
160
163
|
borrowLimitUsd: string,
|
|
@@ -194,6 +197,7 @@ export interface AaveV3AggregatedPositionData {
|
|
|
194
197
|
collRatio: string,
|
|
195
198
|
borrowLimitWithLtvZeroFallbackUsd: string,
|
|
196
199
|
safetyRatioWithLtvZeroFallback: string,
|
|
200
|
+
safetyRatio: string,
|
|
197
201
|
netApy: string,
|
|
198
202
|
incentiveUsd: string,
|
|
199
203
|
totalInterestUsd: string,
|
package/src/types/aaveV4.ts
CHANGED
|
@@ -183,6 +183,7 @@ export interface AaveV4AggregatedPositionData {
|
|
|
183
183
|
leftToBorrowUsd: string,
|
|
184
184
|
ratio: string,
|
|
185
185
|
collRatio: string,
|
|
186
|
+
safetyRatio: string,
|
|
186
187
|
liqRatio: string,
|
|
187
188
|
liqPercent: string,
|
|
188
189
|
leveragedType: LeverageType,
|
|
@@ -206,3 +207,52 @@ export interface AaveV4AccountData extends AaveV4AggregatedPositionData {
|
|
|
206
207
|
healthFactor: string,
|
|
207
208
|
riskPremiumBps: number,
|
|
208
209
|
}
|
|
210
|
+
|
|
211
|
+
/** One Aave V4 tokenized spoke (Lend vault) as the view contract returns it for a user. */
|
|
212
|
+
export interface AaveV4TokenizationSpokeData {
|
|
213
|
+
underlyingAsset: EthAddress;
|
|
214
|
+
assetId: string;
|
|
215
|
+
decimals: number;
|
|
216
|
+
spoke: EthAddress;
|
|
217
|
+
spokeActive: boolean;
|
|
218
|
+
spokeHalted: boolean;
|
|
219
|
+
spokeDepositCap: string;
|
|
220
|
+
spokeTotalAssets: string;
|
|
221
|
+
spokeTotalShares: string;
|
|
222
|
+
hub: EthAddress;
|
|
223
|
+
hubLiquidity: string;
|
|
224
|
+
hubDrawnRate: string;
|
|
225
|
+
convertToShares: string;
|
|
226
|
+
convertToAssets: string;
|
|
227
|
+
user: EthAddress;
|
|
228
|
+
userSuppliedAssets: string;
|
|
229
|
+
userSuppliedShares: string;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** Parsed tokenization spoke data with human-readable supplied amounts for display */
|
|
233
|
+
export interface AaveV4TokenizationSpokeDataParsed {
|
|
234
|
+
vaultAddress: EthAddress;
|
|
235
|
+
key: string | null;
|
|
236
|
+
symbol: string;
|
|
237
|
+
hubKey: string;
|
|
238
|
+
// ---- Spoke ----
|
|
239
|
+
spokeActive: boolean;
|
|
240
|
+
spokeHalted: boolean;
|
|
241
|
+
/** Deposit cap in asset units (wei string) */
|
|
242
|
+
spokeDepositCap: string;
|
|
243
|
+
/** Total assets currently in spoke in asset units (wei string) */
|
|
244
|
+
spokeTotalAssets: string;
|
|
245
|
+
// ---- Hub ----
|
|
246
|
+
/** Available hub liquidity in asset units (wei string) */
|
|
247
|
+
hubLiquidity: string;
|
|
248
|
+
/** The conversion rate from assets to shares expressed in asset units. */
|
|
249
|
+
convertToShares: string;
|
|
250
|
+
// ---- User ----
|
|
251
|
+
userSuppliedAssetsEth: string;
|
|
252
|
+
userSuppliedSharesEth: string;
|
|
253
|
+
userSuppliedAssets: string;
|
|
254
|
+
userSuppliedShares: string;
|
|
255
|
+
underlyingAsset: EthAddress;
|
|
256
|
+
spoke: EthAddress;
|
|
257
|
+
decimals: number;
|
|
258
|
+
}
|
package/src/types/compound.ts
CHANGED
|
@@ -128,6 +128,7 @@ export interface CompoundAggregatedPositionData {
|
|
|
128
128
|
leftToBorrowUsd: string,
|
|
129
129
|
ratio: string,
|
|
130
130
|
collRatio: string,
|
|
131
|
+
safetyRatio: string,
|
|
131
132
|
netApy: string,
|
|
132
133
|
incentiveUsd: string,
|
|
133
134
|
totalInterestUsd: string,
|
|
@@ -148,6 +149,7 @@ export interface CompoundAggregatedPositionData {
|
|
|
148
149
|
export interface CompoundPositionData extends MMPositionData {
|
|
149
150
|
ratio: string,
|
|
150
151
|
minRatio: string,
|
|
152
|
+
safetyRatio?: string,
|
|
151
153
|
suppliedUsd: string,
|
|
152
154
|
borrowedUsd: string,
|
|
153
155
|
borrowLimitUsd: string,
|
package/src/types/curveUsd.ts
CHANGED
|
@@ -83,6 +83,10 @@ export interface CrvUSDAggregatedPositionData {
|
|
|
83
83
|
collFactor: string,
|
|
84
84
|
leveragedType: LeverageType,
|
|
85
85
|
exposure: string,
|
|
86
|
+
// Yearly net return (%) on the position's equity: market borrow rate on crvUSD debt vs native yield of staked collateral.
|
|
87
|
+
netApy: string,
|
|
88
|
+
totalInterestUsd: string,
|
|
89
|
+
incentiveUsd: string,
|
|
86
90
|
leveragedAsset?: string,
|
|
87
91
|
liquidationPrice?: string,
|
|
88
92
|
}
|
|
@@ -131,6 +135,9 @@ export interface CrvUSDUserData extends CrvUSDPositionAggregatedFields {
|
|
|
131
135
|
collateralPrice: string,
|
|
132
136
|
collRatio: string,
|
|
133
137
|
exposure: string,
|
|
138
|
+
netApy: string,
|
|
139
|
+
totalInterestUsd: string,
|
|
140
|
+
incentiveUsd: string,
|
|
134
141
|
// Fields of crvUSDView's userData that _getCurveUsdUserData spreads in unconverted. Optional, so objects built by
|
|
135
142
|
// hand still type-check.
|
|
136
143
|
marketCollateralAmount?: bigint,
|
package/src/types/fluid.ts
CHANGED
package/src/types/liquity.ts
CHANGED
|
@@ -26,9 +26,15 @@ export interface LiquityTroveInfo {
|
|
|
26
26
|
totalETH: string,
|
|
27
27
|
totalLUSD: string,
|
|
28
28
|
minCollateralRatio: number,
|
|
29
|
+
// Collateral ratio rebased so 100 sits on `minCollateralRatio` (normalised safety ratio).
|
|
30
|
+
safetyRatio: string,
|
|
29
31
|
priceForRecovery: string,
|
|
30
32
|
debtInFront: string,
|
|
31
33
|
exposure: string,
|
|
34
|
+
// Always '0' for Liquity v1: LUSD debt is interest free (one-off borrowing fee only) and ETH collateral earns no yield.
|
|
35
|
+
netApy: string,
|
|
36
|
+
totalInterestUsd: string,
|
|
37
|
+
incentiveUsd: string,
|
|
32
38
|
}
|
|
33
39
|
/** LQTY staking and the LUSD stability pool deposit of an address, from getLiquityStakingData. */
|
|
34
40
|
export interface LiquityStakingData {
|
package/src/types/liquityV2.ts
CHANGED
|
@@ -104,6 +104,7 @@ export interface LiquityV2AggregatedTroveData {
|
|
|
104
104
|
liquidationPrice: string,
|
|
105
105
|
ratio: string,
|
|
106
106
|
collRatio: string,
|
|
107
|
+
safetyRatio: string,
|
|
107
108
|
exposure: string,
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -112,6 +113,7 @@ export interface LiquityV2TroveData {
|
|
|
112
113
|
troveId: string,
|
|
113
114
|
ratio: string,
|
|
114
115
|
collRatio: string,
|
|
116
|
+
safetyRatio?: string,
|
|
115
117
|
liqRatio: string,
|
|
116
118
|
borrowLimitRatio: string,
|
|
117
119
|
interestRate: string,
|
package/src/types/maker.ts
CHANGED
|
@@ -47,6 +47,8 @@ export interface CdpData {
|
|
|
47
47
|
debtAssetMarketPrice: string,
|
|
48
48
|
liquidationPrice: string,
|
|
49
49
|
ratio: string,
|
|
50
|
+
// Collateral ratio rebased so 100 sits on `liqPercent` (normalised safety ratio).
|
|
51
|
+
safetyRatio: string,
|
|
50
52
|
liqRatio: string,
|
|
51
53
|
liqPercent: number,
|
|
52
54
|
assetPrice: string,
|
|
@@ -62,4 +64,8 @@ export interface CdpData {
|
|
|
62
64
|
liquidationFee: string,
|
|
63
65
|
lastUpdated: number,
|
|
64
66
|
exposure: string,
|
|
67
|
+
// Yearly net return (%) on the vault's equity: stability fee on DAI debt vs native yield of staked collateral.
|
|
68
|
+
netApy: string,
|
|
69
|
+
totalInterestUsd: string,
|
|
70
|
+
incentiveUsd: string,
|
|
65
71
|
}
|
package/src/types/morphoBlue.ts
CHANGED
|
@@ -206,6 +206,7 @@ export interface MorphoBlueAggregatedPositionData {
|
|
|
206
206
|
totalInterestUsd: string,
|
|
207
207
|
ltv: string,
|
|
208
208
|
ratio: string,
|
|
209
|
+
safetyRatio: string, // borrowLimitUsd / borrowedUsd as a percentage (100 = liquidation)
|
|
209
210
|
leveragedType: LeverageType,
|
|
210
211
|
leveragedAsset?: string,
|
|
211
212
|
currentVolatilePairRatio?: string,
|
|
@@ -229,6 +230,7 @@ export interface MorphoBluePositionData {
|
|
|
229
230
|
totalInterestUsd: string,
|
|
230
231
|
ltv: string,
|
|
231
232
|
ratio: string,
|
|
233
|
+
safetyRatio?: string,
|
|
232
234
|
leveragedType: LeverageType,
|
|
233
235
|
leveragedAsset?: string,
|
|
234
236
|
currentVolatilePairRatio?: string,
|
|
@@ -191,6 +191,7 @@ export interface MorphoMidnightAggregatedPositionData {
|
|
|
191
191
|
ltv: string,
|
|
192
192
|
ratio: string, // health ratio as a percentage (from MidnightView.ratio, 1e18-scaled)
|
|
193
193
|
healthRatio: string, // liquidationLimitUsd / borrowedUsd
|
|
194
|
+
safetyRatio: string, // borrowLimitUsd / borrowedUsd as a percentage (100 = liquidation)
|
|
194
195
|
leveragedType: LeverageType,
|
|
195
196
|
leveragedAsset?: string,
|
|
196
197
|
currentVolatilePairRatio?: string,
|
package/src/types/portfolio.ts
CHANGED
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
CompoundV2MarketsData, CompoundV2PositionData, CompoundV3MarketsData, CompoundV3PositionData, CompoundVersions,
|
|
17
17
|
} from './compound';
|
|
18
18
|
import { CrvUSDGlobalMarketData, CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
19
|
-
import { FluidEarnPositionData, FluidVaultData } from './fluid';
|
|
19
|
+
import { FluidEarnPositionData, FluidMarketData, FluidVaultData } from './fluid';
|
|
20
20
|
import { LiquityStakingData, LiquityTroveInfo } from './liquity';
|
|
21
21
|
import {
|
|
22
22
|
LiquityV2MarketData, LiquityV2SBoldYBoldData, LiquityV2StakingData, LiquityV2TroveData, LiquityV2Versions,
|
|
23
23
|
} from './liquityV2';
|
|
24
24
|
import { LlamaLendGlobalMarketData, LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
25
|
-
import { CdpData } from './maker';
|
|
25
|
+
import { CdpData, IlkInfo } from './maker';
|
|
26
26
|
import {
|
|
27
27
|
MorphoBlueEarnData, MorphoBlueMarketInfo, MorphoBluePositionData, MorphoBlueVersions,
|
|
28
28
|
} from './morphoBlue';
|
|
@@ -40,12 +40,27 @@ export interface PortfolioProtocolError {
|
|
|
40
40
|
data: null,
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
/** What getPortfolioData reads besides
|
|
43
|
+
/** What getPortfolioData reads besides markets. */
|
|
44
44
|
export interface PortfolioDataOptions {
|
|
45
|
-
/**
|
|
45
|
+
/** positions (lending); default true. With false it comes back as {} and no lending position is read. */
|
|
46
|
+
positions?: boolean,
|
|
47
|
+
/** stakingPositions; default true. With false it comes back as {} and no staking source is read. */
|
|
46
48
|
staking?: boolean,
|
|
47
|
-
/** rewardsData;
|
|
49
|
+
/** rewardsData; default true. With false it comes back as {} and no rewards source is read. */
|
|
48
50
|
rewards?: boolean,
|
|
51
|
+
/**
|
|
52
|
+
* Liquity V2 troves in positions[address].liquityV2; default false, as the DeFi Saver app reads them on its own.
|
|
53
|
+
* Mainnet only: elsewhere liquityV2 is {}. Needs positions.
|
|
54
|
+
*/
|
|
55
|
+
liquityV2?: boolean,
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** One Liquity V2 market's troves of an address, by trove id — with an error when the ids or any trove failed to load. */
|
|
59
|
+
export interface PortfolioLiquityV2Troves {
|
|
60
|
+
error: string,
|
|
61
|
+
data: {
|
|
62
|
+
[troveId: string]: LiquityV2TroveData;
|
|
63
|
+
},
|
|
49
64
|
}
|
|
50
65
|
|
|
51
66
|
export interface PortfolioPositionsDataForAddress {
|
|
@@ -89,6 +104,10 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
89
104
|
aaveV4: {
|
|
90
105
|
[key in AaveV4SpokesType]?: PortfolioProtocolData<AaveV4AccountData>;
|
|
91
106
|
};
|
|
107
|
+
/** Only with the liquityV2 option. Every trove the address holds, by market. */
|
|
108
|
+
liquityV2?: {
|
|
109
|
+
[key in LiquityV2Versions]?: PortfolioLiquityV2Troves;
|
|
110
|
+
};
|
|
92
111
|
}
|
|
93
112
|
|
|
94
113
|
export interface PortfolioPositionsData {
|
|
@@ -162,4 +181,50 @@ export interface PortfolioMarketsData {
|
|
|
162
181
|
llamaLendMarketsData: Record<string, LlamaLendGlobalMarketData>;
|
|
163
182
|
liquityV2MarketsData: Record<string, LiquityV2MarketData>;
|
|
164
183
|
aaveV4SpokesData: Record<string, AaveV4SpokeData>;
|
|
165
|
-
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* The `markets` getShifterPortfolioData returns: the portfolio's markets, plus Fluid's and Maker's, which the shifter
|
|
188
|
+
* offers as destinations. Kept apart from PortfolioMarketsData, which getPortfolioData does not fill these into.
|
|
189
|
+
*/
|
|
190
|
+
export interface ShifterPortfolioMarketsData extends PortfolioMarketsData {
|
|
191
|
+
fluidMarketsData: Record<string, FluidMarketData>;
|
|
192
|
+
makerMarketsData: Record<string, IlkInfo>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** The markets that could not be read, by their key in PortfolioMarketsData, then by market or spoke: the error. */
|
|
196
|
+
export type PortfolioMarketsErrors = {
|
|
197
|
+
[key in keyof PortfolioMarketsData]?: Record<string, string>;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* What the portfolio fetch could not read and has no `{ error, data }` entry of its own to report it in. A key is
|
|
202
|
+
* present only when something under it failed; {} when everything was read.
|
|
203
|
+
*/
|
|
204
|
+
export interface PortfolioErrors {
|
|
205
|
+
/** Markets missing from `markets`; every position on such a market is an entry with an error. */
|
|
206
|
+
markets?: PortfolioMarketsErrors;
|
|
207
|
+
/** Addresses whose Maker vault list could not be read: their `maker` is {}, which would otherwise read as "no vaults". */
|
|
208
|
+
makerCdps?: Record<EthAddress, string>;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** getPortfolioMarketsData's result. */
|
|
212
|
+
export interface PortfolioMarketsResult {
|
|
213
|
+
/** Every market read; one that failed is missing and named in `errors`. */
|
|
214
|
+
markets: PortfolioMarketsData;
|
|
215
|
+
errors: PortfolioMarketsErrors;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** getPortfolioUserData's result: what is read per address. */
|
|
219
|
+
export interface PortfolioUserData {
|
|
220
|
+
positions: PortfolioPositionsData;
|
|
221
|
+
stakingPositions: PortfolioStakingPositionsData;
|
|
222
|
+
rewardsData: PortfolioRewardsData;
|
|
223
|
+
errors: Pick<PortfolioErrors, 'makerCdps'>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** getPortfolioData's result. */
|
|
227
|
+
export interface PortfolioData extends Omit<PortfolioUserData, 'errors'> {
|
|
228
|
+
markets: PortfolioMarketsData;
|
|
229
|
+
errors: PortfolioErrors;
|
|
230
|
+
}
|
|
@@ -23,4 +23,15 @@ export interface SavingsVaultData {
|
|
|
23
23
|
optionType: string,
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
/** The key of every savings vault getSavingsData reads. */
|
|
27
|
+
export type SavingsVaultKey = MorphoVaultType | YearnVaultType | MakerDsrType | SkySavingsType | SparkSavingsVaultType | SummerVaultType | YearnV3VaultType;
|
|
28
|
+
|
|
29
|
+
export type SavingsData = Partial<Record<SavingsVaultKey, SavingsVaultData>>;
|
|
30
|
+
|
|
31
|
+
/** Why each vault that was read for a network came back without data. */
|
|
32
|
+
export type SavingsErrors = Partial<Record<SavingsVaultKey, string>>;
|
|
33
|
+
|
|
34
|
+
export interface SavingsDataWithErrors {
|
|
35
|
+
data: SavingsData,
|
|
36
|
+
errors: SavingsErrors,
|
|
37
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
1
|
+
import { EthAddress, NetworkNumber } from '../common';
|
|
2
2
|
|
|
3
3
|
export enum MorphoVaultType {
|
|
4
4
|
MorphoVaultFlagshipEth = 'morpho_vault_flagship_eth',
|
|
@@ -21,6 +21,14 @@ export enum MorphoVaultType {
|
|
|
21
21
|
MorphoVaultSmokehouseUSDT = 'morpho_vault_smokehouse_usdt',
|
|
22
22
|
MorphoVaultSmokehouseUSDC = 'morpho_vault_smokehouse_usdc',
|
|
23
23
|
MorphoVaultSmokehouseDAI = 'morpho_vault_smokehouse_dai',
|
|
24
|
+
// Vault V2
|
|
25
|
+
MorphoVaultGauntletUSDGPremium = 'morpho_vault_gauntlet_usdg_premium',
|
|
26
|
+
MorphoVaultSteakhouseUSDGPro = 'morpho_vault_steakhouse_usdg_pro',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum MorphoVaultVersion {
|
|
30
|
+
V1 = 1,
|
|
31
|
+
V2 = 2,
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
export interface MorphoVault {
|
|
@@ -28,6 +36,8 @@ export interface MorphoVault {
|
|
|
28
36
|
name: string;
|
|
29
37
|
address: EthAddress;
|
|
30
38
|
asset: string;
|
|
39
|
+
network: NetworkNumber;
|
|
40
|
+
version: MorphoVaultVersion;
|
|
31
41
|
deploymentBlock: number;
|
|
32
42
|
isLegacy: boolean;
|
|
33
43
|
}
|
package/src/types/spark.ts
CHANGED
|
@@ -115,6 +115,7 @@ export interface SparkAggregatedPositionData {
|
|
|
115
115
|
leftToBorrowUsd: string,
|
|
116
116
|
ratio: string,
|
|
117
117
|
collRatio: string,
|
|
118
|
+
safetyRatio: string,
|
|
118
119
|
netApy: string,
|
|
119
120
|
incentiveUsd: string,
|
|
120
121
|
totalInterestUsd: string,
|
|
@@ -143,6 +144,7 @@ export interface SparkPositionData extends MMPositionData, SparkPositionAggregat
|
|
|
143
144
|
ratio: string,
|
|
144
145
|
minRatio: string,
|
|
145
146
|
collRatio: string,
|
|
147
|
+
safetyRatio?: string,
|
|
146
148
|
suppliedUsd: string,
|
|
147
149
|
borrowedUsd: string,
|
|
148
150
|
borrowLimitUsd: string,
|