@gainsnetwork/sdk 1.8.1-rc1 → 1.8.1-rc3
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 +1 -0
- package/lib/constants.js +17 -10
- package/lib/contracts/addresses.json +0 -90
- package/lib/contracts/index.js +0 -7
- 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/GNSBorrowingFeesV6_3_2.d.ts +979 -0
- package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.js +2 -0
- package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.d.ts +1058 -0
- package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.js +2 -0
- 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/GNSPairInfosV6_1.d.ts +911 -0
- package/lib/contracts/types/generated/GNSPairInfosV6_1.js +2 -0
- package/lib/contracts/types/generated/GNSPairsStorageV6.d.ts +660 -0
- package/lib/contracts/types/generated/GNSPairsStorageV6.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/GNSTradingCallbacksV6_3_2.d.ts +806 -0
- package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.js +2 -0
- package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.d.ts +821 -0
- package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.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/GTokenV6_3_2.d.ts +1838 -0
- package/lib/contracts/types/generated/GTokenV6_3_2.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/GNSBorrowingFeesV6_3_2__factory.d.ts +88 -0
- package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.js +1654 -0
- package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.d.ts +113 -0
- package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.js +1742 -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/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/GNSPairInfosV6_1__factory.d.ts +98 -0
- package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.js +1485 -0
- package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.d.ts +117 -0
- package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.js +1265 -0
- package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.d.ts +82 -0
- package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.js +1273 -0
- package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.d.ts +82 -0
- package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.js +1326 -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/types/generated/factories/GTokenV6_3_2__factory.d.ts +110 -0
- package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.js +2682 -0
- package/lib/contracts/types/index.d.ts +2 -5
- package/lib/contracts/types/index.js +0 -3
- package/lib/markets/classification.d.ts +9 -0
- package/lib/markets/classification.js +41 -0
- package/lib/markets/index.d.ts +1 -0
- package/lib/markets/index.js +1 -0
- package/lib/markets/oi/fetcher.d.ts +58 -0
- package/lib/markets/oi/fetcher.js +181 -0
- package/lib/markets/oi/validation.d.ts +80 -0
- package/lib/markets/oi/validation.js +172 -0
- package/lib/markets/price/signedPrices.js +0 -2
- package/lib/pricing/depthBands/converter.d.ts +65 -0
- package/lib/pricing/depthBands/converter.js +155 -0
- package/lib/pricing/depthBands/decoder.d.ts +32 -0
- package/lib/pricing/depthBands/decoder.js +109 -0
- package/lib/pricing/depthBands/encoder.d.ts +19 -0
- package/lib/pricing/depthBands/encoder.js +105 -0
- package/lib/pricing/depthBands/index.d.ts +8 -0
- package/lib/pricing/depthBands/index.js +26 -0
- package/lib/pricing/depthBands/types.d.ts +49 -0
- package/lib/pricing/depthBands/types.js +10 -0
- package/lib/pricing/depthBands/validator.d.ts +22 -0
- package/lib/pricing/depthBands/validator.js +113 -0
- package/lib/trade/effectiveLeverage/builder.d.ts +23 -0
- package/lib/trade/effectiveLeverage/builder.js +30 -0
- package/lib/trade/fees/borrowingV2/fetcher.d.ts +0 -1
- package/lib/trade/fees/holdingFees/index.d.ts +46 -0
- package/lib/trade/fees/holdingFees/index.js +105 -0
- package/lib/trade/fees/holdingFees/types.d.ts +23 -0
- package/lib/trade/fees/holdingFees/types.js +5 -0
- package/lib/trade/fees/trading/holdingFees.d.ts +28 -0
- package/lib/trade/fees/trading/holdingFees.js +66 -0
- package/lib/trade/fees/trading/holdingFeesStructured.d.ts +28 -0
- package/lib/trade/fees/trading/holdingFeesStructured.js +66 -0
- package/lib/trade/priceImpact/index.js +3 -1
- package/package.json +1 -1
package/lib/constants.d.ts
CHANGED
|
@@ -480,6 +480,7 @@ export declare const stockSplits: {
|
|
|
480
480
|
split: number;
|
|
481
481
|
};
|
|
482
482
|
};
|
|
483
|
+
export declare const corePairIndices: Set<number>;
|
|
483
484
|
export declare const delistedPairIxs: Set<number>;
|
|
484
485
|
export declare const delistedGroupsIxs: Set<never>;
|
|
485
486
|
export declare const DEFAULT_PROTECTION_CLOSE_FACTOR = 1;
|
package/lib/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_CUMULATIVE_FACTOR = exports.DEFAULT_PROTECTION_CLOSE_FACTOR = exports.delistedGroupsIxs = exports.delistedPairIxs = exports.stockSplits = exports.tickerChanges = exports.getAssetClassFromGroupIndex = exports.parentToSyntheticPairMap = exports.syntheticPairs = exports.pairs = void 0;
|
|
3
|
+
exports.DEFAULT_CUMULATIVE_FACTOR = exports.DEFAULT_PROTECTION_CLOSE_FACTOR = exports.delistedGroupsIxs = exports.delistedPairIxs = exports.corePairIndices = exports.stockSplits = exports.tickerChanges = exports.getAssetClassFromGroupIndex = exports.parentToSyntheticPairMap = exports.syntheticPairs = exports.pairs = void 0;
|
|
4
4
|
const CRYPTO = "crypto";
|
|
5
5
|
const FOREX = "forex";
|
|
6
6
|
const STOCKS = "stocks";
|
|
@@ -503,16 +503,23 @@ exports.stockSplits = {
|
|
|
503
503
|
"TSLA_1/USD": { date: "8/25/2022", split: 3 },
|
|
504
504
|
"NFLX_1/USD": { date: "11/17/2025", split: 10 },
|
|
505
505
|
};
|
|
506
|
+
exports.corePairIndices = new Set([
|
|
507
|
+
0, 1, 2, 3, 5, 7, 8, 11, 12, 13, 17, 18, 19, 20, 33, 35, 39, 40, 41, 44, 47,
|
|
508
|
+
49, 50, 57, 90, 91, 102, 103, 104, 105, 107, 109, 129, 134, 137, 138, 139,
|
|
509
|
+
140, 141, 142, 144, 145, 153, 155, 159, 168, 171, 188, 189, 190, 191, 193,
|
|
510
|
+
205, 215, 216, 217, 219, 223, 269, 299, 307, 320, 321, 328, 331, 332, 347,
|
|
511
|
+
358, 407, 413, 414, 418, 442,
|
|
512
|
+
]);
|
|
506
513
|
exports.delistedPairIxs = new Set([
|
|
507
|
-
4, 6, 12, 15, 24, 25, 27, 28, 30, 31, 36, 41, 52, 53, 54, 59, 60,
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
349, 350, 351, 352, 353, 354, 355, 357, 362, 365, 366, 372, 379, 380, 387,
|
|
515
|
-
396, 400, 401, 408, 423, 427, 428, 430, 435, 436, 437, 438, 441,
|
|
514
|
+
4, 6, 12, 15, 24, 25, 27, 28, 30, 31, 36, 41, 52, 53, 54, 59, 60, 61, 63, 66,
|
|
515
|
+
67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 95, 96, 97, 98, 99, 101, 106,
|
|
516
|
+
111, 113, 114, 116, 118, 120, 122, 123, 125, 127, 130, 147, 152, 160, 163,
|
|
517
|
+
170, 179, 182, 183, 186, 198, 208, 209, 221, 224, 225, 227, 229, 230, 231,
|
|
518
|
+
234, 238, 239, 241, 247, 250, 253, 254, 255, 258, 261, 268, 270, 272, 273,
|
|
519
|
+
275, 276, 278, 279, 280, 281, 284, 285, 290, 291, 292, 294, 296, 303, 305,
|
|
520
|
+
306, 311, 312, 322, 323, 330, 333, 335, 336, 337, 342, 343, 344, 346, 347,
|
|
521
|
+
349, 350, 351, 352, 353, 354, 355, 357, 362, 365, 366, 372, 379, 380, 387,
|
|
522
|
+
395, 396, 400, 401, 408, 423, 427, 428, 430, 435, 436, 437, 438, 441,
|
|
516
523
|
]);
|
|
517
524
|
exports.delistedGroupsIxs = new Set([]);
|
|
518
525
|
exports.DEFAULT_PROTECTION_CLOSE_FACTOR = 1;
|
|
@@ -26,10 +26,6 @@
|
|
|
26
26
|
"BTCUSD": {
|
|
27
27
|
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
28
28
|
"gToken": "0x0000000000000000000000000000000000000000"
|
|
29
|
-
},
|
|
30
|
-
"USDM": {
|
|
31
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
32
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
33
29
|
}
|
|
34
30
|
},
|
|
35
31
|
"42161": {
|
|
@@ -59,10 +55,6 @@
|
|
|
59
55
|
"BTCUSD": {
|
|
60
56
|
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
61
57
|
"gToken": "0x0000000000000000000000000000000000000000"
|
|
62
|
-
},
|
|
63
|
-
"USDM": {
|
|
64
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
65
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
66
58
|
}
|
|
67
59
|
},
|
|
68
60
|
"421614": {
|
|
@@ -92,10 +84,6 @@
|
|
|
92
84
|
"BTCUSD": {
|
|
93
85
|
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
94
86
|
"gToken": "0x0000000000000000000000000000000000000000"
|
|
95
|
-
},
|
|
96
|
-
"USDM": {
|
|
97
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
98
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
99
87
|
}
|
|
100
88
|
},
|
|
101
89
|
"8453": {
|
|
@@ -125,10 +113,6 @@
|
|
|
125
113
|
"BTCUSD": {
|
|
126
114
|
"gTokenOpenPnlFeed": "0xcEc10C66d711250db67945254F79628457365CC8",
|
|
127
115
|
"gToken": "0xB7Cb7cB7C3cD96e251c9bF8800B9631134BbAdc6"
|
|
128
|
-
},
|
|
129
|
-
"USDM": {
|
|
130
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
131
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
132
116
|
}
|
|
133
117
|
},
|
|
134
118
|
"33139": {
|
|
@@ -158,10 +142,6 @@
|
|
|
158
142
|
"BTCUSD": {
|
|
159
143
|
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
160
144
|
"gToken": "0x0000000000000000000000000000000000000000"
|
|
161
|
-
},
|
|
162
|
-
"USDM": {
|
|
163
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
164
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
165
145
|
}
|
|
166
146
|
},
|
|
167
147
|
"421614-release": {
|
|
@@ -191,76 +171,6 @@
|
|
|
191
171
|
"BTCUSD": {
|
|
192
172
|
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
193
173
|
"gToken": "0x0000000000000000000000000000000000000000"
|
|
194
|
-
},
|
|
195
|
-
"USDM": {
|
|
196
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
197
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
"6343": {
|
|
201
|
-
"global": {
|
|
202
|
-
"gnsMultiCollatDiamond": "0xc4DaF6E8A8484ed88c963Cd3b62023ec48685051"
|
|
203
|
-
},
|
|
204
|
-
"DAI": {
|
|
205
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
206
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
207
|
-
},
|
|
208
|
-
"ETH": {
|
|
209
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
210
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
211
|
-
},
|
|
212
|
-
"USDC": {
|
|
213
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
214
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
215
|
-
},
|
|
216
|
-
"APE": {
|
|
217
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
218
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
219
|
-
},
|
|
220
|
-
"GNS": {
|
|
221
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
222
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
223
|
-
},
|
|
224
|
-
"BTCUSD": {
|
|
225
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
226
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
227
|
-
},
|
|
228
|
-
"USDM": {
|
|
229
|
-
"gTokenOpenPnlFeed": "0x949D41d8C498f8A3537af608634A64084C2Deb00",
|
|
230
|
-
"gToken": "0x422fAd2E37761a6635Db6042E8330EC5E8A2e7aF"
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
"4326": {
|
|
234
|
-
"global": {
|
|
235
|
-
"gnsMultiCollatDiamond": "0x0000000000000000000000000000000000000000"
|
|
236
|
-
},
|
|
237
|
-
"DAI": {
|
|
238
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
239
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
240
|
-
},
|
|
241
|
-
"ETH": {
|
|
242
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
243
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
244
|
-
},
|
|
245
|
-
"USDC": {
|
|
246
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
247
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
248
|
-
},
|
|
249
|
-
"APE": {
|
|
250
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
251
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
252
|
-
},
|
|
253
|
-
"GNS": {
|
|
254
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
255
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
256
|
-
},
|
|
257
|
-
"BTCUSD": {
|
|
258
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
259
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
260
|
-
},
|
|
261
|
-
"USDM": {
|
|
262
|
-
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
263
|
-
"gToken": "0x0000000000000000000000000000000000000000"
|
|
264
174
|
}
|
|
265
175
|
}
|
|
266
176
|
}
|
package/lib/contracts/index.js
CHANGED
|
@@ -67,12 +67,6 @@ exports.COLLATERAL_TO_CHAIN_COLLATERAL_INDEX = {
|
|
|
67
67
|
[types_1.ChainId.APECHAIN]: {
|
|
68
68
|
[types_1.CollateralTypes.APE]: 1,
|
|
69
69
|
},
|
|
70
|
-
[types_1.ChainId.MEGAETH]: {
|
|
71
|
-
[types_1.CollateralTypes.USDM]: 1,
|
|
72
|
-
},
|
|
73
|
-
[types_1.ChainId.MEGAETH_TESTNET]: {
|
|
74
|
-
[types_1.CollateralTypes.USDM]: 1,
|
|
75
|
-
},
|
|
76
70
|
};
|
|
77
71
|
// @deprecated use `COLLATERAL_TO_CHAIN_COLLATERAL_INDEX` instead
|
|
78
72
|
exports.COLLATERAL_TO_COLLATERAL_INDEX = {
|
|
@@ -83,7 +77,6 @@ exports.COLLATERAL_TO_COLLATERAL_INDEX = {
|
|
|
83
77
|
[types_1.CollateralTypes.APE]: 0,
|
|
84
78
|
[types_1.CollateralTypes.GNS]: 0,
|
|
85
79
|
[types_1.CollateralTypes.BTCUSD]: 0,
|
|
86
|
-
[types_1.CollateralTypes.USDM]: 0,
|
|
87
80
|
};
|
|
88
81
|
__exportStar(require("./utils"), exports);
|
|
89
82
|
__exportStar(require("./addresses"), exports);
|