@gainsnetwork/sdk 0.0.0-v10.rc15 → 0.0.0-v10.rc16
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 +10 -0
- package/lib/constants.js +13 -2
- package/lib/contracts/addresses.json +20 -0
- package/lib/contracts/index.js +3 -1
- package/lib/contracts/types/index.d.ts +2 -1
- package/lib/contracts/types/index.js +1 -0
- package/lib/contracts/utils/pairs.js +10 -0
- package/lib/trade/fees/borrowing/index.d.ts +0 -1
- package/lib/trade/fees/borrowing/index.js +0 -1
- package/lib/trade/types.d.ts +11 -1
- package/lib/trade/types.js +10 -0
- package/package.json +1 -1
package/lib/constants.d.ts
CHANGED
|
@@ -386,6 +386,16 @@ export declare const pairs: {
|
|
|
386
386
|
"BVIV/USD": string;
|
|
387
387
|
"EVIV/USD": string;
|
|
388
388
|
"CRCL/USD": string;
|
|
389
|
+
"RESOLV/USD": string;
|
|
390
|
+
"SQD/USD": string;
|
|
391
|
+
"TAIKO/USD": string;
|
|
392
|
+
"HOME/USD": string;
|
|
393
|
+
"B/USD": string;
|
|
394
|
+
"HUMA/USD": string;
|
|
395
|
+
"SBET/USD": string;
|
|
396
|
+
"PLTR/USD": string;
|
|
397
|
+
"BIDU/USD": string;
|
|
398
|
+
"ROKU/USD": string;
|
|
389
399
|
};
|
|
390
400
|
export declare const syntheticPairs: Set<string>;
|
|
391
401
|
export declare const parentToSyntheticPairMap: Map<string, string>;
|
package/lib/constants.js
CHANGED
|
@@ -394,6 +394,16 @@ exports.pairs = {
|
|
|
394
394
|
"BVIV/USD": CRYPTO,
|
|
395
395
|
"EVIV/USD": CRYPTO,
|
|
396
396
|
"CRCL/USD": STOCKS,
|
|
397
|
+
"RESOLV/USD": CRYPTO,
|
|
398
|
+
"SQD/USD": CRYPTO,
|
|
399
|
+
"TAIKO/USD": CRYPTO,
|
|
400
|
+
"HOME/USD": CRYPTO,
|
|
401
|
+
"B/USD": CRYPTO,
|
|
402
|
+
"HUMA/USD": CRYPTO,
|
|
403
|
+
"SBET/USD": STOCKS,
|
|
404
|
+
"PLTR/USD": STOCKS,
|
|
405
|
+
"BIDU/USD": STOCKS,
|
|
406
|
+
"ROKU/USD": STOCKS,
|
|
397
407
|
};
|
|
398
408
|
exports.syntheticPairs = new Set([
|
|
399
409
|
"BTCDEGEN/USD",
|
|
@@ -442,11 +452,12 @@ exports.stockSplits = {
|
|
|
442
452
|
};
|
|
443
453
|
exports.delistedPairIxs = new Set([
|
|
444
454
|
4, 6, 15, 24, 25, 27, 28, 30, 31, 36, 48, 51, 52, 53, 54, 56, 59, 60, 61, 63,
|
|
445
|
-
66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
|
|
446
|
-
|
|
455
|
+
66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 95, 96, 97, 98, 99,
|
|
456
|
+
101, 106, 111, 113, 114, 116, 118, 120, 122, 123, 125, 127, 130, 147, 152,
|
|
447
457
|
160, 163, 170, 179, 182, 183, 187, 188, 189, 190, 208, 209, 225, 229, 230,
|
|
448
458
|
231, 238, 239, 241, 250, 253, 254, 258, 270, 275, 276, 278, 279, 282, 285,
|
|
449
459
|
290, 294, 296, 305, 330, 349, 352, 353, 354, 355, 357, 365, 366, 384, 385,
|
|
460
|
+
393, 394, 395, 396,
|
|
450
461
|
]);
|
|
451
462
|
exports.delistedGroupsIxs = new Set([]);
|
|
452
463
|
exports.DEFAULT_PROTECTION_CLOSE_FACTOR = 1;
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"GNS": {
|
|
23
23
|
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
24
24
|
"gToken": "0x0000000000000000000000000000000000000000"
|
|
25
|
+
},
|
|
26
|
+
"BTCUSD": {
|
|
27
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
28
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
"42161": {
|
|
@@ -47,6 +51,10 @@
|
|
|
47
51
|
"GNS": {
|
|
48
52
|
"gTokenOpenPnlFeed": "0x4ca1638754Be8060E544Aca4A4F43702Be30E0D1",
|
|
49
53
|
"gToken": "0x4BeeF1113F968326905224D2Ca272f3032A9a9F4"
|
|
54
|
+
},
|
|
55
|
+
"BTCUSD": {
|
|
56
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
57
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
50
58
|
}
|
|
51
59
|
},
|
|
52
60
|
"421614": {
|
|
@@ -72,6 +80,10 @@
|
|
|
72
80
|
"GNS": {
|
|
73
81
|
"gTokenOpenPnlFeed": "0x68F8D4ec2EF23a15e61e1642E730b6f69fB9A5De",
|
|
74
82
|
"gToken": "0x5ed4bEA869300DB39bE2a92a8B42e53453742a43"
|
|
83
|
+
},
|
|
84
|
+
"BTCUSD": {
|
|
85
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
86
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
75
87
|
}
|
|
76
88
|
},
|
|
77
89
|
"8453": {
|
|
@@ -97,6 +109,10 @@
|
|
|
97
109
|
"GNS": {
|
|
98
110
|
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
99
111
|
"gToken": "0x0000000000000000000000000000000000000000"
|
|
112
|
+
},
|
|
113
|
+
"BTCUSD": {
|
|
114
|
+
"gTokenOpenPnlFeed": "0xA22F7b92d81Dd74bE5ca5758DF3FccF0A4CB19cc",
|
|
115
|
+
"gToken": "0xB7Cb7cB7C3cD96e251c9bF8800B9631134BbAdc6"
|
|
100
116
|
}
|
|
101
117
|
},
|
|
102
118
|
"33139": {
|
|
@@ -122,6 +138,10 @@
|
|
|
122
138
|
"GNS": {
|
|
123
139
|
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
124
140
|
"gToken": "0x0000000000000000000000000000000000000000"
|
|
141
|
+
},
|
|
142
|
+
"BTCUSD": {
|
|
143
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
144
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
125
145
|
}
|
|
126
146
|
}
|
|
127
147
|
}
|
package/lib/contracts/index.js
CHANGED
|
@@ -63,6 +63,7 @@ exports.COLLATERAL_TO_CHAIN_COLLATERAL_INDEX = {
|
|
|
63
63
|
},
|
|
64
64
|
[types_1.ChainId.BASE]: {
|
|
65
65
|
[types_1.CollateralTypes.USDC]: 1,
|
|
66
|
+
[types_1.CollateralTypes.BTCUSD]: 2,
|
|
66
67
|
},
|
|
67
68
|
[types_1.ChainId.APECHAIN]: {
|
|
68
69
|
[types_1.CollateralTypes.APE]: 1,
|
|
@@ -75,7 +76,8 @@ exports.COLLATERAL_TO_COLLATERAL_INDEX = {
|
|
|
75
76
|
[types_1.CollateralTypes.USDC]: 3,
|
|
76
77
|
[types_1.CollateralTypes.ARB]: 0,
|
|
77
78
|
[types_1.CollateralTypes.APE]: 0,
|
|
78
|
-
[types_1.CollateralTypes.GNS]: 0,
|
|
79
|
+
[types_1.CollateralTypes.GNS]: 0,
|
|
80
|
+
[types_1.CollateralTypes.BTCUSD]: 0,
|
|
79
81
|
};
|
|
80
82
|
__exportStar(require("./utils"), exports);
|
|
81
83
|
__exportStar(require("./addresses"), exports);
|
|
@@ -9,6 +9,7 @@ var CollateralTypes;
|
|
|
9
9
|
CollateralTypes["USDC"] = "USDC";
|
|
10
10
|
CollateralTypes["APE"] = "APE";
|
|
11
11
|
CollateralTypes["GNS"] = "GNS";
|
|
12
|
+
CollateralTypes["BTCUSD"] = "BTCUSD";
|
|
12
13
|
})(CollateralTypes = exports.CollateralTypes || (exports.CollateralTypes = {}));
|
|
13
14
|
var ContractsVersion;
|
|
14
15
|
(function (ContractsVersion) {
|
|
@@ -492,4 +492,14 @@ const PAIR_INDEX_TO_DESCRIPTION = {
|
|
|
492
492
|
[types_1.PairIndex.BVIVUSD]: "Bitcoin Volmex Implied Volatility 30 Day Index to US Dollar",
|
|
493
493
|
[types_1.PairIndex.EVIVUSD]: "Ethereum Volmex Implied Volatility 30 Day Index to US Dollar",
|
|
494
494
|
[types_1.PairIndex.CRCLUSD]: "Circle Internet Group to US Dollar",
|
|
495
|
+
[types_1.PairIndex.RESOLVUSD]: "Resolv to US Dollar",
|
|
496
|
+
[types_1.PairIndex.SQDUSD]: "Subsquid to US Dollar",
|
|
497
|
+
[types_1.PairIndex.TAIKOUSD]: "Taiko to US Dollar",
|
|
498
|
+
[types_1.PairIndex.HOMEUSD]: "Defi App to US Dollar",
|
|
499
|
+
[types_1.PairIndex.BUSD]: "BUILDon to US Dollar",
|
|
500
|
+
[types_1.PairIndex.HUMAUSD]: "Huma Finance to US Dollar",
|
|
501
|
+
[types_1.PairIndex.SBETUSD]: "Sharplink Gaming Inc to US Dollar",
|
|
502
|
+
[types_1.PairIndex.PLTRUSD]: "Palantir Technologies to US Dollar",
|
|
503
|
+
[types_1.PairIndex.BIDUUSD]: "Baidu to US Dollar",
|
|
504
|
+
[types_1.PairIndex.ROKUUSD]: "Roku to US Dollar",
|
|
495
505
|
};
|
|
@@ -19,7 +19,6 @@ export type GetBorrowingFeeContext = {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const getBorrowingFee: (posDai: number, pairIndex: PairIndex | undefined, long: boolean, initialAccFees: BorrowingFee.InitialAccFees, context: GetBorrowingFeeContext) => number;
|
|
21
21
|
/**
|
|
22
|
-
* @deprecated Use withinMaxGroupOiDynamic from @gains-network/sdk/markets/oi instead
|
|
23
22
|
* @dev This function uses static OI which doesn't reflect current market values
|
|
24
23
|
* @dev The v10 contracts use dynamic OI (beforeV10 + afterV10Token * currentPrice)
|
|
25
24
|
*/
|
|
@@ -78,7 +78,6 @@ const getBorrowingFee = (posDai, pairIndex, long, initialAccFees, context) => {
|
|
|
78
78
|
};
|
|
79
79
|
exports.getBorrowingFee = getBorrowingFee;
|
|
80
80
|
/**
|
|
81
|
-
* @deprecated Use withinMaxGroupOiDynamic from @gains-network/sdk/markets/oi instead
|
|
82
81
|
* @dev This function uses static OI which doesn't reflect current market values
|
|
83
82
|
* @dev The v10 contracts use dynamic OI (beforeV10 + afterV10Token * currentPrice)
|
|
84
83
|
*/
|
package/lib/trade/types.d.ts
CHANGED
|
@@ -629,5 +629,15 @@ export declare enum PairIndex {
|
|
|
629
629
|
LPTUSD = 383,
|
|
630
630
|
BVIVUSD = 384,
|
|
631
631
|
EVIVUSD = 385,
|
|
632
|
-
CRCLUSD = 386
|
|
632
|
+
CRCLUSD = 386,
|
|
633
|
+
RESOLVUSD = 387,
|
|
634
|
+
SQDUSD = 388,
|
|
635
|
+
TAIKOUSD = 389,
|
|
636
|
+
HOMEUSD = 390,
|
|
637
|
+
BUSD = 391,
|
|
638
|
+
HUMAUSD = 392,
|
|
639
|
+
SBETUSD = 393,
|
|
640
|
+
PLTRUSD = 394,
|
|
641
|
+
BIDUUSD = 395,
|
|
642
|
+
ROKUUSD = 396
|
|
633
643
|
}
|
package/lib/trade/types.js
CHANGED
|
@@ -416,4 +416,14 @@ var PairIndex;
|
|
|
416
416
|
PairIndex[PairIndex["BVIVUSD"] = 384] = "BVIVUSD";
|
|
417
417
|
PairIndex[PairIndex["EVIVUSD"] = 385] = "EVIVUSD";
|
|
418
418
|
PairIndex[PairIndex["CRCLUSD"] = 386] = "CRCLUSD";
|
|
419
|
+
PairIndex[PairIndex["RESOLVUSD"] = 387] = "RESOLVUSD";
|
|
420
|
+
PairIndex[PairIndex["SQDUSD"] = 388] = "SQDUSD";
|
|
421
|
+
PairIndex[PairIndex["TAIKOUSD"] = 389] = "TAIKOUSD";
|
|
422
|
+
PairIndex[PairIndex["HOMEUSD"] = 390] = "HOMEUSD";
|
|
423
|
+
PairIndex[PairIndex["BUSD"] = 391] = "BUSD";
|
|
424
|
+
PairIndex[PairIndex["HUMAUSD"] = 392] = "HUMAUSD";
|
|
425
|
+
PairIndex[PairIndex["SBETUSD"] = 393] = "SBETUSD";
|
|
426
|
+
PairIndex[PairIndex["PLTRUSD"] = 394] = "PLTRUSD";
|
|
427
|
+
PairIndex[PairIndex["BIDUUSD"] = 395] = "BIDUUSD";
|
|
428
|
+
PairIndex[PairIndex["ROKUUSD"] = 396] = "ROKUUSD";
|
|
419
429
|
})(PairIndex = exports.PairIndex || (exports.PairIndex = {}));
|