@defisaver/positions-sdk 2.1.52-dev → 2.1.52-dev-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/cjs/fluid/index.d.ts +6 -6
- package/cjs/helpers/aaveHelpers/index.js +14 -9
- package/cjs/helpers/compoundHelpers/index.js +15 -18
- package/cjs/helpers/eulerHelpers/index.d.ts +2 -2
- package/cjs/helpers/eulerHelpers/index.js +21 -13
- package/cjs/helpers/fluidHelpers/index.js +16 -5
- package/cjs/helpers/morphoBlueHelpers/index.js +15 -5
- package/cjs/helpers/sparkHelpers/index.d.ts +2 -2
- package/cjs/helpers/sparkHelpers/index.js +15 -5
- package/cjs/moneymarket/moneymarketCommonService.d.ts +3 -3
- package/cjs/moneymarket/moneymarketCommonService.js +7 -14
- package/cjs/types/aave.d.ts +2 -3
- package/cjs/types/common.d.ts +7 -0
- package/cjs/types/common.js +9 -1
- package/cjs/types/compound.d.ts +3 -3
- package/cjs/types/curveUsd.d.ts +2 -2
- package/cjs/types/euler.d.ts +3 -3
- package/cjs/types/fluid.d.ts +3 -3
- package/cjs/types/liquityV2.d.ts +3 -3
- package/cjs/types/llamaLend.d.ts +2 -2
- package/cjs/types/morphoBlue.d.ts +5 -5
- package/cjs/types/spark.d.ts +3 -3
- package/esm/fluid/index.d.ts +6 -6
- package/esm/helpers/aaveHelpers/index.js +14 -9
- package/esm/helpers/compoundHelpers/index.js +16 -19
- package/esm/helpers/eulerHelpers/index.d.ts +2 -2
- package/esm/helpers/eulerHelpers/index.js +21 -13
- package/esm/helpers/fluidHelpers/index.js +16 -5
- package/esm/helpers/morphoBlueHelpers/index.js +16 -6
- package/esm/helpers/sparkHelpers/index.d.ts +2 -2
- package/esm/helpers/sparkHelpers/index.js +16 -6
- package/esm/moneymarket/moneymarketCommonService.d.ts +3 -3
- package/esm/moneymarket/moneymarketCommonService.js +7 -14
- package/esm/types/aave.d.ts +2 -3
- package/esm/types/common.d.ts +7 -0
- package/esm/types/common.js +8 -0
- package/esm/types/compound.d.ts +3 -3
- package/esm/types/curveUsd.d.ts +2 -2
- package/esm/types/euler.d.ts +3 -3
- package/esm/types/fluid.d.ts +3 -3
- package/esm/types/fluid.js +1 -1
- package/esm/types/liquityV2.d.ts +3 -3
- package/esm/types/llamaLend.d.ts +2 -2
- package/esm/types/morphoBlue.d.ts +5 -5
- package/esm/types/spark.d.ts +3 -3
- package/package.json +1 -1
- package/src/helpers/aaveHelpers/index.ts +15 -10
- package/src/helpers/compoundHelpers/index.ts +16 -23
- package/src/helpers/eulerHelpers/index.ts +21 -14
- package/src/helpers/fluidHelpers/index.ts +15 -6
- package/src/helpers/morphoBlueHelpers/index.ts +15 -6
- package/src/helpers/sparkHelpers/index.ts +18 -7
- package/src/moneymarket/moneymarketCommonService.ts +8 -16
- package/src/types/aave.ts +2 -2
- package/src/types/common.ts +8 -0
- package/src/types/compound.ts +3 -2
- package/src/types/curveUsd.ts +2 -2
- package/src/types/euler.ts +3 -2
- package/src/types/fluid.ts +5 -3
- package/src/types/liquityV2.ts +5 -3
- package/src/types/llamaLend.ts +4 -2
- package/src/types/morphoBlue.ts +5 -5
- package/src/types/spark.ts +3 -2
package/cjs/fluid/index.d.ts
CHANGED
|
@@ -130,10 +130,10 @@ export declare const _getUserPositions: (provider: PublicClient, network: Networ
|
|
|
130
130
|
collRatio: string;
|
|
131
131
|
minRatio: string;
|
|
132
132
|
totalInterestUsd: string;
|
|
133
|
-
leveragedType?:
|
|
133
|
+
leveragedType?: import("../types/common").LeverageType;
|
|
134
134
|
leveragedAsset?: string;
|
|
135
135
|
liquidationPrice?: string;
|
|
136
|
-
|
|
136
|
+
currentVolatilePairRatio?: string;
|
|
137
137
|
minCollRatio?: string;
|
|
138
138
|
collLiquidationRatio?: string;
|
|
139
139
|
owner: string;
|
|
@@ -161,10 +161,10 @@ export declare const getUserPositions: (provider: EthereumProvider, network: Net
|
|
|
161
161
|
collRatio: string;
|
|
162
162
|
minRatio: string;
|
|
163
163
|
totalInterestUsd: string;
|
|
164
|
-
leveragedType?:
|
|
164
|
+
leveragedType?: import("../types/common").LeverageType;
|
|
165
165
|
leveragedAsset?: string;
|
|
166
166
|
liquidationPrice?: string;
|
|
167
|
-
|
|
167
|
+
currentVolatilePairRatio?: string;
|
|
168
168
|
minCollRatio?: string;
|
|
169
169
|
collLiquidationRatio?: string;
|
|
170
170
|
owner: string;
|
|
@@ -192,10 +192,10 @@ export declare const _getUserPositionsPortfolio: (provider: PublicClient, networ
|
|
|
192
192
|
collRatio: string;
|
|
193
193
|
minRatio: string;
|
|
194
194
|
totalInterestUsd: string;
|
|
195
|
-
leveragedType?:
|
|
195
|
+
leveragedType?: import("../types/common").LeverageType;
|
|
196
196
|
leveragedAsset?: string;
|
|
197
197
|
liquidationPrice?: string;
|
|
198
|
-
|
|
198
|
+
currentVolatilePairRatio?: string;
|
|
199
199
|
minCollRatio?: string;
|
|
200
200
|
collLiquidationRatio?: string;
|
|
201
201
|
owner: string;
|
|
@@ -31,6 +31,7 @@ const utils_1 = require("../../services/utils");
|
|
|
31
31
|
const moneymarket_1 = require("../../moneymarket");
|
|
32
32
|
const staking_1 = require("../../staking");
|
|
33
33
|
const constants_1 = require("../../constants");
|
|
34
|
+
const common_1 = require("../../types/common");
|
|
34
35
|
const contracts_1 = require("../../contracts");
|
|
35
36
|
const viem_1 = require("../../services/viem");
|
|
36
37
|
exports.AAVE_V3_MARKETS = [types_1.AaveVersions.AaveV3, types_1.AaveVersions.AaveV3Lido, types_1.AaveVersions.AaveV3Etherfi];
|
|
@@ -103,18 +104,22 @@ const aaveAnyGetAggregatedPositionData = (_a) => {
|
|
|
103
104
|
payload.liquidationPrice = '';
|
|
104
105
|
if (leveragedType !== '') {
|
|
105
106
|
let assetPrice = data.assetsData[leveragedAsset].price;
|
|
106
|
-
if (leveragedType ===
|
|
107
|
-
// Treat ETH like a stablecoin in a long stETH position
|
|
108
|
-
payload.leveragedLsdAssetRatio = new decimal_js_1.default(assetsData[leveragedAsset].price).div(assetsData.ETH.price).toDP(18).toString();
|
|
109
|
-
assetPrice = new decimal_js_1.default(assetPrice).div(assetsData.ETH.price).toString();
|
|
110
|
-
}
|
|
111
|
-
if (leveragedType === 'volatile-pair') {
|
|
107
|
+
if (leveragedType === common_1.LeverageType.VolatilePair) {
|
|
112
108
|
const borrowedAsset = Object.values(usedAssets).find(({ borrowedUsd }) => +borrowedUsd > 0);
|
|
113
109
|
const borrowedAssetPrice = data.assetsData[borrowedAsset.symbol].price;
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
const leveragedAssetPrice = data.assetsData[leveragedAsset].price;
|
|
111
|
+
const isReverse = new decimal_js_1.default(leveragedAssetPrice).lt(borrowedAssetPrice);
|
|
112
|
+
if (isReverse) {
|
|
113
|
+
payload.leveragedType = common_1.LeverageType.VolatilePairReverse;
|
|
114
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(borrowedAssetPrice).div(leveragedAssetPrice).toDP(18).toString();
|
|
115
|
+
assetPrice = new decimal_js_1.default(borrowedAssetPrice).div(assetPrice).toString();
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
assetPrice = new decimal_js_1.default(assetPrice).div(borrowedAssetPrice).toString();
|
|
119
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(leveragedAssetPrice).div(borrowedAssetPrice).toDP(18).toString();
|
|
120
|
+
}
|
|
116
121
|
}
|
|
117
|
-
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
122
|
+
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(payload.leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
118
123
|
}
|
|
119
124
|
payload.minCollRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
120
125
|
payload.collLiquidationRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
@@ -150,28 +150,25 @@ const getCompoundV3AggregatedData = (_a) => {
|
|
|
150
150
|
if (leveragedType !== '') {
|
|
151
151
|
payload.leveragedAsset = leveragedAsset;
|
|
152
152
|
let assetPrice = assetsData[leveragedAsset].price;
|
|
153
|
-
if (leveragedType ===
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
if (leveragedType === common_1.LeverageType.VolatilePair) {
|
|
154
|
+
const borrowedAsset = Object.values(usedAssets).find(({ borrowedUsd }) => +borrowedUsd > 0);
|
|
155
|
+
const borrowedAssetPrice = assetsData[borrowedAsset.symbol].price;
|
|
156
|
+
const leveragedAssetPrice = assetsData[leveragedAsset].price;
|
|
157
|
+
const isReverse = new decimal_js_1.default(leveragedAssetPrice).lt(borrowedAssetPrice);
|
|
158
|
+
if (isReverse) {
|
|
159
|
+
payload.leveragedType = common_1.LeverageType.VolatilePairReverse;
|
|
160
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(borrowedAssetPrice).div(leveragedAssetPrice).toDP(18).toString();
|
|
161
|
+
assetPrice = new decimal_js_1.default(borrowedAssetPrice).div(assetPrice).toString();
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
assetPrice = new decimal_js_1.default(assetPrice).div(borrowedAssetPrice).toString();
|
|
165
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(leveragedAssetPrice).div(borrowedAssetPrice).toDP(18).toString();
|
|
166
|
+
}
|
|
156
167
|
}
|
|
157
|
-
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
168
|
+
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(payload.leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
158
169
|
}
|
|
159
170
|
payload.minCollRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
160
171
|
payload.collLiquidationRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
161
|
-
// TO DO: handle strategies
|
|
162
|
-
/* const subscribedStrategies = rest.compoundStrategies
|
|
163
|
-
? compoundV3GetSubscribedStrategies({ selectedMarket, compoundStrategies: rest.compoundStrategies })
|
|
164
|
-
: []; */
|
|
165
|
-
// TODO possibly move to global helper, since every protocol has the same graphData?
|
|
166
|
-
// payload.ratioTooLow = false;
|
|
167
|
-
// payload.ratioTooHigh = false;
|
|
168
|
-
// TO DO: handle strategies
|
|
169
|
-
/* if (subscribedStrategies.length) {
|
|
170
|
-
subscribedStrategies.forEach(({ graphData }) => {
|
|
171
|
-
payload.ratioTooLow = parseFloat(payload.ratio) < parseFloat(graphData.minRatio);
|
|
172
|
-
payload.ratioTooHigh = graphData.boostEnabled && parseFloat(payload.ratio) > parseFloat(graphData.maxRatio);
|
|
173
|
-
});
|
|
174
|
-
} */
|
|
175
172
|
return payload;
|
|
176
173
|
};
|
|
177
174
|
exports.getCompoundV3AggregatedData = getCompoundV3AggregatedData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EthAddress, EthereumProvider, NetworkNumber } from '../../types/common';
|
|
1
|
+
import { EthAddress, EthereumProvider, LeverageType, NetworkNumber } from '../../types/common';
|
|
2
2
|
import { EulerV2AggregatedPositionData, EulerV2AssetsData, EulerV2UsedAssets } from '../../types';
|
|
3
3
|
export declare const isLeveragedPos: (usedAssets: EulerV2UsedAssets, dustLimit?: number) => {
|
|
4
|
-
leveragedType:
|
|
4
|
+
leveragedType: LeverageType;
|
|
5
5
|
leveragedAsset: string;
|
|
6
6
|
leveragedVault: string;
|
|
7
7
|
};
|
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.getEulerV2SubAccounts = exports.getApyAfterValuesEstimationEulerV2 = exports.getEulerV2SupplyRate = exports.getUtilizationRate = exports.getEulerV2BorrowRate = exports.getEulerV2AggregatedData = exports.isLeveragedPos = void 0;
|
|
27
27
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
28
28
|
const tokens_1 = require("@defisaver/tokens");
|
|
29
|
+
const common_1 = require("../../types/common");
|
|
29
30
|
const moneymarket_1 = require("../../moneymarket");
|
|
30
31
|
const staking_1 = require("../../staking");
|
|
31
32
|
const contracts_1 = require("../../contracts");
|
|
@@ -59,31 +60,30 @@ const isLeveragedPos = (usedAssets, dustLimit = 5) => {
|
|
|
59
60
|
});
|
|
60
61
|
const isLong = borrowStable > 0 && borrowUnstable === 0 && supplyUnstable === 1 && supplyStable === 0;
|
|
61
62
|
const isShort = supplyStable > 0 && supplyUnstable === 0 && borrowUnstable === 1 && borrowStable === 0;
|
|
62
|
-
|
|
63
|
-
const isLsdLeveraged = supplyUnstable === 1 && borrowUnstable === 1 && shortAsset === 'ETH' && ['stETH', 'wstETH', 'cbETH', 'rETH'].includes(longAsset);
|
|
63
|
+
const isVolatilePair = supplyUnstable === 1 && borrowUnstable === 1 && supplyStable === 0 && borrowStable === 0;
|
|
64
64
|
if (isLong) {
|
|
65
65
|
return {
|
|
66
|
-
leveragedType:
|
|
66
|
+
leveragedType: common_1.LeverageType.Long,
|
|
67
67
|
leveragedAsset: longAsset,
|
|
68
68
|
leveragedVault: leverageAssetVault,
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
if (isShort) {
|
|
72
72
|
return {
|
|
73
|
-
leveragedType:
|
|
73
|
+
leveragedType: common_1.LeverageType.Short,
|
|
74
74
|
leveragedAsset: shortAsset,
|
|
75
75
|
leveragedVault: leverageAssetVault,
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
78
|
+
if (isVolatilePair) {
|
|
79
79
|
return {
|
|
80
|
-
leveragedType:
|
|
80
|
+
leveragedType: common_1.LeverageType.VolatilePair,
|
|
81
81
|
leveragedAsset: longAsset,
|
|
82
82
|
leveragedVault: leverageAssetVault,
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
86
|
-
leveragedType:
|
|
86
|
+
leveragedType: common_1.LeverageType.None,
|
|
87
87
|
leveragedAsset: '',
|
|
88
88
|
leveragedVault: '',
|
|
89
89
|
};
|
|
@@ -113,14 +113,22 @@ const getEulerV2AggregatedData = (_a) => {
|
|
|
113
113
|
if (leveragedType !== '') {
|
|
114
114
|
payload.leveragedAsset = leveragedAsset;
|
|
115
115
|
let assetPrice = assetsData[leveragedVault.toLowerCase()].price;
|
|
116
|
-
if (leveragedType ===
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
if (leveragedType === common_1.LeverageType.VolatilePair) {
|
|
117
|
+
const borrowedAsset = Object.values(usedAssets).find(({ borrowedUsd }) => +borrowedUsd > 0);
|
|
118
|
+
const borrowedAssetPrice = assetsData[borrowedAsset.vaultAddress.toLowerCase()].price;
|
|
119
|
+
const leveragedAssetPrice = assetsData[leveragedVault.toLowerCase()].price;
|
|
120
|
+
const isReverse = new decimal_js_1.default(leveragedAssetPrice).lt(borrowedAssetPrice);
|
|
121
|
+
if (isReverse) {
|
|
122
|
+
payload.leveragedType = common_1.LeverageType.VolatilePairReverse;
|
|
123
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(borrowedAssetPrice).div(leveragedAssetPrice).toDP(18).toString();
|
|
124
|
+
assetPrice = new decimal_js_1.default(borrowedAssetPrice).div(assetPrice).toString();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
assetPrice = new decimal_js_1.default(assetPrice).div(borrowedAssetPrice).toString();
|
|
128
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(leveragedAssetPrice).div(borrowedAssetPrice).toDP(18).toString();
|
|
121
129
|
}
|
|
122
130
|
}
|
|
123
|
-
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
131
|
+
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(payload.leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
124
132
|
}
|
|
125
133
|
payload.minCollRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
126
134
|
payload.collLiquidationRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
@@ -9,6 +9,7 @@ const tokens_1 = require("@defisaver/tokens");
|
|
|
9
9
|
const types_1 = require("../../types");
|
|
10
10
|
const moneymarket_1 = require("../../moneymarket");
|
|
11
11
|
const staking_1 = require("../../staking");
|
|
12
|
+
const common_1 = require("../../types/common");
|
|
12
13
|
const utils_1 = require("../../services/utils");
|
|
13
14
|
const calculateNetApyDex = ({ marketData, suppliedUsd, borrowedUsd }) => {
|
|
14
15
|
const { borrowRate, supplyRate, incentiveBorrowRate, incentiveSupplyRate, tradingBorrowRate, tradingSupplyRate, } = marketData;
|
|
@@ -55,12 +56,22 @@ const getFluidAggregatedData = ({ usedAssets, assetsData, marketData, }, supplyS
|
|
|
55
56
|
if (leveragedType !== '') {
|
|
56
57
|
payload.leveragedAsset = leveragedAsset;
|
|
57
58
|
let assetPrice = assetsData[leveragedAsset].price;
|
|
58
|
-
if (leveragedType ===
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
if (leveragedType === common_1.LeverageType.VolatilePair) {
|
|
60
|
+
const borrowedAsset = Object.values(usedAssets).find(({ borrowedUsd }) => +borrowedUsd > 0);
|
|
61
|
+
const borrowedAssetPrice = assetsData[borrowedAsset.symbol].price;
|
|
62
|
+
const leveragedAssetPrice = assetsData[leveragedAsset].price;
|
|
63
|
+
const isReverse = new decimal_js_1.default(leveragedAssetPrice).lt(borrowedAssetPrice);
|
|
64
|
+
if (isReverse) {
|
|
65
|
+
payload.leveragedType = common_1.LeverageType.VolatilePairReverse;
|
|
66
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(borrowedAssetPrice).div(leveragedAssetPrice).toDP(18).toString();
|
|
67
|
+
assetPrice = new decimal_js_1.default(borrowedAssetPrice).div(assetPrice).toString();
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
assetPrice = new decimal_js_1.default(assetPrice).div(borrowedAssetPrice).toString();
|
|
71
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(leveragedAssetPrice).div(borrowedAssetPrice).toDP(18).toString();
|
|
72
|
+
}
|
|
62
73
|
}
|
|
63
|
-
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
74
|
+
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(payload.leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
64
75
|
}
|
|
65
76
|
payload.minCollRatio = new decimal_js_1.default(payload.suppliedUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
66
77
|
payload.collLiquidationRatio = new decimal_js_1.default(payload.suppliedUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
@@ -51,12 +51,22 @@ const getMorphoBlueAggregatedPositionData = ({ usedAssets, assetsData, marketInf
|
|
|
51
51
|
if (leveragedType !== '') {
|
|
52
52
|
payload.leveragedAsset = leveragedAsset;
|
|
53
53
|
let assetPrice = assetsData[leveragedAsset].price;
|
|
54
|
-
if (leveragedType ===
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
if (leveragedType === common_1.LeverageType.VolatilePair) {
|
|
55
|
+
const borrowedAsset = Object.values(usedAssets).find(({ borrowedUsd }) => +borrowedUsd > 0);
|
|
56
|
+
const borrowedAssetPrice = assetsData[borrowedAsset.symbol].price;
|
|
57
|
+
const leveragedAssetPrice = assetsData[leveragedAsset].price;
|
|
58
|
+
const isReverse = new decimal_js_1.default(leveragedAssetPrice).lt(borrowedAssetPrice);
|
|
59
|
+
if (isReverse) {
|
|
60
|
+
payload.leveragedType = common_1.LeverageType.VolatilePairReverse;
|
|
61
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(borrowedAssetPrice).div(leveragedAssetPrice).toDP(18).toString();
|
|
62
|
+
assetPrice = new decimal_js_1.default(borrowedAssetPrice).div(assetPrice).toString();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
assetPrice = new decimal_js_1.default(assetPrice).div(borrowedAssetPrice).toString();
|
|
66
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(leveragedAssetPrice).div(borrowedAssetPrice).toDP(18).toString();
|
|
67
|
+
}
|
|
58
68
|
}
|
|
59
|
-
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
69
|
+
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(payload.leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
60
70
|
}
|
|
61
71
|
payload.minCollRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
62
72
|
payload.collLiquidationRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SparkAggregatedPositionData, SparkAssetsData, SparkHelperCommon, SparkMarketData, SparkUsedAssets } from '../../types';
|
|
1
|
+
import { SparkAggregatedPositionData, SparkAssetsData, SparkHelperCommon, SparkMarketData, SparkUsedAsset, SparkUsedAssets } from '../../types';
|
|
2
2
|
import { EthereumProvider } from '../../types/common';
|
|
3
3
|
export declare const sparkIsInIsolationMode: ({ usedAssets, assetsData }: {
|
|
4
4
|
usedAssets: SparkUsedAssets;
|
|
@@ -6,7 +6,7 @@ export declare const sparkIsInIsolationMode: ({ usedAssets, assetsData }: {
|
|
|
6
6
|
}) => boolean;
|
|
7
7
|
export declare const sparkGetCollSuppliedAssets: ({ usedAssets }: {
|
|
8
8
|
usedAssets: SparkUsedAssets;
|
|
9
|
-
}) =>
|
|
9
|
+
}) => SparkUsedAsset[];
|
|
10
10
|
export declare const sparkGetSuppliableAssets: ({ usedAssets, eModeCategory, assetsData, selectedMarket, network, ...rest }: SparkHelperCommon) => {
|
|
11
11
|
symbol: string;
|
|
12
12
|
canBeCollateral: boolean;
|
|
@@ -92,12 +92,22 @@ const sparkGetAggregatedPositionData = (_a) => {
|
|
|
92
92
|
if (leveragedType !== '') {
|
|
93
93
|
payload.leveragedAsset = leveragedAsset;
|
|
94
94
|
let assetPrice = data.assetsData[leveragedAsset].price; // TODO sparkPrice or price??
|
|
95
|
-
if (leveragedType ===
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
if (leveragedType === common_1.LeverageType.VolatilePair) {
|
|
96
|
+
const borrowedAsset = Object.values(usedAssets).find(({ borrowedUsd }) => +borrowedUsd > 0);
|
|
97
|
+
const borrowedAssetPrice = data.assetsData[borrowedAsset.symbol].price;
|
|
98
|
+
const leveragedAssetPrice = data.assetsData[leveragedAsset].price;
|
|
99
|
+
const isReverse = new decimal_js_1.default(leveragedAssetPrice).lt(borrowedAssetPrice);
|
|
100
|
+
if (isReverse) {
|
|
101
|
+
payload.leveragedType = common_1.LeverageType.VolatilePairReverse;
|
|
102
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(borrowedAssetPrice).div(leveragedAssetPrice).toDP(18).toString();
|
|
103
|
+
assetPrice = new decimal_js_1.default(borrowedAssetPrice).div(assetPrice).toString();
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
assetPrice = new decimal_js_1.default(assetPrice).div(borrowedAssetPrice).toString();
|
|
107
|
+
payload.currentVolatilePairRatio = new decimal_js_1.default(leveragedAssetPrice).div(borrowedAssetPrice).toDP(18).toString();
|
|
108
|
+
}
|
|
99
109
|
}
|
|
100
|
-
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
110
|
+
payload.liquidationPrice = (0, moneymarket_1.calcLeverageLiqPrice)(payload.leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
101
111
|
}
|
|
102
112
|
payload.minCollRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
103
113
|
payload.collLiquidationRatio = new decimal_js_1.default(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { MMUsedAssets } from '../types/common';
|
|
1
|
+
import { LeverageType, MMUsedAssets } from '../types/common';
|
|
2
2
|
export declare const getAssetsTotal: (assets: object, filter: any, transform: any) => any;
|
|
3
3
|
export declare const calcLongLiqPrice: (assetPrice: string, borrowedUsd: string, borrowLimitUsd: string) => string;
|
|
4
4
|
export declare const calcShortLiqPrice: (assetPrice: string, borrowedUsd: string, borrowLimitUsd: string) => string;
|
|
5
|
-
export declare const calcLeverageLiqPrice: (leverageType:
|
|
5
|
+
export declare const calcLeverageLiqPrice: (leverageType: LeverageType, assetPrice: string, borrowedUsd: string, borrowLimitUsd: string) => string;
|
|
6
6
|
export declare const calculateBorrowingAssetLimit: (assetBorrowedUsd: string, borrowLimitUsd: string) => string;
|
|
7
7
|
export declare const STABLE_ASSETS: string[];
|
|
8
8
|
export declare const isLeveragedPos: (usedAssets: MMUsedAssets, dustLimit?: number) => {
|
|
9
|
-
leveragedType:
|
|
9
|
+
leveragedType: LeverageType;
|
|
10
10
|
leveragedAsset: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const aprToApy: (interest: string | number, frequency?: number) => string;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.aprToApy = exports.isLeveragedPos = exports.STABLE_ASSETS = exports.calculateBorrowingAssetLimit = exports.calcLeverageLiqPrice = exports.calcShortLiqPrice = exports.calcLongLiqPrice = exports.getAssetsTotal = void 0;
|
|
7
7
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
|
+
const common_1 = require("../types/common");
|
|
9
10
|
const getAssetsTotal = (assets, filter, transform) => Object.values(assets)
|
|
10
11
|
.filter(filter)
|
|
11
12
|
.map(transform)
|
|
@@ -17,9 +18,9 @@ exports.calcLongLiqPrice = calcLongLiqPrice;
|
|
|
17
18
|
const calcShortLiqPrice = (assetPrice, borrowedUsd, borrowLimitUsd) => new decimal_js_1.default(assetPrice).div(borrowedUsd).mul(borrowLimitUsd).toString();
|
|
18
19
|
exports.calcShortLiqPrice = calcShortLiqPrice;
|
|
19
20
|
const calcLeverageLiqPrice = (leverageType, assetPrice, borrowedUsd, borrowLimitUsd) => {
|
|
20
|
-
if (leverageType ===
|
|
21
|
+
if (leverageType === common_1.LeverageType.Short || leverageType === common_1.LeverageType.VolatilePairReverse)
|
|
21
22
|
return (0, exports.calcShortLiqPrice)(assetPrice, borrowedUsd, borrowLimitUsd);
|
|
22
|
-
if (leverageType ===
|
|
23
|
+
if (leverageType === common_1.LeverageType.Long || leverageType === common_1.LeverageType.VolatilePair)
|
|
23
24
|
return (0, exports.calcLongLiqPrice)(assetPrice, borrowedUsd, borrowLimitUsd);
|
|
24
25
|
console.error('invalid leverageType', leverageType);
|
|
25
26
|
return '0';
|
|
@@ -58,35 +59,27 @@ const isLeveragedPos = (usedAssets, dustLimit = 5) => {
|
|
|
58
59
|
});
|
|
59
60
|
const isLong = borrowStable > 0 && borrowUnstable === 0 && supplyUnstable === 1 && supplyStable === 0;
|
|
60
61
|
const isShort = supplyStable > 0 && supplyUnstable === 0 && borrowUnstable === 1 && borrowStable === 0;
|
|
61
|
-
// lsd -> liquid staking derivative
|
|
62
|
-
const isLsdLeveraged = supplyUnstable === 1 && borrowUnstable === 1 && shortAsset === 'ETH' && ['stETH', 'wstETH', 'cbETH', 'rETH', 'ezETH', 'weETH'].includes(longAsset);
|
|
63
62
|
const isVolatilePair = supplyUnstable === 1 && borrowUnstable === 1 && supplyStable === 0 && borrowStable === 0;
|
|
64
63
|
if (isLong) {
|
|
65
64
|
return {
|
|
66
|
-
leveragedType:
|
|
65
|
+
leveragedType: common_1.LeverageType.Long,
|
|
67
66
|
leveragedAsset: longAsset,
|
|
68
67
|
};
|
|
69
68
|
}
|
|
70
69
|
if (isShort) {
|
|
71
70
|
return {
|
|
72
|
-
leveragedType:
|
|
71
|
+
leveragedType: common_1.LeverageType.Short,
|
|
73
72
|
leveragedAsset: shortAsset,
|
|
74
73
|
};
|
|
75
74
|
}
|
|
76
|
-
if (isLsdLeveraged) {
|
|
77
|
-
return {
|
|
78
|
-
leveragedType: 'lsd-leverage',
|
|
79
|
-
leveragedAsset: longAsset,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
75
|
if (isVolatilePair) {
|
|
83
76
|
return {
|
|
84
|
-
leveragedType:
|
|
77
|
+
leveragedType: common_1.LeverageType.VolatilePair,
|
|
85
78
|
leveragedAsset: longAsset,
|
|
86
79
|
};
|
|
87
80
|
}
|
|
88
81
|
return {
|
|
89
|
-
leveragedType:
|
|
82
|
+
leveragedType: common_1.LeverageType.None,
|
|
90
83
|
leveragedAsset: '',
|
|
91
84
|
};
|
|
92
85
|
};
|
package/cjs/types/aave.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IncentiveData, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
1
|
+
import { IncentiveData, LeverageType, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
2
2
|
export declare enum AaveVersions {
|
|
3
3
|
AaveV1 = "v1",
|
|
4
4
|
AaveV2 = "v2default",
|
|
@@ -161,9 +161,8 @@ export interface AaveV3AggregatedPositionData {
|
|
|
161
161
|
totalInterestUsd: string;
|
|
162
162
|
liqRatio: string;
|
|
163
163
|
liqPercent: string;
|
|
164
|
-
leveragedType:
|
|
164
|
+
leveragedType: LeverageType;
|
|
165
165
|
leveragedAsset?: string;
|
|
166
|
-
leveragedLsdAssetRatio?: string;
|
|
167
166
|
liquidationPrice?: string;
|
|
168
167
|
minCollRatio?: string;
|
|
169
168
|
collLiquidationRatio?: string;
|
package/cjs/types/common.d.ts
CHANGED
|
@@ -8,6 +8,13 @@ export declare enum IncentiveEligibilityId {
|
|
|
8
8
|
AaveV3ArbitrumETHLSBorrow = "0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351",
|
|
9
9
|
AaveV3EthenaLiquidLeveragePlasma = "0x67264783f1e9a2af8627a235853057a6fc975bd2BORROW_BL"
|
|
10
10
|
}
|
|
11
|
+
export declare enum LeverageType {
|
|
12
|
+
Long = "long",
|
|
13
|
+
Short = "short",
|
|
14
|
+
VolatilePair = "volatile-pair",
|
|
15
|
+
VolatilePairReverse = "volatile-pair-reverse",
|
|
16
|
+
None = ""
|
|
17
|
+
}
|
|
11
18
|
export interface IncentiveData {
|
|
12
19
|
token: string;
|
|
13
20
|
apy: string;
|
package/cjs/types/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NetworkNumber = exports.IncentiveEligibilityId = exports.IncentiveKind = void 0;
|
|
3
|
+
exports.NetworkNumber = exports.LeverageType = exports.IncentiveEligibilityId = exports.IncentiveKind = void 0;
|
|
4
4
|
var IncentiveKind;
|
|
5
5
|
(function (IncentiveKind) {
|
|
6
6
|
IncentiveKind["Staking"] = "staking";
|
|
@@ -13,6 +13,14 @@ var IncentiveEligibilityId;
|
|
|
13
13
|
IncentiveEligibilityId["AaveV3ArbitrumETHLSBorrow"] = "0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351";
|
|
14
14
|
IncentiveEligibilityId["AaveV3EthenaLiquidLeveragePlasma"] = "0x67264783f1e9a2af8627a235853057a6fc975bd2BORROW_BL";
|
|
15
15
|
})(IncentiveEligibilityId || (exports.IncentiveEligibilityId = IncentiveEligibilityId = {}));
|
|
16
|
+
var LeverageType;
|
|
17
|
+
(function (LeverageType) {
|
|
18
|
+
LeverageType["Long"] = "long";
|
|
19
|
+
LeverageType["Short"] = "short";
|
|
20
|
+
LeverageType["VolatilePair"] = "volatile-pair";
|
|
21
|
+
LeverageType["VolatilePairReverse"] = "volatile-pair-reverse";
|
|
22
|
+
LeverageType["None"] = "";
|
|
23
|
+
})(LeverageType || (exports.LeverageType = LeverageType = {}));
|
|
16
24
|
var NetworkNumber;
|
|
17
25
|
(function (NetworkNumber) {
|
|
18
26
|
NetworkNumber[NetworkNumber["Eth"] = 1] = "Eth";
|
package/cjs/types/compound.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
1
|
+
import { EthAddress, LeverageType, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
2
2
|
export declare enum CompoundVersions {
|
|
3
3
|
'CompoundV2' = "v2",
|
|
4
4
|
'CompoundV3USDC' = "v3-USDC",
|
|
@@ -94,9 +94,9 @@ export interface CompoundAggregatedPositionData {
|
|
|
94
94
|
totalInterestUsd: string;
|
|
95
95
|
liqRatio: string;
|
|
96
96
|
liqPercent: string;
|
|
97
|
-
leveragedType:
|
|
97
|
+
leveragedType: LeverageType;
|
|
98
98
|
leveragedAsset?: string;
|
|
99
|
-
|
|
99
|
+
currentVolatilePairRatio?: string;
|
|
100
100
|
liquidationPrice?: string;
|
|
101
101
|
minRatio: string;
|
|
102
102
|
debtTooLow: boolean;
|
package/cjs/types/curveUsd.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress, NetworkNumber } from './common';
|
|
1
|
+
import { EthAddress, LeverageType, NetworkNumber } from './common';
|
|
2
2
|
export declare enum CrvUSDVersions {
|
|
3
3
|
'crvUSDwstETH' = "wstETH",
|
|
4
4
|
'crvUSDWBTC' = "WBTC",
|
|
@@ -71,7 +71,7 @@ export interface CrvUSDAggregatedPositionData {
|
|
|
71
71
|
borrowLimitUsd: string;
|
|
72
72
|
minAllowedRatio: number;
|
|
73
73
|
collFactor: string;
|
|
74
|
-
leveragedType:
|
|
74
|
+
leveragedType: LeverageType;
|
|
75
75
|
leveragedAsset?: string;
|
|
76
76
|
liquidationPrice?: string;
|
|
77
77
|
}
|
package/cjs/types/euler.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress, IncentiveData, MMPositionData, NetworkNumber } from './common';
|
|
1
|
+
import { EthAddress, IncentiveData, LeverageType, MMPositionData, NetworkNumber } from './common';
|
|
2
2
|
export declare enum EulerV2Versions {
|
|
3
3
|
eUSDC2 = "eUSDC-2",
|
|
4
4
|
eWETH2 = "eWETH-2"
|
|
@@ -141,9 +141,9 @@ export interface EulerV2AggregatedPositionData {
|
|
|
141
141
|
totalInterestUsd: string;
|
|
142
142
|
liqRatio: string;
|
|
143
143
|
liqPercent: string;
|
|
144
|
-
leveragedType:
|
|
144
|
+
leveragedType: LeverageType;
|
|
145
145
|
leveragedAsset?: string;
|
|
146
|
-
|
|
146
|
+
currentVolatilePairRatio?: string;
|
|
147
147
|
liquidationPrice?: string;
|
|
148
148
|
minRatio: string;
|
|
149
149
|
minDebt: string;
|
package/cjs/types/fluid.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress, IncentiveData, NetworkNumber } from './common';
|
|
1
|
+
import { EthAddress, IncentiveData, LeverageType, NetworkNumber } from './common';
|
|
2
2
|
export interface FluidMarketInfo {
|
|
3
3
|
chainIds: number[];
|
|
4
4
|
label: string;
|
|
@@ -323,10 +323,10 @@ export interface FluidAggregatedVaultData {
|
|
|
323
323
|
collRatio: string;
|
|
324
324
|
minRatio: string;
|
|
325
325
|
totalInterestUsd: string;
|
|
326
|
-
leveragedType?:
|
|
326
|
+
leveragedType?: LeverageType;
|
|
327
327
|
leveragedAsset?: string;
|
|
328
328
|
liquidationPrice?: string;
|
|
329
|
-
|
|
329
|
+
currentVolatilePairRatio?: string;
|
|
330
330
|
minCollRatio?: string;
|
|
331
331
|
collLiquidationRatio?: string;
|
|
332
332
|
}
|
package/cjs/types/liquityV2.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress, IncentiveData, NetworkNumber } from './common';
|
|
1
|
+
import { EthAddress, IncentiveData, LeverageType, NetworkNumber } from './common';
|
|
2
2
|
export declare enum LiquityV2Versions {
|
|
3
3
|
LiquityV2Eth = "liquityv2eth",
|
|
4
4
|
LiquityV2WstEth = "liquityv2wsteth",
|
|
@@ -88,7 +88,7 @@ export interface LiquityV2AggregatedTroveData {
|
|
|
88
88
|
netApy: string;
|
|
89
89
|
incentiveUsd: string;
|
|
90
90
|
totalInterestUsd: string;
|
|
91
|
-
leveragedType:
|
|
91
|
+
leveragedType: LeverageType;
|
|
92
92
|
leveragedAsset: string;
|
|
93
93
|
liquidationPrice: string;
|
|
94
94
|
ratio: string;
|
|
@@ -110,7 +110,7 @@ export interface LiquityV2TroveData {
|
|
|
110
110
|
totalInterestUsd: string;
|
|
111
111
|
interestBatchManager: EthAddress;
|
|
112
112
|
troveStatus: string;
|
|
113
|
-
leveragedType:
|
|
113
|
+
leveragedType: LeverageType;
|
|
114
114
|
leveragedAsset: string;
|
|
115
115
|
liquidationPrice: string;
|
|
116
116
|
debtInFront: string;
|
package/cjs/types/llamaLend.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress, IncentiveData, NetworkNumber } from './common';
|
|
1
|
+
import { EthAddress, IncentiveData, LeverageType, NetworkNumber } from './common';
|
|
2
2
|
import { BandData, UserBandData } from './curveUsd';
|
|
3
3
|
export declare enum LLVersionsEth {
|
|
4
4
|
LLWstethCrvusd = "llamaLendwstETHcrvUSD",
|
|
@@ -112,7 +112,7 @@ export interface LlamaLendAggregatedPositionData {
|
|
|
112
112
|
borrowLimitUsd: string;
|
|
113
113
|
minAllowedRatio: number;
|
|
114
114
|
collFactor: string;
|
|
115
|
-
leveragedType:
|
|
115
|
+
leveragedType: LeverageType;
|
|
116
116
|
leveragedAsset?: string;
|
|
117
117
|
liquidationPrice?: string;
|
|
118
118
|
netApy: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress, IncentiveData, MMUsedAssets, NetworkNumber } from './common';
|
|
1
|
+
import { EthAddress, IncentiveData, LeverageType, MMUsedAssets, NetworkNumber } from './common';
|
|
2
2
|
export declare enum MorphoBlueVersions {
|
|
3
3
|
MorphoBlueWstEthUSDC = "morphobluewstethusdc",// wstETH/USDC
|
|
4
4
|
MorphoBlueSDAIUSDC = "morphobluesdaiusdc",// sDAI/USDC
|
|
@@ -121,9 +121,9 @@ export interface MorphoBlueAggregatedPositionData {
|
|
|
121
121
|
totalInterestUsd: string;
|
|
122
122
|
ltv: string;
|
|
123
123
|
ratio: string;
|
|
124
|
-
leveragedType:
|
|
124
|
+
leveragedType: LeverageType;
|
|
125
125
|
leveragedAsset?: string;
|
|
126
|
-
|
|
126
|
+
currentVolatilePairRatio?: string;
|
|
127
127
|
liquidationPrice?: string;
|
|
128
128
|
minCollRatio?: string;
|
|
129
129
|
collLiquidationRatio?: string;
|
|
@@ -142,9 +142,9 @@ export interface MorphoBluePositionData {
|
|
|
142
142
|
totalInterestUsd: string;
|
|
143
143
|
ltv: string;
|
|
144
144
|
ratio: string;
|
|
145
|
-
leveragedType:
|
|
145
|
+
leveragedType: LeverageType;
|
|
146
146
|
leveragedAsset?: string;
|
|
147
|
-
|
|
147
|
+
currentVolatilePairRatio?: string;
|
|
148
148
|
liquidationPrice?: string;
|
|
149
149
|
supplyShares: string;
|
|
150
150
|
borrowShares: string;
|
package/cjs/types/spark.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EModeCategoriesData } from './aave';
|
|
2
|
-
import { EthAddress, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
2
|
+
import { EthAddress, LeverageType, MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber } from './common';
|
|
3
3
|
export declare enum SparkVersions {
|
|
4
4
|
SparkV1 = "v1default"
|
|
5
5
|
}
|
|
@@ -90,9 +90,9 @@ export interface SparkAggregatedPositionData {
|
|
|
90
90
|
totalInterestUsd: string;
|
|
91
91
|
liqRatio: string;
|
|
92
92
|
liqPercent: string;
|
|
93
|
-
leveragedType:
|
|
93
|
+
leveragedType: LeverageType;
|
|
94
94
|
leveragedAsset?: string;
|
|
95
|
-
|
|
95
|
+
currentVolatilePairRatio?: string;
|
|
96
96
|
liquidationPrice?: string;
|
|
97
97
|
minCollRatio: string;
|
|
98
98
|
collLiquidationRatio: string;
|