@gainsnetwork/sdk 1.6.0-rc1 → 1.6.0

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.
@@ -431,6 +431,10 @@ export declare const pairs: {
431
431
  "SOMI/USD": string;
432
432
  "HEMI/USD": string;
433
433
  "FF/USD": string;
434
+ "USELESS/USD": string;
435
+ "MON/USD": string;
436
+ "MET/USD": string;
437
+ "TURTLE/USD": string;
434
438
  };
435
439
  export declare const syntheticPairs: Set<string>;
436
440
  export declare const parentToSyntheticPairMap: Map<string, string>;
package/lib/constants.js CHANGED
@@ -439,6 +439,10 @@ exports.pairs = {
439
439
  "SOMI/USD": CRYPTO,
440
440
  "HEMI/USD": CRYPTO,
441
441
  "FF/USD": CRYPTO,
442
+ "USELESS/USD": CRYPTO,
443
+ "MON/USD": CRYPTO,
444
+ "MET/USD": CRYPTO,
445
+ "TURTLE/USD": CRYPTO,
442
446
  };
443
447
  exports.syntheticPairs = new Set([
444
448
  "BTCDEGEN/USD",
@@ -486,12 +490,14 @@ exports.stockSplits = {
486
490
  "TSLA_1/USD": { date: "8/25/2022", split: 3 },
487
491
  };
488
492
  exports.delistedPairIxs = new Set([
489
- 4, 6, 12, 15, 24, 25, 27, 28, 30, 31, 36, 48, 51, 52, 53, 54, 56, 59, 60,
490
- 61, 63, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 95, 96, 97, 98,
491
- 99, 101, 106, 111, 113, 114, 116, 118, 120, 122, 123, 125, 127, 130, 147, 152,
492
- 160, 163, 170, 179, 182, 183, 188, 189, 190, 208, 209, 225, 229, 230, 231,
493
- 238, 239, 241, 250, 253, 254, 258, 270, 275, 276, 278, 279, 285, 290, 294,
494
- 296, 305, 311, 330, 349, 352, 353, 354, 355, 357, 365, 366, 395, 396,
493
+ 4, 6, 12, 15, 24, 25, 27, 28, 30, 31, 36, 41, 48, 51, 52, 53, 54, 56, 59, 60, 61,
494
+ 63, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 95, 96, 97, 98, 99,
495
+ 101, 106, 111, 113, 114, 116, 118, 120, 122, 123, 125, 127, 130, 147, 152,
496
+ 160, 163, 170, 179, 182, 183, 186, 188, 189, 190, 198, 208, 209, 224, 225, 227,
497
+ 229, 230, 231, 234, 238, 239, 241, 247, 250, 253, 254, 258, 261, 270, 272, 275,
498
+ 276, 278, 279, 280, 285, 290, 291, 292, 294, 296, 303, 305, 306, 311, 322, 330,
499
+ 333, 336, 337, 342, 343, 344, 347, 349, 350, 352, 354, 355, 357, 365, 366, 395,
500
+ 396, 400, 401, 408, 423, 427, 433,
495
501
  ]);
496
502
  exports.delistedGroupsIxs = new Set([]);
497
503
  exports.DEFAULT_PROTECTION_CLOSE_FACTOR = 1;
@@ -585,4 +585,8 @@ const PAIR_INDEX_TO_DESCRIPTION = {
585
585
  [types_1.PairIndex.SOMIUSD]: "Somnia to US Dollar",
586
586
  [types_1.PairIndex.HEMIUSD]: "Hemi to US Dollar",
587
587
  [types_1.PairIndex.FFUSD]: "Falcon Finance to US Dollar",
588
+ [types_1.PairIndex.USELESSUSD]: "Useless Coin to US Dollar",
589
+ [types_1.PairIndex.MONUSD]: "Monad to US Dollar",
590
+ [types_1.PairIndex.METUSD]: "Meteora to US Dollar",
591
+ [types_1.PairIndex.TURTLEUSD]: "Turtle to US Dollar",
588
592
  };
@@ -35,3 +35,12 @@ export declare const isGnsStakingCooldownActive: (traderFeeTiers: TraderFeeTiers
35
35
  isActive: boolean;
36
36
  expiryTs: number;
37
37
  };
38
+ /**
39
+ * @dev Helper function to get the fee multiplier based on GNS and gGNS amounts. Useful to estimate fee multiplier after staking/unstaking.
40
+ * @param amountGns Amount of GNS staked
41
+ * @param amountGGns Amount of gGNS staked
42
+ * @param bonusAmount GNS bonus amount
43
+ * @param stakingTiers Array of staking fee tiers
44
+ * @param gGnsPrice Conversion ratio from gGNS to GNS (e.g., 0.8 means 1 gGNS = 0.8 GNS, 1.1 means 1 gGNS = 1.1 GNS); Defaults to 1 (e.g., 1 gGNS = 1 GNS)
45
+ */
46
+ export declare const getStakingFeeMultiplier: (amountGns: number, amountGGns: number, bonusAmount: number, stakingTiers: FeeTier[], gGnsPrice?: number) => number;
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.isGnsStakingCooldownActive = exports.getTraderFeeMultiplier = exports.calculateFeeAmount = exports.computeFeeMultiplier = exports.getFeeMultiplier = exports.getFeeTiersCount = exports.getCurrentDay = exports.GNS_STAKING_COOLDOWN_SECONDS = exports.MAX_FEE_TIERS = exports.FEE_MULTIPLIER_SCALE = exports.TRAILING_PERIOD_DAYS = void 0;
17
+ exports.getStakingFeeMultiplier = exports.isGnsStakingCooldownActive = exports.getTraderFeeMultiplier = exports.calculateFeeAmount = exports.computeFeeMultiplier = exports.getFeeMultiplier = exports.getFeeTiersCount = exports.getCurrentDay = exports.GNS_STAKING_COOLDOWN_SECONDS = exports.MAX_FEE_TIERS = exports.FEE_MULTIPLIER_SCALE = exports.TRAILING_PERIOD_DAYS = void 0;
18
18
  const types_1 = require("./types");
19
19
  __exportStar(require("./types"), exports);
20
20
  __exportStar(require("./converter"), exports);
@@ -112,3 +112,24 @@ const isGnsStakingCooldownActive = (traderFeeTiers) => {
112
112
  return { isActive: now < expiryTs, expiryTs };
113
113
  };
114
114
  exports.isGnsStakingCooldownActive = isGnsStakingCooldownActive;
115
+ /**
116
+ * @dev Helper function to get the fee multiplier based on GNS and gGNS amounts. Useful to estimate fee multiplier after staking/unstaking.
117
+ * @param amountGns Amount of GNS staked
118
+ * @param amountGGns Amount of gGNS staked
119
+ * @param bonusAmount GNS bonus amount
120
+ * @param stakingTiers Array of staking fee tiers
121
+ * @param gGnsPrice Conversion ratio from gGNS to GNS (e.g., 0.8 means 1 gGNS = 0.8 GNS, 1.1 means 1 gGNS = 1.1 GNS); Defaults to 1 (e.g., 1 gGNS = 1 GNS)
122
+ */
123
+ const getStakingFeeMultiplier = (amountGns, amountGGns, bonusAmount, stakingTiers, gGnsPrice = 1) => {
124
+ let feeMultiplier = exports.FEE_MULTIPLIER_SCALE;
125
+ for (let i = (0, exports.getFeeTiersCount)(stakingTiers); i > 0; --i) {
126
+ const stakingTier = stakingTiers[i - 1];
127
+ if (amountGns + amountGGns * gGnsPrice + bonusAmount >=
128
+ stakingTier.pointsThreshold) {
129
+ feeMultiplier = stakingTier.feeMultiplier;
130
+ break;
131
+ }
132
+ }
133
+ return feeMultiplier;
134
+ };
135
+ exports.getStakingFeeMultiplier = getStakingFeeMultiplier;
@@ -759,5 +759,9 @@ export declare enum PairIndex {
759
759
  CAMPUSD = 428,
760
760
  SOMIUSD = 429,
761
761
  HEMIUSD = 430,
762
- FFUSD = 431
762
+ FFUSD = 431,
763
+ USELESSUSD = 432,
764
+ MONUSD = 433,
765
+ METUSD = 434,
766
+ TURTLEUSD = 435
763
767
  }
@@ -461,4 +461,8 @@ var PairIndex;
461
461
  PairIndex[PairIndex["SOMIUSD"] = 429] = "SOMIUSD";
462
462
  PairIndex[PairIndex["HEMIUSD"] = 430] = "HEMIUSD";
463
463
  PairIndex[PairIndex["FFUSD"] = 431] = "FFUSD";
464
+ PairIndex[PairIndex["USELESSUSD"] = 432] = "USELESSUSD";
465
+ PairIndex[PairIndex["MONUSD"] = 433] = "MONUSD";
466
+ PairIndex[PairIndex["METUSD"] = 434] = "METUSD";
467
+ PairIndex[PairIndex["TURTLEUSD"] = 435] = "TURTLEUSD";
464
468
  })(PairIndex = exports.PairIndex || (exports.PairIndex = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gainsnetwork/sdk",
3
- "version": "1.6.0-rc1",
3
+ "version": "1.6.0",
4
4
  "description": "Gains Network SDK",
5
5
  "main": "./lib/index.js",
6
6
  "files": [