@gainsnetwork/sdk 0.2.1 → 0.2.3-rc1
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/lib/constants.d.ts
CHANGED
|
@@ -232,6 +232,9 @@ export declare const pairs: {
|
|
|
232
232
|
"MSN/USD": string;
|
|
233
233
|
"REZ/USD": string;
|
|
234
234
|
"NOT/USD": string;
|
|
235
|
+
"IO/USD": string;
|
|
236
|
+
"BRETT/USD": string;
|
|
237
|
+
"ATH/USD": string;
|
|
235
238
|
};
|
|
236
239
|
export declare const getAssetClassFromGroupIndex: (groupIndex: number) => string | undefined;
|
|
237
240
|
export declare const tickerChanges: {
|
package/lib/constants.js
CHANGED
|
@@ -240,6 +240,9 @@ exports.pairs = {
|
|
|
240
240
|
"MSN/USD": CRYPTO,
|
|
241
241
|
"REZ/USD": CRYPTO,
|
|
242
242
|
"NOT/USD": CRYPTO,
|
|
243
|
+
"IO/USD": CRYPTO,
|
|
244
|
+
"BRETT/USD": CRYPTO,
|
|
245
|
+
"ATH/USD": CRYPTO,
|
|
243
246
|
};
|
|
244
247
|
const getAssetClassFromGroupIndex = (groupIndex) => {
|
|
245
248
|
switch (groupIndex) {
|
|
@@ -273,6 +276,7 @@ exports.stockSplits = {
|
|
|
273
276
|
exports.delistedPairIxs = new Set([
|
|
274
277
|
6, 31, 36, 42, 45, 48, 51, 54, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
|
|
275
278
|
70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
|
|
276
|
-
89, 97, 99, 101, 106, 108, 52, 131, 147, 160, 179, 182, 183, 190, 229,
|
|
279
|
+
89, 97, 99, 101, 106, 108, 52, 131, 147, 160, 179, 182, 183, 190, 229, 155, 233,
|
|
280
|
+
234, 235,
|
|
277
281
|
]);
|
|
278
282
|
exports.delistedGroupsIxs = new Set([6, 7]);
|
|
@@ -338,4 +338,7 @@ const PAIR_INDEX_TO_DESCRIPTION = {
|
|
|
338
338
|
[types_1.PairIndex.MSNUSD]: "Meson Network to US Dollar",
|
|
339
339
|
[types_1.PairIndex.REZUSD]: "Renzo to US Dollar",
|
|
340
340
|
[types_1.PairIndex.NOTUSD]: "Notcoin to US Dollar",
|
|
341
|
+
[types_1.PairIndex.IOUSD]: "Ionet to US Dollar",
|
|
342
|
+
[types_1.PairIndex.BRETTUSD]: "Brett to US Dollar",
|
|
343
|
+
[types_1.PairIndex.ATHUSD]: "Aethir to US Dollar",
|
|
341
344
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GetBorrowingFeeContext, BorrowingFee } from "./fees";
|
|
2
|
-
import {
|
|
3
|
-
export declare const getLiquidationPrice: (trade: Trade,
|
|
2
|
+
import { Fee, Trade } from "./types";
|
|
3
|
+
export declare const getLiquidationPrice: (trade: Trade, fee: Fee, initialAccFees: BorrowingFee.InitialAccFees, context: GetBorrowingFeeContext) => number;
|
package/lib/trade/liquidation.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLiquidationPrice = void 0;
|
|
4
4
|
const fees_1 = require("./fees");
|
|
5
|
-
const getLiquidationPrice = (trade,
|
|
5
|
+
const getLiquidationPrice = (trade, fee, initialAccFees, context) => {
|
|
6
|
+
const closingFee = (0, fees_1.getClosingFee)(trade.collateralAmount, trade.leverage, trade.pairIndex, fee);
|
|
7
|
+
const borrowingFee = (0, fees_1.getBorrowingFee)(trade.collateralAmount * trade.leverage, trade.pairIndex, trade.long, initialAccFees, context);
|
|
6
8
|
const liqPriceDistance = (trade.openPrice *
|
|
7
|
-
(trade.collateralAmount * 0.9 -
|
|
8
|
-
(0, fees_1.getBorrowingFee)(trade.collateralAmount * trade.leverage, trade.pairIndex, trade.long, initialAccFees, context))) /
|
|
9
|
+
(trade.collateralAmount * 0.9 - (borrowingFee + closingFee))) /
|
|
9
10
|
trade.collateralAmount /
|
|
10
11
|
trade.leverage;
|
|
11
12
|
return trade.long
|
package/lib/trade/types.d.ts
CHANGED
package/lib/trade/types.js
CHANGED
|
@@ -262,4 +262,7 @@ var PairIndex;
|
|
|
262
262
|
PairIndex[PairIndex["MSNUSD"] = 230] = "MSNUSD";
|
|
263
263
|
PairIndex[PairIndex["REZUSD"] = 231] = "REZUSD";
|
|
264
264
|
PairIndex[PairIndex["NOTUSD"] = 232] = "NOTUSD";
|
|
265
|
+
PairIndex[PairIndex["IOUSD"] = 233] = "IOUSD";
|
|
266
|
+
PairIndex[PairIndex["BRETTUSD"] = 234] = "BRETTUSD";
|
|
267
|
+
PairIndex[PairIndex["ATHUSD"] = 235] = "ATHUSD";
|
|
265
268
|
})(PairIndex = exports.PairIndex || (exports.PairIndex = {}));
|