@gmx-io/sdk 1.5.0-alpha-3 → 1.5.0-alpha-5

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.
Files changed (47) hide show
  1. package/build/cjs/scripts/subsquid-codegen.js +1 -1
  2. package/build/cjs/src/clients/v1/modules/trades/trades.js +2 -5
  3. package/build/cjs/src/clients/v1/testUtil.js +1 -1
  4. package/build/cjs/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +16 -0
  5. package/build/cjs/src/codegen/prebuilt/hashedMarketConfigKeys.json +114 -0
  6. package/build/cjs/src/codegen/prebuilt/hashedMarketValuesKeys.json +30 -0
  7. package/build/cjs/src/codegen/subsquid.js +94 -424
  8. package/build/cjs/src/configs/express.js +7 -2
  9. package/build/cjs/src/configs/markets.js +14 -0
  10. package/build/cjs/src/configs/tokens.js +22 -0
  11. package/build/cjs/src/utils/__tests__/numbers.spec.js +19 -0
  12. package/build/cjs/src/utils/__tests__/orderTransactions/batchUtils.spec.js +45 -0
  13. package/build/cjs/src/utils/errors/transactionsErrors.js +32 -0
  14. package/build/cjs/src/utils/fees/priceImpact.js +5 -1
  15. package/build/cjs/src/utils/gelatoRelay/utils.js +14 -8
  16. package/build/cjs/src/utils/numbers/utils.js +45 -8
  17. package/build/cjs/src/utils/orderTransactions/utils.js +6 -3
  18. package/build/cjs/src/utils/positions/utils.js +3 -1
  19. package/build/cjs/src/utils/tradeHistory/utils.js +2 -2
  20. package/build/esm/scripts/subsquid-codegen.js +1 -1
  21. package/build/esm/src/clients/v1/modules/trades/trades.js +2 -5
  22. package/build/esm/src/clients/v1/testUtil.js +1 -1
  23. package/build/esm/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +16 -0
  24. package/build/esm/src/codegen/prebuilt/hashedMarketConfigKeys.json +114 -0
  25. package/build/esm/src/codegen/prebuilt/hashedMarketValuesKeys.json +30 -0
  26. package/build/esm/src/codegen/subsquid.js +93 -423
  27. package/build/esm/src/configs/express.js +6 -1
  28. package/build/esm/src/configs/markets.js +14 -0
  29. package/build/esm/src/configs/tokens.js +22 -0
  30. package/build/esm/src/utils/__tests__/numbers.spec.js +20 -1
  31. package/build/esm/src/utils/__tests__/orderTransactions/batchUtils.spec.js +45 -0
  32. package/build/esm/src/utils/errors/transactionsErrors.js +32 -0
  33. package/build/esm/src/utils/fees/priceImpact.js +5 -1
  34. package/build/esm/src/utils/gelatoRelay/utils.js +11 -4
  35. package/build/esm/src/utils/numbers/utils.js +45 -8
  36. package/build/esm/src/utils/orderTransactions/utils.js +6 -3
  37. package/build/esm/src/utils/positions/utils.js +3 -1
  38. package/build/esm/src/utils/tradeHistory/utils.js +2 -2
  39. package/build/types/src/codegen/prebuilt/index.d.ts +160 -0
  40. package/build/types/src/codegen/subsquid.d.ts +392 -587
  41. package/build/types/src/configs/express.d.ts +2 -1
  42. package/build/types/src/utils/errors/transactionsErrors.d.ts +33 -1
  43. package/build/types/src/utils/gelatoRelay/utils.d.ts +4 -2
  44. package/build/types/src/utils/numbers/utils.d.ts +2 -1
  45. package/build/types/src/utils/orderTransactions/utils.d.ts +2 -2
  46. package/build/types/src/utils/tradeHistory/types.d.ts +2 -6
  47. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRelayerFeeToken = exports.getDefaultGasPaymentToken = exports.getGasPaymentTokens = exports.EXPRESS_RESIDUAL_AMOUNT_MULTIPLIER = exports.EXPRESS_DEFAULT_MAX_RESIDUAL_USD = exports.EXPRESS_DEFAULT_MIN_RESIDUAL_USD = exports.EXPRESS_DEFAULT_MIN_RESIDUAL_USD_NUMBER = exports.EXPRESS_EXTRA_EXECUTION_FEE_BUFFER_BPS = exports.MIN_RELAYER_FEE_USD = exports.MIN_GELATO_USD_BALANCE_FOR_SPONSORED_CALL = exports.DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION = exports.DEFAULT_PERMIT_DEADLINE_DURATION = exports.DEFAULT_SUBACCOUNT_MAX_ALLOWED_COUNT = exports.DEFAULT_SUBACCOUNT_EXPIRY_DURATION = exports.SUBACCOUNT_DOCS_URL = exports.SUBACCOUNT_MESSAGE = void 0;
3
+ exports.getRelayerFeeToken = exports.getDefaultGasPaymentToken = exports.getGasPaymentTokens = exports.EXPRESS_RESIDUAL_AMOUNT_MULTIPLIER = exports.EXPRESS_DEFAULT_MAX_RESIDUAL_USD = exports.EXPRESS_DEFAULT_MIN_RESIDUAL_USD = exports.EXPRESS_DEFAULT_MIN_RESIDUAL_USD_NUMBER = exports.EXPRESS_EXTRA_EXECUTION_FEE_BUFFER_BPS = exports.GELATO_API_KEYS = exports.MIN_RELAYER_FEE_USD = exports.DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION = exports.DEFAULT_PERMIT_DEADLINE_DURATION = exports.DEFAULT_SUBACCOUNT_MAX_ALLOWED_COUNT = exports.DEFAULT_SUBACCOUNT_EXPIRY_DURATION = exports.SUBACCOUNT_DOCS_URL = exports.SUBACCOUNT_MESSAGE = void 0;
4
4
  const numbers_1 = require("../utils/numbers");
5
5
  const time_1 = require("../utils/time");
6
6
  const chains_1 = require("./chains");
@@ -11,8 +11,13 @@ exports.DEFAULT_SUBACCOUNT_EXPIRY_DURATION = (0, time_1.periodToSeconds)(7, "1d"
11
11
  exports.DEFAULT_SUBACCOUNT_MAX_ALLOWED_COUNT = 90;
12
12
  exports.DEFAULT_PERMIT_DEADLINE_DURATION = (0, time_1.periodToSeconds)(1, "1h");
13
13
  exports.DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION = (0, time_1.periodToSeconds)(1, "1h");
14
- exports.MIN_GELATO_USD_BALANCE_FOR_SPONSORED_CALL = (0, numbers_1.expandDecimals)(100, numbers_1.USD_DECIMALS); // 100$
15
14
  exports.MIN_RELAYER_FEE_USD = 5n ** BigInt(numbers_1.USD_DECIMALS - 1); // 0.5$
15
+ exports.GELATO_API_KEYS = {
16
+ [chains_1.ARBITRUM]: "6dE6kOa9pc1ap4dQQC2iaK9i6nBFp8eYxQlm00VreWc_",
17
+ [chains_1.AVALANCHE]: "FalsQh9loL6V0rwPy4gWgnQPR6uTHfWjSVT2qlTzUq4_",
18
+ [chains_1.BOTANIX]: "s5GgkfX7dvd_2uYqsRSCjzMekUrXh0dibUvfLab1Anc_",
19
+ [chains_1.ARBITRUM_SEPOLIA]: "nx5nyAg4h2kI_64YtOuPt7LSPDEXo4u8eJY_idF9xDw_",
20
+ };
16
21
  exports.EXPRESS_EXTRA_EXECUTION_FEE_BUFFER_BPS = 1000;
17
22
  exports.EXPRESS_DEFAULT_MIN_RESIDUAL_USD_NUMBER = 20;
18
23
  exports.EXPRESS_DEFAULT_MIN_RESIDUAL_USD = (0, numbers_1.expandDecimals)(exports.EXPRESS_DEFAULT_MIN_RESIDUAL_USD_NUMBER, numbers_1.USD_DECIMALS);
@@ -890,6 +890,20 @@ exports.MARKETS = {
890
890
  longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
891
891
  shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
892
892
  },
893
+ // CC/USD [WBTC-USDC]
894
+ "0x45F0331a6e175B556Bc7d28E0A1c349525006d4E": {
895
+ marketTokenAddress: "0x45F0331a6e175B556Bc7d28E0A1c349525006d4E",
896
+ indexTokenAddress: "0x7F2A3967bd0999A860E13Ab8DC34aF98675CC208",
897
+ longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
898
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
899
+ },
900
+ // MET/USD [WBTC-USDC]
901
+ "0xbA30e198CFFeBEf0A84D6943cC8B2e356E324112": {
902
+ marketTokenAddress: "0xbA30e198CFFeBEf0A84D6943cC8B2e356E324112",
903
+ indexTokenAddress: "0x84D523493Aac127025AC770981a54C9601326A41",
904
+ longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
905
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
906
+ },
893
907
  },
894
908
  [chains_1.AVALANCHE]: {
895
909
  // BTC/USD [BTC-USDC]
@@ -1253,6 +1253,28 @@ exports.TOKENS = {
1253
1253
  categories: ["layer1"],
1254
1254
  imageUrl: "https://assets.coingecko.com/coins/images/54035/standard/Transparent_bg.png?1738075331",
1255
1255
  },
1256
+ {
1257
+ name: "Canton",
1258
+ symbol: "CC",
1259
+ address: "0x7F2A3967bd0999A860E13Ab8DC34aF98675CC208",
1260
+ isSynthetic: true,
1261
+ decimals: 18,
1262
+ priceDecimals: 5,
1263
+ categories: ["layer1"],
1264
+ imageUrl: "https://assets.coingecko.com/coins/images/70468/standard/Canton-Ticker_%281%29.png?1762826299",
1265
+ explorerUrl: "https://arbiscan.io/token/0x7F2A3967bd0999A860E13Ab8DC34aF98675CC208",
1266
+ },
1267
+ {
1268
+ name: "Meteora",
1269
+ symbol: "MET",
1270
+ address: "0x84D523493Aac127025AC770981a54C9601326A41",
1271
+ isSynthetic: true,
1272
+ decimals: 18,
1273
+ priceDecimals: 5,
1274
+ categories: ["defi"],
1275
+ imageUrl: "https://assets.coingecko.com/coins/images/69110/standard/meteora.png?1757517561",
1276
+ explorerUrl: "https://arbiscan.io/token/0x84D523493Aac127025AC770981a54C9601326A41",
1277
+ },
1256
1278
  ],
1257
1279
  [chains_1.AVALANCHE]: [
1258
1280
  {
@@ -82,6 +82,25 @@ const ONE_USD = 1000000000000000000000000000000n;
82
82
  (0, vitest_1.expect)((0, numbers_1.numberToBigint)(-1.123456789, 6)).toEqual(-1123456n);
83
83
  });
84
84
  });
85
+ (0, vitest_1.describe)("trimZeroDecimals", () => {
86
+ (0, vitest_1.it)("large integer stays as plain string (no scientific)", () => {
87
+ const large = "1" + "0".repeat(31);
88
+ (0, vitest_1.expect)((0, numbers_1.trimZeroDecimals)(large)).toBe(large);
89
+ });
90
+ (0, vitest_1.it)("negative large integer", () => {
91
+ const largeNeg = "-" + "1" + "0".repeat(31);
92
+ (0, vitest_1.expect)((0, numbers_1.trimZeroDecimals)(largeNeg)).toBe(largeNeg);
93
+ });
94
+ (0, vitest_1.it)("fraction with only zero decimals trims to int", () => {
95
+ (0, vitest_1.expect)((0, numbers_1.trimZeroDecimals)("123.000")).toBe("123");
96
+ });
97
+ (0, vitest_1.it)("leading zeros on integer are removed", () => {
98
+ (0, vitest_1.expect)((0, numbers_1.trimZeroDecimals)("0000123")).toBe("123");
99
+ });
100
+ (0, vitest_1.it)("leading zeros with trailing zero decimals trims to int", () => {
101
+ (0, vitest_1.expect)((0, numbers_1.trimZeroDecimals)("0000123.000")).toBe("123");
102
+ });
103
+ });
85
104
  (0, vitest_1.describe)("toBigNumberWithDecimals", () => {
86
105
  (0, vitest_1.it)("should convert string to big number with decimals", () => {
87
106
  (0, vitest_1.expect)((0, numbers_1.toBigNumberWithDecimals)("0", numbers_1.PRECISION_DECIMALS)).toBe(0n);
@@ -177,6 +177,51 @@ function buildMultiIncreaseBatch(paramsList) {
177
177
  });
178
178
  });
179
179
  (0, vitest_1.describe)("getBatchTotalExecutionFee", () => {
180
+ (0, vitest_1.it)("returns undefined for empty batch", () => {
181
+ const tokensData = {
182
+ [WETH.address]: {
183
+ ...WETH,
184
+ prices: {
185
+ minPrice: (0, numbers_1.expandDecimals)(2000, numbers_1.USD_DECIMALS),
186
+ maxPrice: (0, numbers_1.expandDecimals)(2000, numbers_1.USD_DECIMALS),
187
+ },
188
+ },
189
+ };
190
+ const result = (0, orderTransactions_1.getBatchTotalExecutionFee)({
191
+ batchParams: { createOrderParams: [], updateOrderParams: [], cancelOrderParams: [] },
192
+ tokensData,
193
+ chainId: CHAIN_ID,
194
+ });
195
+ (0, vitest_1.expect)(result).toBeUndefined();
196
+ });
197
+ (0, vitest_1.it)("returns valid ExecutionFee with zero amounts for cancel-only batch", () => {
198
+ const tokensData = {
199
+ [WETH.address]: {
200
+ ...WETH,
201
+ prices: {
202
+ minPrice: (0, numbers_1.expandDecimals)(2000, numbers_1.USD_DECIMALS),
203
+ maxPrice: (0, numbers_1.expandDecimals)(2000, numbers_1.USD_DECIMALS),
204
+ },
205
+ },
206
+ };
207
+ const result = (0, orderTransactions_1.getBatchTotalExecutionFee)({
208
+ batchParams: {
209
+ createOrderParams: [],
210
+ updateOrderParams: [],
211
+ cancelOrderParams: [{ orderKey: "0x123" }],
212
+ },
213
+ tokensData,
214
+ chainId: CHAIN_ID,
215
+ });
216
+ (0, vitest_1.expect)(result).toEqual({
217
+ feeTokenAmount: 0n,
218
+ gasLimit: 0n,
219
+ feeUsd: 0n,
220
+ feeToken: tokensData[WETH.address],
221
+ isFeeHigh: false,
222
+ isFeeVeryHigh: false,
223
+ });
224
+ });
180
225
  (0, vitest_1.it)("calculates total execution fee including top-ups", () => {
181
226
  const params5 = {
182
227
  ...commonMarketIncreaseParams,
@@ -62,10 +62,42 @@ const TX_ERROR_PATTERNS = {
62
62
  };
63
63
  var CustomErrorName;
64
64
  (function (CustomErrorName) {
65
+ CustomErrorName["DisabledMarket"] = "DisabledMarket";
65
66
  CustomErrorName["EndOfOracleSimulation"] = "EndOfOracleSimulation";
67
+ CustomErrorName["ExternalCallFailed"] = "ExternalCallFailed";
68
+ CustomErrorName["InsufficientCollateralAmount"] = "InsufficientCollateralAmount";
69
+ CustomErrorName["InsufficientCollateralUsd"] = "InsufficientCollateralUsd";
70
+ CustomErrorName["InsufficientExecutionGas"] = "InsufficientExecutionGas";
66
71
  CustomErrorName["InsufficientExecutionFee"] = "InsufficientExecutionFee";
72
+ CustomErrorName["InsufficientFundsToPayForCosts"] = "InsufficientFundsToPayForCosts";
73
+ CustomErrorName["InsufficientOutputAmount"] = "InsufficientOutputAmount";
74
+ CustomErrorName["InsufficientPoolAmount"] = "InsufficientPoolAmount";
75
+ CustomErrorName["InsufficientReserve"] = "InsufficientReserve";
76
+ CustomErrorName["InsufficientReserveForOpenInterest"] = "InsufficientReserveForOpenInterest";
67
77
  CustomErrorName["OrderNotFulfillableAtAcceptablePrice"] = "OrderNotFulfillableAtAcceptablePrice";
68
78
  CustomErrorName["InsufficientSwapOutputAmount"] = "InsufficientSwapOutputAmount";
79
+ CustomErrorName["InvalidCollateralTokenForMarket"] = "InvalidCollateralTokenForMarket";
80
+ CustomErrorName["InvalidDecreaseOrderSize"] = "InvalidDecreaseOrderSize";
81
+ CustomErrorName["InvalidOraclePrice"] = "InvalidOraclePrice";
82
+ CustomErrorName["LiquidatablePosition"] = "LiquidatablePosition";
83
+ CustomErrorName["MarketNotFound"] = "MarketNotFound";
84
+ CustomErrorName["MaxOpenInterestExceeded"] = "MaxOpenInterestExceeded";
85
+ CustomErrorName["MaxPoolAmountExceeded"] = "MaxPoolAmountExceeded";
86
+ CustomErrorName["MaxPoolUsdForDepositExceeded"] = "MaxPoolUsdForDepositExceeded";
87
+ CustomErrorName["MaxPriceAgeExceeded"] = "MaxPriceAgeExceeded";
88
+ CustomErrorName["MinPositionSize"] = "MinPositionSize";
89
+ CustomErrorName["NegativeExecutionPrice"] = "NegativeExecutionPrice";
90
+ CustomErrorName["OrderNotFound"] = "OrderNotFound";
91
+ CustomErrorName["OrderNotUpdatable"] = "OrderNotUpdatable";
92
+ CustomErrorName["OrderTypeCannotBeCreated"] = "OrderTypeCannotBeCreated";
93
+ CustomErrorName["PnlFactorExceededForLongs"] = "PnlFactorExceededForLongs";
94
+ CustomErrorName["PnlFactorExceededForShorts"] = "PnlFactorExceededForShorts";
95
+ CustomErrorName["PriceImpactLargerThanOrderSize"] = "PriceImpactLargerThanOrderSize";
96
+ CustomErrorName["SwapPriceImpactExceedsAmountIn"] = "SwapPriceImpactExceedsAmountIn";
97
+ CustomErrorName["UnableToWithdrawCollateral"] = "UnableToWithdrawCollateral";
98
+ CustomErrorName["UsdDeltaExceedsLongOpenInterest"] = "UsdDeltaExceedsLongOpenInterest";
99
+ CustomErrorName["UsdDeltaExceedsPoolValue"] = "UsdDeltaExceedsPoolValue";
100
+ CustomErrorName["UsdDeltaExceedsShortOpenInterest"] = "UsdDeltaExceedsShortOpenInterest";
69
101
  })(CustomErrorName || (exports.CustomErrorName = CustomErrorName = {}));
70
102
  function getIsUserRejectedError(errorType) {
71
103
  return errorType === TxErrorType.UserDenied;
@@ -358,7 +358,11 @@ function applyImpactFactor(diff, factor, exponent) {
358
358
  const _diff = Number(diff) / 10 ** 30;
359
359
  const _exponent = Number(exponent) / 10 ** 30;
360
360
  // Pow and convert back to BigInt with 30 decimals
361
- let result = (0, tradeHistory_1.bigNumberify)(BigInt(Math.round(_diff ** _exponent * 10 ** 30)));
361
+ const powered = _diff ** _exponent * 10 ** 30;
362
+ if (!isFinite(powered) || isNaN(powered)) {
363
+ return 0n;
364
+ }
365
+ let result = (0, tradeHistory_1.bigNumberify)(BigInt(Math.round(powered)));
362
366
  result = (result * factor) / (0, numbers_1.expandDecimals)(1, 30);
363
367
  return result;
364
368
  }
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.gelatoRelay = void 0;
7
- const relay_sdk_1 = require("@gelatonetwork/relay-sdk");
8
- const noop_1 = __importDefault(require("lodash/noop"));
9
- exports.gelatoRelay = new relay_sdk_1.GelatoRelay();
10
- exports.gelatoRelay.onError(noop_1.default);
3
+ exports.getGelatoRelayerClient = exports.StatusCode = void 0;
4
+ const gasless_1 = require("@gelatocloud/gasless");
5
+ var gasless_2 = require("@gelatocloud/gasless");
6
+ Object.defineProperty(exports, "StatusCode", { enumerable: true, get: function () { return gasless_2.StatusCode; } });
7
+ let _relayerClients = new Map();
8
+ function getGelatoRelayerClient(apiKey) {
9
+ let client = _relayerClients.get(apiKey);
10
+ if (!client) {
11
+ client = (0, gasless_1.createGelatoEvmRelayerClient)({ apiKey });
12
+ _relayerClients.set(apiKey, client);
13
+ }
14
+ return client;
15
+ }
16
+ exports.getGelatoRelayerClient = getGelatoRelayerClient;
@@ -80,17 +80,40 @@ function numberToBigint(value, decimals) {
80
80
  }
81
81
  exports.numberToBigint = numberToBigint;
82
82
  const trimZeroDecimals = (amount) => {
83
- if (parseFloat(amount) === parseInt(amount)) {
84
- return parseInt(amount).toString();
83
+ if (amount === "") {
84
+ return amount;
85
+ }
86
+ if (!amount.includes(".")) {
87
+ return normalizeInteger(amount);
88
+ }
89
+ const isNegative = amount.startsWith("-");
90
+ const unsignedAmount = isNegative ? amount.slice(1) : amount;
91
+ const [integerPartRaw, fractionPartRaw = ""] = unsignedAmount.split(".");
92
+ if (/^0*$/.test(fractionPartRaw)) {
93
+ const integerWithSign = isNegative ? `-${integerPartRaw}` : integerPartRaw;
94
+ return normalizeInteger(integerWithSign);
85
95
  }
86
96
  return amount;
87
97
  };
88
98
  exports.trimZeroDecimals = trimZeroDecimals;
99
+ function normalizeInteger(value) {
100
+ if (!value) {
101
+ return "0";
102
+ }
103
+ const isNegative = value.startsWith("-");
104
+ const hasPlus = value.startsWith("+");
105
+ const unsigned = isNegative || hasPlus ? value.slice(1) : value;
106
+ const stripped = unsigned.replace(/^0+/, "") || "0";
107
+ if (stripped === "0") {
108
+ return "0";
109
+ }
110
+ return isNegative ? `-${stripped}` : stripped;
111
+ }
89
112
  function bigintToNumber(value, decimals) {
90
113
  const negative = value < 0;
91
114
  if (negative)
92
115
  value *= -1n;
93
- const precision = 10n ** BigInt(decimals);
116
+ const precision = expandDecimals(1, decimals);
94
117
  const int = value / precision;
95
118
  const frac = value % precision;
96
119
  const num = parseFloat(`${int}.${frac.toString().padStart(decimals, "0")}`);
@@ -139,7 +162,7 @@ function formatDeltaUsd(deltaUsd, percentage, opts = {}) {
139
162
  }
140
163
  const sign = getPlusOrMinusSymbol(deltaUsd, { showPlusForZero: opts.showPlusForZero });
141
164
  const exceedingInfo = getLimitedDisplay(deltaUsd, exports.USD_DECIMALS);
142
- const percentageStr = percentage !== undefined ? ` (${sign}${formatPercentage(bigmath_1.bigMath.abs(percentage))})` : "";
165
+ const percentageStr = percentage !== undefined && !opts.hidePercentage ? ` (${sign}${formatPercentage(bigmath_1.bigMath.abs(percentage))})` : "";
143
166
  const deltaUsdStr = (0, exports.formatAmount)(exceedingInfo.value, exports.USD_DECIMALS, 2, true);
144
167
  const symbol = exceedingInfo.symbol ? `${exceedingInfo.symbol} ` : "";
145
168
  return `${symbol}${sign}$\u200a${deltaUsdStr}${percentageStr}`;
@@ -376,12 +399,15 @@ const formatArrayAmount = (arr, index, tokenDecimals, displayDecimals, useCommas
376
399
  return (0, exports.formatAmount)(arr[index], tokenDecimals, displayDecimals, useCommas);
377
400
  };
378
401
  exports.formatArrayAmount = formatArrayAmount;
379
- const formatAmountFree = (amount, tokenDecimals, displayDecimals) => {
402
+ const formatAmountFree = (amount, tokenDecimals, displayDecimals, visualMultiplier) => {
380
403
  if (amount === undefined || amount === null) {
381
404
  return "...";
382
405
  }
383
- amount = BigInt(amount);
384
- let amountStr = (0, viem_1.formatUnits)(amount, tokenDecimals);
406
+ let amountBigInt = BigInt(amount);
407
+ if (visualMultiplier) {
408
+ amountBigInt = amountBigInt / BigInt(visualMultiplier);
409
+ }
410
+ let amountStr = (0, viem_1.formatUnits)(amountBigInt, tokenDecimals);
385
411
  amountStr = (0, exports.limitDecimals)(amountStr, displayDecimals);
386
412
  return (0, exports.trimZeroDecimals)(amountStr);
387
413
  };
@@ -407,6 +433,12 @@ function getLimitedDisplay(amount, tokenDecimals, opts = {}) {
407
433
  exports.getLimitedDisplay = getLimitedDisplay;
408
434
  const limitDecimals = (amount, maxDecimals) => {
409
435
  let amountStr = amount.toString();
436
+ if (amountStr.includes("e") || amountStr.includes("E")) {
437
+ const num = Number(amountStr);
438
+ if (!isNaN(num)) {
439
+ amountStr = num.toFixed(20).replace(/\.?0+$/, "");
440
+ }
441
+ }
410
442
  if (maxDecimals === undefined) {
411
443
  return amountStr;
412
444
  }
@@ -511,11 +543,16 @@ function bigNumberify(n) {
511
543
  exports.bigNumberify = bigNumberify;
512
544
  const parseValue = (value, tokenDecimals) => {
513
545
  const pValue = parseFloat(value);
514
- if (isNaN(pValue)) {
546
+ if (isNaN(pValue) || !isFinite(pValue)) {
515
547
  return undefined;
516
548
  }
517
549
  value = (0, exports.limitDecimals)(value, tokenDecimals);
518
550
  const amount = (0, viem_1.parseUnits)(value, tokenDecimals);
551
+ // Cap at a safe maximum to prevent downstream BigInt overflow errors
552
+ const MAX_ALLOWED = expandDecimals(1, 62);
553
+ if (amount > MAX_ALLOWED || amount < -MAX_ALLOWED) {
554
+ return undefined;
555
+ }
519
556
  return bigNumberify(amount);
520
557
  };
521
558
  exports.parseValue = parseValue;
@@ -283,18 +283,21 @@ function buildUpdateOrderPayload(p) {
283
283
  };
284
284
  }
285
285
  exports.buildUpdateOrderPayload = buildUpdateOrderPayload;
286
- function getBatchTotalExecutionFee({ batchParams: { createOrderParams, updateOrderParams }, tokensData, chainId, }) {
286
+ function getBatchTotalExecutionFee({ batchParams, tokensData, chainId, }) {
287
+ if (getIsEmptyBatch(batchParams)) {
288
+ return undefined;
289
+ }
287
290
  let feeTokenAmount = 0n;
288
291
  let gasLimit = 0n;
289
292
  const wnt = (0, objects_1.getByKey)(tokensData, (0, tokens_1.getWrappedToken)(chainId).address);
290
293
  if (!wnt) {
291
294
  return undefined;
292
295
  }
293
- for (const co of createOrderParams) {
296
+ for (const co of batchParams.createOrderParams) {
294
297
  feeTokenAmount += co.orderPayload.numbers.executionFee;
295
298
  gasLimit += co.params.executionGasLimit;
296
299
  }
297
- for (const uo of updateOrderParams) {
300
+ for (const uo of batchParams.updateOrderParams) {
298
301
  feeTokenAmount += uo.updatePayload.executionFeeTopUp;
299
302
  }
300
303
  const feeUsd = (0, tokens_2.convertToUsd)(feeTokenAmount, wnt.decimals, wnt.prices.maxPrice);
@@ -251,7 +251,9 @@ function getContractPositionDynamicFees({ position, marketInfo, marketFeeState,
251
251
  }
252
252
  const claimableLongTokenAmount = getFundingAmount(latestLongTokenClaimableFundingAmountPerSize, position.longTokenClaimableFundingAmountPerSize, sizeInUsd);
253
253
  const claimableShortTokenAmount = getFundingAmount(latestShortTokenClaimableFundingAmountPerSize, position.shortTokenClaimableFundingAmountPerSize, sizeInUsd);
254
- const { balanceWasImproved } = (0, fees_1.getPriceImpactForPosition)(marketInfo, -sizeInUsd, isLong);
254
+ const { balanceWasImproved } = (0, fees_1.getPriceImpactForPosition)(marketInfo, -sizeInUsd, isLong, {
255
+ fallbackToZero: true,
256
+ });
255
257
  const { positionFeeUsd, discountUsd, uiFeeUsd } = (0, fees_1.getPositionFee)(marketInfo, sizeInUsd, balanceWasImproved, referralInfo);
256
258
  const positionFeeAmount = (0, tokens_1.convertToTokenAmount)(positionFeeUsd, collateralToken.decimals, collateralMinPrice) ?? 0n;
257
259
  const traderDiscountAmount = (0, tokens_1.convertToTokenAmount)(discountUsd, collateralToken.decimals, collateralMinPrice) ?? 0n;
@@ -42,7 +42,7 @@ function createRawTradeActionTransformer(marketsInfoData, wrappedToken, tokensDa
42
42
  targetCollateralToken,
43
43
  initialCollateralToken,
44
44
  timestamp: rawAction.timestamp,
45
- transaction: rawAction.transaction,
45
+ transactionHash: rawAction.transactionHash,
46
46
  reason: rawAction.reason ?? undefined,
47
47
  reasonBytes: rawAction.reasonBytes ?? undefined,
48
48
  twapParams: rawAction.twapGroupId && rawAction.numberOfParts
@@ -123,7 +123,7 @@ function createRawTradeActionTransformer(marketsInfoData, wrappedToken, tokensDa
123
123
  liquidationFeeAmount: rawAction.liquidationFeeAmount ? BigInt(rawAction.liquidationFeeAmount) : undefined,
124
124
  reason: rawAction.reason ?? undefined,
125
125
  reasonBytes: rawAction.reasonBytes ?? undefined,
126
- transaction: rawAction.transaction,
126
+ transactionHash: rawAction.transactionHash,
127
127
  timestamp: rawAction.timestamp,
128
128
  shouldUnwrapNativeToken: rawAction.shouldUnwrapNativeToken,
129
129
  twapParams: rawAction.twapGroupId && rawAction.numberOfParts
@@ -1,5 +1,5 @@
1
1
  const config = {
2
- schema: "https://gmx.squids.live/gmx-synthetics-arbitrum@045a75/api/graphql",
2
+ schema: "https://gmx.squids.live/gmx-synthetics-arbitrum@648c88/api/graphql",
3
3
  overwrite: true,
4
4
  debug: true,
5
5
  generates: {
@@ -145,7 +145,7 @@ export async function fetchTradeActions({ sdk, pageIndex, pageSize, marketsDirec
145
145
  tradeActions(
146
146
  offset: ${offset},
147
147
  limit: ${limit},
148
- orderBy: transaction_timestamp_DESC,
148
+ orderBy: timestamp_DESC,
149
149
  ${whereClause}
150
150
  ) {
151
151
  id
@@ -187,10 +187,7 @@ export async function fetchTradeActions({ sdk, pageIndex, pageSize, marketsDirec
187
187
  reasonBytes
188
188
  timestamp
189
189
 
190
- transaction {
191
- timestamp
192
- hash
193
- }
190
+ transactionHash
194
191
  }
195
192
  }`;
196
193
  const result = await graphqlFetcher(endpoint, query);
@@ -14,6 +14,6 @@ export const arbitrumSdkConfig = {
14
14
  oracleUrl: "https://arbitrum-api.gmxinfra.io",
15
15
  rpcUrl: "https://arb1.arbitrum.io/rpc",
16
16
  walletClient: client,
17
- subsquidUrl: "https://gmx.squids.live/gmx-synthetics-arbitrum:prod/api/graphql",
17
+ subsquidUrl: "https://gmx.squids.live/gmx-synthetics-arbitrum@648c88/api/graphql",
18
18
  };
19
19
  export const arbitrumSdk = new GmxSdk(arbitrumSdkConfig);
@@ -1025,6 +1025,22 @@
1025
1025
  "baseBorrowingFactorShort": "0x80c5b6569f8349524228859090ee98f0031070e6ea22026627ad923e0f65c180",
1026
1026
  "aboveOptimalUsageBorrowingFactorLong": "0x869d8c2c73b3ab76092d6448b49b444009f165a6b99bf09b98bbb5506eea6db6",
1027
1027
  "aboveOptimalUsageBorrowingFactorShort": "0xe8f2eac941593eddfd6a2b0501b308d3c654a363c8b2a249cdd23173373f40ec"
1028
+ },
1029
+ "0x45F0331a6e175B556Bc7d28E0A1c349525006d4E": {
1030
+ "optimalUsageFactorLong": "0x764a7e2625efb0068fbdbe0efbc021ccb3ba42c58967d055a7d29373f3397e91",
1031
+ "optimalUsageFactorShort": "0xedddd25d7297e9dc726acc56dcf5c9d2440a10ac50c159c2c2a7cc77917c919f",
1032
+ "baseBorrowingFactorLong": "0x997f0c4e2eca001e18075cfae298e5974c17b034df00c2596f8b83b044964104",
1033
+ "baseBorrowingFactorShort": "0xcd73ef074e51a9e31b144444e5ed3f858e7de787d0307c69f6ce84f571479269",
1034
+ "aboveOptimalUsageBorrowingFactorLong": "0x1d93934324dc393ec58d270b30a32186c4756679d1f8c12f56c3e359b646bc1e",
1035
+ "aboveOptimalUsageBorrowingFactorShort": "0x9415dccd2a032dccc476878c3a492b82d4ff32808690150cce7555a18ae2a139"
1036
+ },
1037
+ "0xbA30e198CFFeBEf0A84D6943cC8B2e356E324112": {
1038
+ "optimalUsageFactorLong": "0xb6ea04b62370d24c360684fc1815e8cc88060f27018c93d1a297afa9cfda3610",
1039
+ "optimalUsageFactorShort": "0x8628635ba75c1cb8acff4d805935aa44c1869806eaa8e9f25afc9f70e7e8d5a5",
1040
+ "baseBorrowingFactorLong": "0xf3b119413ad74a4ae7d4853dcec2a088bff5aaf74ad161a185e9ada20590c718",
1041
+ "baseBorrowingFactorShort": "0x05f6181842373ef95a7346f0ff1a84248e546efe9c552d21052f3d381d57e453",
1042
+ "aboveOptimalUsageBorrowingFactorLong": "0x31034a12ffde6c5e8e1f27c102afd598f9bd87ae9e358b8d5889adda8f1cd820",
1043
+ "aboveOptimalUsageBorrowingFactorShort": "0x024c16d394e9de1af35347e616cfe8c3725d5ba100a6d162c420c457c407ad6a"
1028
1044
  }
1029
1045
  },
1030
1046
  "43113": {
@@ -7297,6 +7297,120 @@
7297
7297
  "virtualMarketId": "0x421cb53ca7cb4595fa9e1c0b61da8a0decdb290ba71a3a3b3cb72ff96be84e40",
7298
7298
  "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f",
7299
7299
  "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960"
7300
+ },
7301
+ "0x45F0331a6e175B556Bc7d28E0A1c349525006d4E": {
7302
+ "isDisabled": "0x50fa1f4564a57732f05cadcd10bf0e71a00d1931e129ef680f79fe020a2f5964",
7303
+ "maxLongPoolAmount": "0x453a94e38d2c436b4db161988a2b3aca5c3839a1720c80cce44ba0d7a138aad5",
7304
+ "maxShortPoolAmount": "0x0473639c8a74eef46964d29d244c22b486a49cedc406929f05bc475259adbdaf",
7305
+ "maxLongPoolUsdForDeposit": "0x72c2e46cf37ca08a2a398c5f244196cf7b80ffe11d08186e59f5536eb04aff3c",
7306
+ "maxShortPoolUsdForDeposit": "0xfa7ef5c8d4f1531d64f7a337032ca8416d9ab270eb7d2d267b97741c37a65579",
7307
+ "reserveFactorLong": "0xb531a5afc5e2e4580ad989f86a747c22ff8b4488898d872e9345b72efbcc4ae9",
7308
+ "reserveFactorShort": "0x7703e301a2bb17ab253ee0e3cdcfc37756a559618f21663f8d554390055d9b12",
7309
+ "openInterestReserveFactorLong": "0x4d09bd0517138b57a067b629922a916a6c8c706cce93b93f8237618e89d0ca16",
7310
+ "openInterestReserveFactorShort": "0x37b3536354c450d78613c32074cfe689463683440a1950e7550cb790235f907f",
7311
+ "maxOpenInterestLong": "0x7f83200113ca0b1479257671a6915b7a064c87c3191b88f6e6a8a7e0acd84d61",
7312
+ "maxOpenInterestShort": "0x481cf9bca6f00ce11353d8de0c552b685bfcc0e09620db4321211232b584a192",
7313
+ "minPositionImpactPoolAmount": "0x44cdccf65b6698655dc2ae3c87344acb85f2bb7b31e8f39ab3798fc680dc337f",
7314
+ "positionImpactPoolDistributionRate": "0xc89b357a1993ef7d12f8b6d7e8de521aed6a4ec8a4032471ff457dcdb65d9762",
7315
+ "borrowingFactorLong": "0xb8630f348c5809c14f5787701769fd0102d09d07c8c345899b4ac6f9b06a1b00",
7316
+ "borrowingFactorShort": "0xae9c611cdcccedf0ead8c5f36f0c79564748213fff5f719d3a081dae9a9fd728",
7317
+ "borrowingExponentFactorLong": "0x6738bddd3bd72b0c3a6344b6313b6c62a1f1903fe42dc48042e18f6066d0b79c",
7318
+ "borrowingExponentFactorShort": "0xbb9720c8bf38499d8edc5b325a46d272f086e2697f9d39afdaf5cc7c3ea0f471",
7319
+ "fundingFactor": "0xb0718489805a95ea9b446c7039ff6d871c9dd7f4b9820a35c9543bcad78479ef",
7320
+ "fundingExponentFactor": "0xd44b3a7890472f453f0e42d42714d15dc018d5bcfdb74302d8e835259da76753",
7321
+ "fundingIncreaseFactorPerSecond": "0xc977697ae92aa334153b1ad3268d168a78113dffdc48698e7df187957f66942b",
7322
+ "fundingDecreaseFactorPerSecond": "0x5725132477d09ae43478e7eb94d750ba6cd2af18d21a59b65ef22645092097b9",
7323
+ "thresholdForStableFunding": "0xe611290b8c87ee7c79e2d0c0f16b7629c4ea6746d2db76fc93491d22248f2ae6",
7324
+ "thresholdForDecreaseFunding": "0x738abf983474ea7f38e52b7f4b0d511c7c3813b15538663e33f107d78698abe6",
7325
+ "minFundingFactorPerSecond": "0xd0b32513f35ca77b21045841a965f9e38e3100586ef538142f44a0fba8b66a58",
7326
+ "maxFundingFactorPerSecond": "0xfc995216f72c00aee65e014f5628a7075764955654a215f037816cd2c7d1d684",
7327
+ "maxPnlFactorForTradersLong": "0x372faddab1c2ed7e0ed77d488fdfa13270704f293ef0bcd5602a6e90be79f7e7",
7328
+ "maxPnlFactorForTradersShort": "0xc4e7d91c0c480e3977a29a981c82b7a692d604d0c4b4316a5e78b6c25c1f31b7",
7329
+ "positionFeeFactorForBalanceWasImproved": "0xfd4347211713bdaddc89fd6c06297eb5928701ce1b00895773be19ee8fd8bfb3",
7330
+ "positionFeeFactorForBalanceWasNotImproved": "0x435024f7c45fc6e824c6e69f983acf3b25e004e6ab76414856e3b4fc66944b06",
7331
+ "positionImpactFactorPositive": "0x9b30e83fbd40eb2e3e66b16e79e61892695510e78a65291472613231e02b7d84",
7332
+ "positionImpactFactorNegative": "0x516a41c7df42a35770d44f67213f1e3e45d65becd3617638a2e6bfc796a3abe5",
7333
+ "maxPositionImpactFactorPositive": "0x628c576d5cdd606817245627d52d4af59479aa52149fee997977676ec23fdc8c",
7334
+ "maxPositionImpactFactorNegative": "0x4159cf055507d00976f58aa2193ae14ca44c5b5e7031b51d67aabe7026b932fd",
7335
+ "maxPositionImpactFactorForLiquidations": "0x6d4a695493dd0535723531b0b4c36d1fb6fe12c06bb598d8c483781eb036f1be",
7336
+ "maxLendableImpactFactor": "0x52f7f9c0afdf34a0d5daaae03dbde9474c15c36cb43f0c41f8a0ae3be7748f9e",
7337
+ "maxLendableImpactFactorForWithdrawals": "0x7f02f14e85920657ac727c5627f4a6cace9d58ffcce6ade95113aee08fbfba21",
7338
+ "maxLendableImpactUsd": "0x420f8e87d103b763de1fb2c22fa27b5c9e57e716a2fde24366c8b1b9b5361363",
7339
+ "lentPositionImpactPoolAmount": "0xef077381f879bca5c1f3cce00712a0b1d946aeecc2305e717d6231261cb872a1",
7340
+ "minCollateralFactor": "0xb6911b3c3e43f2d9bc44e62f4bb79d3be371b92c6a2b4030cd5800a3a4dd5fc7",
7341
+ "minCollateralFactorForLiquidation": "0x4d80883873a2189a457c7519eb19d4db5aa079cf9c9103378a3d724e5b2d0405",
7342
+ "minCollateralFactorForOpenInterestLong": "0x3acf4722b06fb193317aa3444e4716840e6d58a816dd5548341e71601a8dfb9d",
7343
+ "minCollateralFactorForOpenInterestShort": "0x4143f5ff857ddac9f4cc0ddfcf536ed943f1f7dca99a35603fdf1ce3235ba24c",
7344
+ "positionImpactExponentFactorPositive": "0xafb9dbe8109ed7cd0d7cb78fe78f1ab40f215cd2d6564dceed92c86f72c1268b",
7345
+ "positionImpactExponentFactorNegative": "0x85af45035c7918b953349d5bb3cb172385661ab257f9b56b30bf0db4f10cf47d",
7346
+ "swapFeeFactorForBalanceWasImproved": "0xb0a40ae70978827b60f224e11c241c5dcfc79a8e36ce9d2919beafe9a818a084",
7347
+ "swapFeeFactorForBalanceWasNotImproved": "0xc8d7a1ca3f89e8c07fb72cbf6cf85af81a71ebd2c1210f445e34f824f6f521a9",
7348
+ "atomicSwapFeeFactor": "0x2466cd30ef07d8e2844a4300019dea40633a512b4859682ea951aa3c9bdf3263",
7349
+ "swapImpactFactorPositive": "0xb1cb51bac5005be8d3da377a3a252a3efcd45b9ae2378c4a01a24b4acd5f5ca5",
7350
+ "swapImpactFactorNegative": "0x9fe2befaa5b4f94ae00258bbd6c951db3be2dcea125600ee16e823f7fa473231",
7351
+ "swapImpactExponentFactor": "0x3290e16696a7f09e9426e8341d96bb1c5fbfbd92880c526f0463f35a0663fcb2",
7352
+ "withdrawalFeeFactorBalanceWasImproved": "0xd7e25a10d19d3b81cdfe32a44e772ab1492529c016828b4535736552bf8885c1",
7353
+ "withdrawalFeeFactorBalanceWasNotImproved": "0x110344bc924a2541e844e48905673e551e1697824ca6e7c2c70a967af38db509",
7354
+ "virtualMarketId": "0x449f0793c84634478ad425a6140894dfd8dc980c3955c138365dac8e60c89093",
7355
+ "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f",
7356
+ "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960"
7357
+ },
7358
+ "0xbA30e198CFFeBEf0A84D6943cC8B2e356E324112": {
7359
+ "isDisabled": "0xa6f1753c33076a453b4580a552298ab8ae7caf9f1c346247d898e47a79b53be0",
7360
+ "maxLongPoolAmount": "0x2adb9cd52405f1c6d1a315dede969d87e430b6977174f0cd8d47b8572f8d4ac1",
7361
+ "maxShortPoolAmount": "0xfcad21040ae721b52e00279c57f49c589c3e18020462e3f54a9a1c676e230a7c",
7362
+ "maxLongPoolUsdForDeposit": "0x588eb373191cc431092e497f523d44b5b23d0f89bd83eed65336d1762b3edf85",
7363
+ "maxShortPoolUsdForDeposit": "0xe9ed0c243e9b74e9b2ca083603b1ff35c2b406ed0da7d903c30d6b21021976b0",
7364
+ "reserveFactorLong": "0xc4b8f41e9d80c47cd542d02b1997468e9da321b0e6a970e269ea1d026aa6824e",
7365
+ "reserveFactorShort": "0x3855c4cf5fd3c8b5068417b44b47ed97b71bd1e4ae6f4856542bf8cf85c5bf8a",
7366
+ "openInterestReserveFactorLong": "0x727c3fd7d228ed9e41185d6d676c055f4944681426741b4b90175ac6a99906dd",
7367
+ "openInterestReserveFactorShort": "0x7156d77f50062583efb99667a0fc62dbcef7b8fd04aac10aa905794693b51224",
7368
+ "maxOpenInterestLong": "0x796cf77dbbe5b1d8453e10a1e8f5a76845569f4238ed4a16714a440bc55466e3",
7369
+ "maxOpenInterestShort": "0x929b8d1c43b757d69b8dc60a32639d8bc9037e8428d55151da2643202e74fc4a",
7370
+ "minPositionImpactPoolAmount": "0x22d56f9f781022adb1c38c4891de148040b6babaeb96f93204728a70cf96493a",
7371
+ "positionImpactPoolDistributionRate": "0x7e7f7818545b250ef7e0bd4a65ea915c484aa3289a37f320efd2ba77041b9da3",
7372
+ "borrowingFactorLong": "0x68d6d4ef68f433cf3a6b0b63afa897e67898b4bd0df0b22761b8597f26253c5e",
7373
+ "borrowingFactorShort": "0xb60dc1b74ce50909dd6a7717f40044e4a8c231ba0c98ae27305c7ab89ecb950a",
7374
+ "borrowingExponentFactorLong": "0xb171afbea710e6177b5dafa53cb685acb593e76d60947cd5b1a9fe414c766ecb",
7375
+ "borrowingExponentFactorShort": "0x800d19254fadd9857639b1566b5863fd4e2a7a4db692a1b386276a79cfbdbd45",
7376
+ "fundingFactor": "0xc157f61b3c80661e57a5ed6fc3a921cc85521d2c237cc334e287a0a7e78d281a",
7377
+ "fundingExponentFactor": "0xbbcfbe3e86a87d6878b925bccb9ca69839373475c17b5c31ab87b5f95a705683",
7378
+ "fundingIncreaseFactorPerSecond": "0xad9654ad7d410245af65597eda61b4c9ca3964a7064e5b9cde1718a987aaab07",
7379
+ "fundingDecreaseFactorPerSecond": "0xe8c7806704f5e025d3534c42833ab9acffb3b69512911700d31b35dd3b4749fa",
7380
+ "thresholdForStableFunding": "0xf95136ed927a97ac27b929a7554a30f0b97bba2a4210760ab65a6338ea7639e3",
7381
+ "thresholdForDecreaseFunding": "0x95fea5f6356cd053bc6be6ee2206c04d8e9122bb04ed17e42b42aada7aab7d7a",
7382
+ "minFundingFactorPerSecond": "0x5aec506dbd426da4870550860f4caa6a0737dbc7244b2e37102f703948da8f88",
7383
+ "maxFundingFactorPerSecond": "0x9b376d65c40286fbbe7beb61b8b47f7686bcf7ef48f9e13ba418beaeacc050c2",
7384
+ "maxPnlFactorForTradersLong": "0x3e50527b607778767857928c6c79fec4b3562dbd1086f1223cc3ecc9bea1cfac",
7385
+ "maxPnlFactorForTradersShort": "0x5d480f98f36f5f1a871872fc941bcfce2a68807cec604e501059aaf409c9ff7a",
7386
+ "positionFeeFactorForBalanceWasImproved": "0xa2553dcd3570073234cd4d1a92e03202d5b420b73e966e35c3dd346530a315d3",
7387
+ "positionFeeFactorForBalanceWasNotImproved": "0xc8f83b9df21cde4d9a453e3519ed6a2aa2c934071a634be0cf71b87dcf908ca7",
7388
+ "positionImpactFactorPositive": "0xb218a03910ae38aa182116e6ee1885ffe8ecffac07376271dcbf6b818572283f",
7389
+ "positionImpactFactorNegative": "0xa6bd32ff158b9659722a1e4b230479530df99d89f3b735e3b3865c32b9a6bbda",
7390
+ "maxPositionImpactFactorPositive": "0xcbb91f6bfb39e3b7f943b8420b585cb5065e08ba7f4532ee667f23b52e99d2f7",
7391
+ "maxPositionImpactFactorNegative": "0xec1f30ac23895d445e9994da7968cf299883467b8fd29af25f51e5c4abd430a0",
7392
+ "maxPositionImpactFactorForLiquidations": "0xdbac9f72581749d5912de84ea66c80d72140458df29fff803822eef5d6b160c1",
7393
+ "maxLendableImpactFactor": "0xef9efc2c8cb005d18ada4d8621211eca6077f288a15684cb7195bf7d256b0c72",
7394
+ "maxLendableImpactFactorForWithdrawals": "0x97ed7eead0486e8d0b80dcdf37c2b8ea96b2c0891723db25fd444d659bcd1f77",
7395
+ "maxLendableImpactUsd": "0x899f431b302eec849969d3a9916341540d8e6064c62c75565bada3f1a5f25bd5",
7396
+ "lentPositionImpactPoolAmount": "0x58507e71eab5a766131c78a067b4356849af7a07b01f77252775751c79eb3b9b",
7397
+ "minCollateralFactor": "0x80cffb5ba780ac016d46949fa0cc442be17b172573ccf7e164f9f18dd9140c58",
7398
+ "minCollateralFactorForLiquidation": "0x293533e11bba7df014d871fc78df16df387ecd861aa14b3b3cfc6a53b7ff326f",
7399
+ "minCollateralFactorForOpenInterestLong": "0x2e1ec0518ea51e11330eaec40133ea4e926e3e683ceea3ff83fa06844d3ea284",
7400
+ "minCollateralFactorForOpenInterestShort": "0x5d5ab56ba203610621586f7a56d3c17db8c0affb4c77f8ce718e59b76b46ce49",
7401
+ "positionImpactExponentFactorPositive": "0x3e20939988cbca559296892fd27a8dd2507806958977565e1b169abbfc9637c7",
7402
+ "positionImpactExponentFactorNegative": "0x73043bfdfc13a1372c8cd540dbe39f5fa5db7cd6be111bdde3fac6ef57d243d0",
7403
+ "swapFeeFactorForBalanceWasImproved": "0x02750917a722e73ffe72b9a1414b5f4808e6a956dd604f740215a6c8f7186128",
7404
+ "swapFeeFactorForBalanceWasNotImproved": "0xe333f4db0b47f2415ab9da43a8e18b414130e528372a56b41e4009c810cd19ae",
7405
+ "atomicSwapFeeFactor": "0x1bbf740a0f1c16a2c888695ebbf983df7008270a83785d78a69a7780884708c4",
7406
+ "swapImpactFactorPositive": "0x25a6426c365f9f2bc9d979046e6af7eaccd28cc8f7c90d76149b748083829f25",
7407
+ "swapImpactFactorNegative": "0x698c5da59e4ba795af77fb3709679cb5552de123995d0e82ef9785720141981a",
7408
+ "swapImpactExponentFactor": "0xdf4ae498da232a5de8fa83a723018b171144befa5a046df9432646fb70918d8f",
7409
+ "withdrawalFeeFactorBalanceWasImproved": "0xa29239e9d01376e4bab5c25267969011339e57066f40d8a3b146be068ecab993",
7410
+ "withdrawalFeeFactorBalanceWasNotImproved": "0x78d7c4f23dd0a1678036833151a741eae0e775e07f699582ce385641a275b32c",
7411
+ "virtualMarketId": "0xe4dd0d1a51b9452a2ea7bd7ad2ee312e9b619b7374eb88e6e593e0aced8c118f",
7412
+ "virtualLongTokenId": "0xa59040b7efb6b7122a74cb318a192ebc6732849dff5332ee3ba40b90dfa0a04f",
7413
+ "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960"
7300
7414
  }
7301
7415
  },
7302
7416
  "43113": {
@@ -1921,6 +1921,36 @@
1921
1921
  "longInterestInTokensUsingShortToken": "0x304a988d2a21904b0de78f1e71fb803b4a070e4072eba7a2b7ca9c0e4f99bcbd",
1922
1922
  "shortInterestInTokensUsingLongToken": "0x529852b72b88323b98314e361c5fb21846b2c64fc5f9cf7ab9b92cd6d23a9f36",
1923
1923
  "shortInterestInTokensUsingShortToken": "0xd8b7ef7743b28c9a6b650fc6015d93312c5030d7b96cc8ee073e3ada0d08cab4"
1924
+ },
1925
+ "0x45F0331a6e175B556Bc7d28E0A1c349525006d4E": {
1926
+ "longPoolAmount": "0x4567b372c6f4c2c76ef5405e4363b49d47708f4cc92f643274ee5fb57a4579c2",
1927
+ "shortPoolAmount": "0x7e8c6c3f3a0e0a055d8f5c425d93bcd4c2145ba9720c66c4481efd98749bdd49",
1928
+ "positionImpactPoolAmount": "0xd9e92787372c60d1f238982b7b862d0eeb8b38ca479ddd919c72b1499a89dc6c",
1929
+ "swapImpactPoolAmountLong": "0xe51bce5f616154f90a8b2c779c00878dc10c2ae4e466ddb0691aaf47d1a12909",
1930
+ "swapImpactPoolAmountShort": "0x7cd40f8647c50cf5fe51238054766e4bc17041635871e1cb26ff207e86accbf6",
1931
+ "longInterestUsingLongToken": "0x64ebfddac24e746dda4217e672f4d4c420849e609a270857ad3ec45d855b39b0",
1932
+ "longInterestUsingShortToken": "0xba9589eae97f34c4a0cf3fbc85e92eb9af6d31182a78eed27a71e989a4d4e8e3",
1933
+ "shortInterestUsingLongToken": "0x7d4fb4139bc242a607a7be2d2401db4542e2c10b23472a4bfca101e6d1989525",
1934
+ "shortInterestUsingShortToken": "0x850fcab78aff8f4167f34acb3438cfac0b8d27f06313e880ff3468620d2c2357",
1935
+ "longInterestInTokensUsingLongToken": "0x13278ffb912e88da0c82fc31bc695315f7d1dae207f1f7d52f074b0810e0ce18",
1936
+ "longInterestInTokensUsingShortToken": "0x7240927432e5e26caa226cd6f589d7a97fa8d1a7215734f256ed22ab5983c668",
1937
+ "shortInterestInTokensUsingLongToken": "0x186382cbf34b64f16fb6e0f3f8ee1216a79fb1c87d528b8c92af90e8bdff11ac",
1938
+ "shortInterestInTokensUsingShortToken": "0x8346116d13568a2c6dc2d513752e427133e12d5073595d1ee7aafaca1496f154"
1939
+ },
1940
+ "0xbA30e198CFFeBEf0A84D6943cC8B2e356E324112": {
1941
+ "longPoolAmount": "0x15cb187e91d0d6e6d003c7986680baa65f87e9e820d7d8bd8f44f43b26cb6205",
1942
+ "shortPoolAmount": "0xe84880ae48933030172c0a37793585b9acf8196915b2e3c262ff6731bfaeace7",
1943
+ "positionImpactPoolAmount": "0x88e0b4636963c657fd40d80779ec3408515e446e07e211c3532efc634cd1972e",
1944
+ "swapImpactPoolAmountLong": "0xcf5d3668d19d49618716175caad21d50c223911c51dcdcebbe8d05c481a858a0",
1945
+ "swapImpactPoolAmountShort": "0xe5e7a084827a05b0c9d8fd1078de9d96c654ec203d4c84b4b9e23d81ac4d48ba",
1946
+ "longInterestUsingLongToken": "0x7aa6f60a6683f1d6c247f9ff43c2517f86b932fb92c9167de17bbea318fe8edc",
1947
+ "longInterestUsingShortToken": "0xd314a66282b209da03d844a4b5b48e157bcb258e86c9ac9381a433180f91d90c",
1948
+ "shortInterestUsingLongToken": "0x1da44c2bb04c9f24bd4623252dfc048bf15b6cb517f8a3ad279af9bf648e9d16",
1949
+ "shortInterestUsingShortToken": "0xd7c79a88223879bdc22b1eed289cc92fd0856d0cc4da46c66756eb3757fac4ac",
1950
+ "longInterestInTokensUsingLongToken": "0xd3172914a401f23ae217d651572861c48e4694800e2a868febe912fa959cc9bb",
1951
+ "longInterestInTokensUsingShortToken": "0xeb269d71e081bf2b8dcfb8834ee3093dd40be8f0e7f8294788eac2341c8e8721",
1952
+ "shortInterestInTokensUsingLongToken": "0xf9ec3ba3959fd87d0f62b6a6eb7fdc5a938039f26edd2352a26ece95ab48a395",
1953
+ "shortInterestInTokensUsingShortToken": "0x11338fd0f7b5e20b9c8b84ab34b92f667f3576670902aada7f61b8975d6b23f0"
1924
1954
  }
1925
1955
  },
1926
1956
  "43113": {