@gainsnetwork/sdk 0.2.32-rc2 → 0.2.33-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 +2 -0
- package/lib/constants.js +3 -1
- package/lib/contracts/types/generated/GFarmTradingStorageV5.d.ts +1911 -0
- package/lib/contracts/types/generated/GFarmTradingStorageV5.js +2 -0
- package/lib/contracts/types/generated/GNSBorrowingFees.d.ts +1067 -0
- package/lib/contracts/types/generated/GNSBorrowingFees.js +2 -0
- package/lib/contracts/types/generated/GNSMultiCollatDiamond.d.ts +673 -312
- package/lib/contracts/types/generated/GNSNftRewardsV6.d.ts +533 -0
- package/lib/contracts/types/generated/GNSNftRewardsV6.js +2 -0
- package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.d.ts +613 -0
- package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.js +2 -0
- package/lib/contracts/types/generated/GNSTrading.d.ts +758 -0
- package/lib/contracts/types/generated/GNSTrading.js +2 -0
- package/lib/contracts/types/generated/GNSTradingCallbacks.d.ts +875 -0
- package/lib/contracts/types/generated/GNSTradingCallbacks.js +2 -0
- package/lib/contracts/types/generated/GNSTradingStorage.d.ts +1387 -0
- package/lib/contracts/types/generated/GNSTradingStorage.js +2 -0
- package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.d.ts +83 -0
- package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.js +2691 -0
- package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.d.ts +124 -0
- package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.js +1784 -0
- package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.js +1437 -532
- package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.d.ts +100 -0
- package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.js +1116 -0
- package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.d.ts +100 -0
- package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.js +1003 -0
- package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.d.ts +113 -0
- package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.js +1428 -0
- package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.d.ts +96 -0
- package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.js +2241 -0
- package/lib/contracts/types/generated/factories/GNSTrading__factory.d.ts +95 -0
- package/lib/contracts/types/generated/factories/GNSTrading__factory.js +1071 -0
- package/lib/contracts/utils/pairs.js +6 -4
- package/lib/trade/fees/index.js +3 -2
- package/lib/trade/types.d.ts +12 -3
- package/lib/trade/types.js +2 -0
- package/package.json +1 -1
|
@@ -69,10 +69,10 @@ const fetchFees = (contracts, feeIxs) => __awaiter(void 0, void 0, void 0, funct
|
|
|
69
69
|
const fees = yield Promise.all(feeIxs.map(pairIndex => multiCollatContract.fees(pairIndex)));
|
|
70
70
|
return fees.map(fee => {
|
|
71
71
|
return {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
minPositionSizeUsd: parseFloat(fee.minPositionSizeUsd.toString()) /
|
|
72
|
+
totalPositionSizeFeeP: parseFloat(fee.totalPositionSizeFeeP.toString()) / 1e12,
|
|
73
|
+
totalLiqCollateralFeeP: parseFloat(fee.totalLiqCollateralFeeP.toString()) / 1e12,
|
|
74
|
+
oraclePositionSizeFeeP: parseFloat(fee.oraclePositionSizeFeeP.toString()) / 1e12,
|
|
75
|
+
minPositionSizeUsd: parseFloat(fee.minPositionSizeUsd.toString()) / 1e3,
|
|
76
76
|
};
|
|
77
77
|
});
|
|
78
78
|
}
|
|
@@ -389,4 +389,6 @@ const PAIR_INDEX_TO_DESCRIPTION = {
|
|
|
389
389
|
[types_1.PairIndex.HMSTRUSD]: "Hamster Kombat to US Dollar",
|
|
390
390
|
[types_1.PairIndex.EIGENUSD]: "EigenLayer to US Dollar",
|
|
391
391
|
[types_1.PairIndex.POLYXUSD]: "Polymesh to US Dollar",
|
|
392
|
+
[types_1.PairIndex.MOODENGUSD]: "Moo Deng to US Dollar",
|
|
393
|
+
[types_1.PairIndex.MOTHERUSD]: "Mother Iggy to US Dollar",
|
|
392
394
|
};
|
package/lib/trade/fees/index.js
CHANGED
|
@@ -22,8 +22,9 @@ const getClosingFee = (posDai, leverage, pairIndex, pairFee, collateralPriceUsd
|
|
|
22
22
|
pairFee === undefined) {
|
|
23
23
|
return 0;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
// @todo check
|
|
26
|
+
const { totalPositionSizeFeeP, minPositionSizeUsd } = pairFee;
|
|
27
|
+
return (totalPositionSizeFeeP *
|
|
27
28
|
feeMultiplier *
|
|
28
29
|
Math.max(collateralPriceUsd && collateralPriceUsd > 0
|
|
29
30
|
? minPositionSizeUsd / collateralPriceUsd
|
package/lib/trade/types.d.ts
CHANGED
|
@@ -48,10 +48,17 @@ export type TradingGroup = {
|
|
|
48
48
|
name: string;
|
|
49
49
|
};
|
|
50
50
|
export type Fee = {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
totalPositionSizeFeeP: number;
|
|
52
|
+
totalLiqCollateralFeeP: number;
|
|
53
|
+
oraclePositionSizeFeeP: number;
|
|
53
54
|
minPositionSizeUsd: number;
|
|
55
|
+
};
|
|
56
|
+
export type GlobalTradeFeeParams = {
|
|
57
|
+
referralFeeP: number;
|
|
58
|
+
govFeeP: number;
|
|
54
59
|
triggerOrderFeeP: number;
|
|
60
|
+
gnsOtcFeeP: number;
|
|
61
|
+
gTokenFeeP: number;
|
|
55
62
|
};
|
|
56
63
|
export type PairDepth = {
|
|
57
64
|
onePercentDepthAboveUsd: number;
|
|
@@ -492,5 +499,7 @@ export declare enum PairIndex {
|
|
|
492
499
|
ZETAUSD = 280,
|
|
493
500
|
HMSTRUSD = 281,
|
|
494
501
|
EIGENUSD = 282,
|
|
495
|
-
POLYXUSD = 283
|
|
502
|
+
POLYXUSD = 283,
|
|
503
|
+
MOODENGUSD = 284,
|
|
504
|
+
MOTHERUSD = 285
|
|
496
505
|
}
|
package/lib/trade/types.js
CHANGED
|
@@ -313,4 +313,6 @@ var PairIndex;
|
|
|
313
313
|
PairIndex[PairIndex["HMSTRUSD"] = 281] = "HMSTRUSD";
|
|
314
314
|
PairIndex[PairIndex["EIGENUSD"] = 282] = "EIGENUSD";
|
|
315
315
|
PairIndex[PairIndex["POLYXUSD"] = 283] = "POLYXUSD";
|
|
316
|
+
PairIndex[PairIndex["MOODENGUSD"] = 284] = "MOODENGUSD";
|
|
317
|
+
PairIndex[PairIndex["MOTHERUSD"] = 285] = "MOTHERUSD";
|
|
316
318
|
})(PairIndex = exports.PairIndex || (exports.PairIndex = {}));
|