@gmx-io/sdk 1.5.0-alpha-11 → 1.5.0-alpha-13

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 (46) hide show
  1. package/build/cjs/src/clients/v2/__tests__/decrease.spec.js +14 -0
  2. package/build/cjs/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +24 -0
  3. package/build/cjs/src/codegen/prebuilt/hashedMarketConfigKeys.json +183 -0
  4. package/build/cjs/src/codegen/prebuilt/hashedMarketValuesKeys.json +45 -0
  5. package/build/cjs/src/configs/api.js +9 -9
  6. package/build/cjs/src/configs/marketHours.js +27 -0
  7. package/build/cjs/src/configs/markets.js +21 -0
  8. package/build/cjs/src/configs/tokens.js +32 -0
  9. package/build/cjs/src/utils/__tests__/markets.spec.js +44 -9
  10. package/build/cjs/src/utils/markets/utils.js +19 -12
  11. package/build/cjs/src/utils/orderTransactions/api.js +15 -10
  12. package/build/cjs/src/utils/orderTransactions/utils.js +2 -2
  13. package/build/cjs/src/utils/orderTransactions/validateTypedData.js +7 -0
  14. package/build/cjs/src/utils/positions/utils.js +1 -1
  15. package/build/cjs/src/utils/subaccount/generateSubaccount.js +20 -2
  16. package/build/cjs/src/utils/subaccount/index.js +3 -1
  17. package/build/cjs/src/utils/swap/__tests__/swapRouting.spec.js +1 -1
  18. package/build/cjs/src/utils/trade/trade.js +7 -0
  19. package/build/cjs/src/utils/twap/index.js +10 -4
  20. package/build/esm/src/clients/v2/__tests__/decrease.spec.js +14 -0
  21. package/build/esm/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +24 -0
  22. package/build/esm/src/codegen/prebuilt/hashedMarketConfigKeys.json +183 -0
  23. package/build/esm/src/codegen/prebuilt/hashedMarketValuesKeys.json +45 -0
  24. package/build/esm/src/configs/api.js +9 -9
  25. package/build/esm/src/configs/marketHours.js +24 -0
  26. package/build/esm/src/configs/markets.js +21 -0
  27. package/build/esm/src/configs/tokens.js +32 -0
  28. package/build/esm/src/utils/__tests__/markets.spec.js +45 -10
  29. package/build/esm/src/utils/markets/utils.js +19 -12
  30. package/build/esm/src/utils/orderTransactions/api.js +15 -10
  31. package/build/esm/src/utils/orderTransactions/utils.js +2 -2
  32. package/build/esm/src/utils/orderTransactions/validateTypedData.js +7 -0
  33. package/build/esm/src/utils/positions/utils.js +1 -1
  34. package/build/esm/src/utils/subaccount/generateSubaccount.js +14 -1
  35. package/build/esm/src/utils/subaccount/index.js +1 -1
  36. package/build/esm/src/utils/swap/__tests__/swapRouting.spec.js +1 -1
  37. package/build/esm/src/utils/trade/trade.js +7 -0
  38. package/build/esm/src/utils/twap/index.js +10 -4
  39. package/build/types/src/codegen/prebuilt/index.d.ts +252 -0
  40. package/build/types/src/configs/marketHours.d.ts +7 -0
  41. package/build/types/src/configs/tokens.d.ts +1 -39
  42. package/build/types/src/utils/markets/utils.d.ts +1 -1
  43. package/build/types/src/utils/subaccount/generateSubaccount.d.ts +3 -0
  44. package/build/types/src/utils/subaccount/index.d.ts +1 -1
  45. package/build/types/src/utils/tokens/types.d.ts +2 -0
  46. package/package.json +1 -1
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getMarketAddressByName = exports.getMarketWithTiers = exports.composeFullMarketsInfoData = exports.hydrateMarketInfo = exports.composeRawMarketsInfoData = exports.composeRawMarketInfo = exports.getMarketTicker = exports.getMarket24Stats = exports.getIsMarketAvailableForExpressSwaps = exports.getPriceForPnl = exports.getOpenInterestForBalance = exports.getOpenInterestInTokens = exports.getOpenInterestUsd = exports.getMarketPnl = exports.getOiInTokensFromRawValues = exports.getOiUsdFromRawValues = exports.getMarketDivisor = exports.getReservedUsd = exports.getAvailableUsdLiquidityForCollateral = exports.getOppositeCollateralFromConfig = exports.getOppositeCollateral = exports.getMaxAllowedLeverageByMinCollateralFactor = exports.getMaxLeverageByMinCollateralFactor = exports.getCappedPoolPnl = exports.getPoolUsdWithoutPnl = exports.getTokenPoolType = exports.getContractMarketPrices = exports.getMarketPoolName = exports.getMarketBaseName = exports.getMarketIndexName = exports.getMarketFullName = void 0;
4
4
  const viem_1 = require("viem");
5
5
  const factors_1 = require("../../configs/factors");
6
+ const marketHours_1 = require("../../configs/marketHours");
6
7
  const tokens_1 = require("../../configs/tokens");
8
+ const bigmath_1 = require("../bigmath");
7
9
  const fees_1 = require("../fees");
8
10
  const numbers_1 = require("../numbers");
9
11
  const objects_1 = require("../objects");
@@ -93,25 +95,30 @@ function getCappedPoolPnl(p) {
93
95
  return poolPnl > maxPnl ? maxPnl : poolPnl;
94
96
  }
95
97
  exports.getCappedPoolPnl = getCappedPoolPnl;
98
+ /**
99
+ * Rounds to nearest .0 leverage, so that getMaxAllowedLeverageByMinCollateralFactor can get .0 or .5 leverage.
100
+ */
101
+ const ROUNDING_VALUE = 10000;
96
102
  function getMaxLeverageByMinCollateralFactor(minCollateralFactor) {
97
103
  if (minCollateralFactor === undefined)
98
104
  return 100 * factors_1.BASIS_POINTS_DIVISOR;
99
105
  if (minCollateralFactor === 0n)
100
106
  return 100 * factors_1.BASIS_POINTS_DIVISOR;
101
- const x = Number(numbers_1.PRECISION / minCollateralFactor);
102
- const rounded = Math.round(x / 10) * 10;
103
- return rounded * factors_1.BASIS_POINTS_DIVISOR;
107
+ const x = bigmath_1.bigMath.mulDiv(numbers_1.PRECISION, factors_1.BASIS_POINTS_DIVISOR_BIGINT, minCollateralFactor);
108
+ const rounded = Math.round(Number(x) / ROUNDING_VALUE) * ROUNDING_VALUE;
109
+ return rounded;
104
110
  }
105
111
  exports.getMaxLeverageByMinCollateralFactor = getMaxLeverageByMinCollateralFactor;
106
- // GOLD/SILVER on-hours: MCF 0.009 (9e27) → 100x UI
107
- const MCF_ON_HOURS = 9n * 10n ** 27n;
108
- // GOLD/SILVER off-hours: MCF 0.035 (35e27) → 25x UI
109
- const MCF_OFF_HOURS = 35n * 10n ** 27n;
110
- function getMaxAllowedLeverageByMinCollateralFactor(minCollateralFactor) {
111
- if (minCollateralFactor === MCF_ON_HOURS)
112
- return 100 * factors_1.BASIS_POINTS_DIVISOR;
113
- if (minCollateralFactor === MCF_OFF_HOURS)
114
- return 25 * factors_1.BASIS_POINTS_DIVISOR;
112
+ function getMaxAllowedLeverageByMinCollateralFactor(minCollateralFactor, marketAddress) {
113
+ if (marketAddress) {
114
+ const cfg = marketHours_1.MARKET_HOURS_MARKETS[marketAddress];
115
+ if (cfg) {
116
+ if (minCollateralFactor === cfg.onHoursMcf)
117
+ return cfg.onHoursMaxLeverage * factors_1.BASIS_POINTS_DIVISOR;
118
+ if (minCollateralFactor === cfg.offHoursMcf)
119
+ return cfg.offHoursMaxLeverage * factors_1.BASIS_POINTS_DIVISOR;
120
+ }
121
+ }
115
122
  return getMaxLeverageByMinCollateralFactor(minCollateralFactor) / 2;
116
123
  }
117
124
  exports.getMaxAllowedLeverageByMinCollateralFactor = getMaxAllowedLeverageByMinCollateralFactor;
@@ -5,16 +5,21 @@ const validateTypedData_1 = require("./validateTypedData");
5
5
  function parseEstimates(raw) {
6
6
  if (!raw)
7
7
  return undefined;
8
- return {
9
- positionPriceImpactDeltaUsd: BigInt(raw.positionPriceImpactDeltaUsd),
10
- swapPriceImpactDeltaUsd: BigInt(raw.swapPriceImpactDeltaUsd),
11
- executionFeeAmount: BigInt(raw.executionFeeAmount),
12
- acceptablePrice: BigInt(raw.acceptablePrice),
13
- sizeDeltaUsd: BigInt(raw.sizeDeltaUsd),
14
- positionFeeUsd: BigInt(raw.positionFeeUsd),
15
- borrowingFeeUsd: BigInt(raw.borrowingFeeUsd),
16
- fundingFeeUsd: BigInt(raw.fundingFeeUsd),
17
- };
8
+ try {
9
+ return {
10
+ positionPriceImpactDeltaUsd: BigInt(raw.positionPriceImpactDeltaUsd ?? "0"),
11
+ swapPriceImpactDeltaUsd: BigInt(raw.swapPriceImpactDeltaUsd ?? "0"),
12
+ executionFeeAmount: BigInt(raw.executionFeeAmount ?? "0"),
13
+ acceptablePrice: BigInt(raw.acceptablePrice ?? "0"),
14
+ sizeDeltaUsd: BigInt(raw.sizeDeltaUsd ?? "0"),
15
+ positionFeeUsd: BigInt(raw.positionFeeUsd ?? "0"),
16
+ borrowingFeeUsd: BigInt(raw.borrowingFeeUsd ?? "0"),
17
+ fundingFeeUsd: BigInt(raw.fundingFeeUsd ?? "0"),
18
+ };
19
+ }
20
+ catch (e) {
21
+ throw new Error(`Failed to parse order estimates: ${e instanceof Error ? e.message : e}`);
22
+ }
18
23
  }
19
24
  function parsePrepareResponse(raw) {
20
25
  return { ...raw, estimates: parseEstimates(raw.estimates) };
@@ -167,8 +167,8 @@ function buildDecreaseOrderPayload(p) {
167
167
  }
168
168
  exports.buildDecreaseOrderPayload = buildDecreaseOrderPayload;
169
169
  function buildTwapOrdersPayloads(p, twapParams) {
170
- if (!twapParams.numberOfParts || twapParams.numberOfParts <= 0) {
171
- throw new Error(`TWAP numberOfParts must be > 0, got ${twapParams.numberOfParts}`);
170
+ if (!twapParams.numberOfParts || twapParams.numberOfParts < 2) {
171
+ throw new Error(`TWAP numberOfParts must be >= 2, got ${twapParams.numberOfParts}`);
172
172
  }
173
173
  const uiFeeReceiver = (0, uiFeeReceiver_1.createTwapUiFeeReceiver)({ numberOfParts: twapParams.numberOfParts, source: twapParams.source });
174
174
  if ((0, orders_1.isSwapOrderType)(p.orderType)) {
@@ -70,6 +70,13 @@ accountAddress) {
70
70
  throw new Error(`Order receiver "${receiver}" does not match signer "${signerAddress}". Possible malicious typed data.`);
71
71
  }
72
72
  }
73
+ const cancellationReceiver = order?.addresses?.cancellationReceiver;
74
+ if (cancellationReceiver) {
75
+ const checksummedCancellationReceiver = (0, viem_1.getAddress)(cancellationReceiver);
76
+ if (checksummedCancellationReceiver !== ZERO_ADDRESS && !allowedReceivers.has(checksummedCancellationReceiver)) {
77
+ throw new Error(`Order cancellationReceiver "${cancellationReceiver}" does not match signer "${signerAddress}". Possible malicious typed data.`);
78
+ }
79
+ }
73
80
  }
74
81
  }
75
82
  }
@@ -346,7 +346,7 @@ function getPositionInfo(p) {
346
346
  pendingFundingFeesUsd,
347
347
  pnl: undefined,
348
348
  });
349
- const maxAllowedLeverage = (0, markets_1.getMaxAllowedLeverageByMinCollateralFactor)(marketInfo.minCollateralFactor);
349
+ const maxAllowedLeverage = (0, markets_1.getMaxAllowedLeverageByMinCollateralFactor)(marketInfo.minCollateralFactor, marketInfo.marketTokenAddress);
350
350
  const hasLowCollateral = (leverage !== undefined && leverage > maxAllowedLeverage) || false;
351
351
  const liquidationPrice = getLiquidationPrice({
352
352
  marketInfo,
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateSubaccount = void 0;
6
+ exports.createSubaccountSignerFromConfig = exports.decryptSubaccountPrivateKey = exports.generateSubaccount = void 0;
7
+ const crypto_js_1 = __importDefault(require("crypto-js"));
4
8
  const viem_1 = require("viem");
5
9
  const accounts_1 = require("viem/accounts");
6
10
  const express_1 = require("../../configs/express");
@@ -10,10 +14,24 @@ async function generateSubaccount(mainSigner) {
10
14
  const pk = (0, viem_1.keccak256)(signature);
11
15
  const account = (0, accounts_1.privateKeyToAccount)(pk);
12
16
  const signer = new signer_1.PrivateKeySigner(pk);
17
+ const encryptedPrivateKey = crypto_js_1.default.AES.encrypt(pk, mainSigner.address).toString();
13
18
  return {
14
19
  address: account.address,
15
20
  signer,
16
- privateKey: pk,
21
+ privateKey: encryptedPrivateKey,
17
22
  };
18
23
  }
19
24
  exports.generateSubaccount = generateSubaccount;
25
+ function decryptSubaccountPrivateKey(encryptedPrivateKey, mainAccountAddress) {
26
+ const decrypted = crypto_js_1.default.AES.decrypt(encryptedPrivateKey, mainAccountAddress).toString(crypto_js_1.default.enc.Utf8);
27
+ if (!decrypted) {
28
+ throw new Error("Failed to decrypt subaccount private key");
29
+ }
30
+ return decrypted;
31
+ }
32
+ exports.decryptSubaccountPrivateKey = decryptSubaccountPrivateKey;
33
+ function createSubaccountSignerFromConfig(encryptedPrivateKey, mainAccountAddress) {
34
+ const pk = decryptSubaccountPrivateKey(encryptedPrivateKey, mainAccountAddress);
35
+ return new signer_1.PrivateKeySigner(pk);
36
+ }
37
+ exports.createSubaccountSignerFromConfig = createSubaccountSignerFromConfig;
@@ -14,10 +14,12 @@ 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.signSubaccountApproval = exports.prepareSubaccountApproval = exports.fetchSubaccountStatus = exports.getSubaccountApprovalTypedData = exports.getEmptySubaccountApproval = exports.hashSubaccountApproval = exports.generateSubaccount = void 0;
17
+ exports.signSubaccountApproval = exports.prepareSubaccountApproval = exports.fetchSubaccountStatus = exports.getSubaccountApprovalTypedData = exports.getEmptySubaccountApproval = exports.hashSubaccountApproval = exports.createSubaccountSignerFromConfig = exports.decryptSubaccountPrivateKey = exports.generateSubaccount = void 0;
18
18
  __exportStar(require("./types"), exports);
19
19
  var generateSubaccount_1 = require("./generateSubaccount");
20
20
  Object.defineProperty(exports, "generateSubaccount", { enumerable: true, get: function () { return generateSubaccount_1.generateSubaccount; } });
21
+ Object.defineProperty(exports, "decryptSubaccountPrivateKey", { enumerable: true, get: function () { return generateSubaccount_1.decryptSubaccountPrivateKey; } });
22
+ Object.defineProperty(exports, "createSubaccountSignerFromConfig", { enumerable: true, get: function () { return generateSubaccount_1.createSubaccountSignerFromConfig; } });
21
23
  var hashSubaccountApproval_1 = require("./hashSubaccountApproval");
22
24
  Object.defineProperty(exports, "hashSubaccountApproval", { enumerable: true, get: function () { return hashSubaccountApproval_1.hashSubaccountApproval; } });
23
25
  var getEmptySubaccountApproval_1 = require("./getEmptySubaccountApproval");
@@ -295,7 +295,7 @@ const dollar = 10n ** BigInt(factors_1.USD_DECIMALS);
295
295
  (0, vitest_1.it)("should handle routes with zero output", () => {
296
296
  const routes = createTestRoutes();
297
297
  const result = (0, swapRouting_1.getBestSwapPath)({ routes, usdIn: 100n * dollar, estimator: () => ({ usdOut: 0n }) });
298
- (0, vitest_1.expect)(result).toEqual(routes[0]);
298
+ (0, vitest_1.expect)(result).toBeUndefined();
299
299
  });
300
300
  (0, vitest_1.it)("should skip routes that throw errors", () => {
301
301
  const routes = createTestRoutes();
@@ -6,7 +6,11 @@ const bigmath_1 = require("../bigmath");
6
6
  const types_1 = require("../orders/types");
7
7
  const prices_1 = require("../prices");
8
8
  const types_2 = require("./types");
9
+ const MAX_ALLOWED_SLIPPAGE = 5000; // 50%
9
10
  function applySlippageToPrice(allowedSlippage, price, isIncrease, isLong) {
11
+ if (allowedSlippage < 0 || allowedSlippage > MAX_ALLOWED_SLIPPAGE) {
12
+ throw new Error(`allowedSlippage must be between 0 and ${MAX_ALLOWED_SLIPPAGE} bps, got ${allowedSlippage}`);
13
+ }
10
14
  const shouldIncreasePrice = (0, prices_1.getShouldUseMaxPrice)(isIncrease, isLong);
11
15
  const slippageBasisPoints = shouldIncreasePrice
12
16
  ? factors_1.BASIS_POINTS_DIVISOR + allowedSlippage
@@ -15,6 +19,9 @@ function applySlippageToPrice(allowedSlippage, price, isIncrease, isLong) {
15
19
  }
16
20
  exports.applySlippageToPrice = applySlippageToPrice;
17
21
  function applySlippageToMinOut(allowedSlippage, minOutputAmount) {
22
+ if (allowedSlippage < 0 || allowedSlippage > MAX_ALLOWED_SLIPPAGE) {
23
+ throw new Error(`allowedSlippage must be between 0 and ${MAX_ALLOWED_SLIPPAGE} bps, got ${allowedSlippage}`);
24
+ }
18
25
  const slippageBasisPoints = factors_1.BASIS_POINTS_DIVISOR - allowedSlippage;
19
26
  return bigmath_1.bigMath.mulDiv(minOutputAmount, BigInt(slippageBasisPoints), factors_1.BASIS_POINTS_DIVISOR_BIGINT);
20
27
  }
@@ -33,10 +33,13 @@ function getTwapDurationInSeconds(duration) {
33
33
  }
34
34
  exports.getTwapDurationInSeconds = getTwapDurationInSeconds;
35
35
  function getTwapValidFromTime(duration, numberOfParts, partIndex) {
36
+ if (numberOfParts < 2) {
37
+ throw new Error(`TWAP numberOfParts must be >= 2, got ${numberOfParts}`);
38
+ }
36
39
  const durationMinutes = duration.hours * 60 + duration.minutes;
37
- const durationMs = durationMinutes * 60;
40
+ const durationSeconds = durationMinutes * 60;
38
41
  const startTime = Math.ceil(Date.now() / 1000);
39
- return BigInt(Math.floor(startTime + (durationMs / (numberOfParts - 1)) * partIndex));
42
+ return BigInt(Math.floor(startTime + (durationSeconds / (numberOfParts - 1)) * partIndex));
40
43
  }
41
44
  exports.getTwapValidFromTime = getTwapValidFromTime;
42
45
  function changeTwapNumberOfPartsValue(value) {
@@ -61,11 +64,14 @@ function getTwapOrderKey({ twapId, orderType, pool, isLong, collateralTokenSymbo
61
64
  }
62
65
  exports.getTwapOrderKey = getTwapOrderKey;
63
66
  function makeTwapValidFromTimeGetter(duration, numberOfParts) {
67
+ if (numberOfParts < 2) {
68
+ throw new Error(`TWAP numberOfParts must be >= 2, got ${numberOfParts}`);
69
+ }
64
70
  const durationMinutes = duration.hours * 60 + duration.minutes;
65
- const durationMs = durationMinutes * 60;
71
+ const durationSeconds = durationMinutes * 60;
66
72
  const startTime = Math.ceil(Date.now() / 1000);
67
73
  return (part) => {
68
- return BigInt(Math.floor(startTime + (durationMs / (numberOfParts - 1)) * part));
74
+ return BigInt(Math.floor(startTime + (durationSeconds / (numberOfParts - 1)) * part));
69
75
  };
70
76
  }
71
77
  exports.makeTwapValidFromTimeGetter = makeTwapValidFromTimeGetter;
@@ -64,6 +64,7 @@ describe("decrease orders", () => {
64
64
  direction: "long",
65
65
  orderType: "market",
66
66
  size: decreaseSize,
67
+ collateralToken: "USDC",
67
68
  receiveToken: "USDC",
68
69
  mode: "express",
69
70
  from: account,
@@ -101,6 +102,7 @@ describe("decrease orders", () => {
101
102
  orderType: "market",
102
103
  size: decreaseSize,
103
104
  keepLeverage: true,
105
+ collateralToken: "USDC",
104
106
  receiveToken: "USDC",
105
107
  mode: "express",
106
108
  from: account,
@@ -136,6 +138,7 @@ describe("decrease orders", () => {
136
138
  orderType: "market",
137
139
  size: decreaseSize,
138
140
  keepLeverage: false,
141
+ collateralToken: "USDC",
139
142
  receiveToken: "USDC",
140
143
  mode: "express",
141
144
  from: account,
@@ -165,6 +168,7 @@ describe("decrease orders", () => {
165
168
  direction: "long",
166
169
  orderType: "market",
167
170
  size: TEST_SIZE_USD,
171
+ collateralToken: "USDC",
168
172
  receiveToken: "ETH",
169
173
  mode: "express",
170
174
  from: account,
@@ -181,6 +185,7 @@ describe("decrease orders", () => {
181
185
  direction: "long",
182
186
  orderType: "market",
183
187
  size: TEST_SIZE_USD,
188
+ collateralToken: "USDC",
184
189
  mode: "express",
185
190
  from: account,
186
191
  });
@@ -216,6 +221,7 @@ describe("decrease orders", () => {
216
221
  symbol: TEST_SYMBOL,
217
222
  direction: "long",
218
223
  size: decreaseSize,
224
+ collateralToken: "USDC",
219
225
  receiveToken: "USDC",
220
226
  twapConfig: { duration: 600, parts: 2 },
221
227
  mode: "express",
@@ -238,6 +244,7 @@ describe("decrease orders", () => {
238
244
  direction: "long",
239
245
  orderType: "market",
240
246
  size: decreaseSize,
247
+ collateralToken: "USDC",
241
248
  receiveToken: "USDC",
242
249
  mode: "express",
243
250
  from: account,
@@ -259,6 +266,7 @@ describe("decrease orders", () => {
259
266
  direction: "long",
260
267
  orderType: "market",
261
268
  size: TEST_SIZE_USD,
269
+ collateralToken: "USDC",
262
270
  receiveToken: "USDC",
263
271
  mode: "express",
264
272
  from: account,
@@ -304,6 +312,7 @@ describe("decrease orders", () => {
304
312
  orderType: "stop-loss",
305
313
  size: TEST_SIZE_USD,
306
314
  triggerPrice,
315
+ collateralToken: "USDC",
307
316
  receiveToken: "USDC",
308
317
  mode: "express",
309
318
  from: account,
@@ -328,6 +337,7 @@ describe("decrease orders", () => {
328
337
  orderType: "take-profit",
329
338
  size: TEST_SIZE_USD,
330
339
  triggerPrice,
340
+ collateralToken: "USDC",
331
341
  receiveToken: "USDC",
332
342
  mode: "express",
333
343
  from: account,
@@ -351,6 +361,7 @@ describe("decrease orders", () => {
351
361
  direction: "long",
352
362
  orderType: "market",
353
363
  size: TEST_SIZE_USD,
364
+ collateralToken: "USDC",
354
365
  receiveToken: "USDC",
355
366
  mode: "classic",
356
367
  from: account,
@@ -371,6 +382,7 @@ describe("decrease orders", () => {
371
382
  direction: "long",
372
383
  orderType: "market",
373
384
  size: decreaseSize,
385
+ collateralToken: "USDC",
374
386
  receiveToken: "USDC",
375
387
  mode: "classic",
376
388
  from: account,
@@ -402,6 +414,7 @@ describe("decrease orders", () => {
402
414
  direction: "long",
403
415
  orderType: "market",
404
416
  size: decreaseSize,
417
+ collateralToken: "USDC",
405
418
  receiveToken: "USDC",
406
419
  mode: "express",
407
420
  from: account,
@@ -428,6 +441,7 @@ describe("decrease orders", () => {
428
441
  direction: "long",
429
442
  orderType: "market",
430
443
  size: fullSize,
444
+ collateralToken: "USDC",
431
445
  receiveToken: "USDC",
432
446
  mode: "express",
433
447
  from: account,
@@ -1091,6 +1091,30 @@
1091
1091
  "baseBorrowingFactorShort": "0x05640382d9ac2b646b854e08d798e98f04cd0723d0898053d14d73aa8ad67aa1",
1092
1092
  "aboveOptimalUsageBorrowingFactorLong": "0xe1de87148bd67bda9217fbb7a4605e13a6819cf6b02f99ed4c0df17281800ee6",
1093
1093
  "aboveOptimalUsageBorrowingFactorShort": "0xf4d2054fd2e503b3e5535b68952c816ff1e6c76ed5a6db2b0a7071d88d1834c7"
1094
+ },
1095
+ "0xda81cdd397210C08cFc567f93982E148A3aac8a6": {
1096
+ "optimalUsageFactorLong": "0x986daec772e7197f321cf18ae605db6da936f87bcb03cff3d4303cd21e88fa51",
1097
+ "optimalUsageFactorShort": "0x41638decee9a2957f1416690587fb5f120bcb5a8636713df019f82f98eb9b4d7",
1098
+ "baseBorrowingFactorLong": "0x776135184fcbae1f6122486c6d370bbbc629d19b20298f5556291b8d8218ef42",
1099
+ "baseBorrowingFactorShort": "0x6e65b5a36df631c8e2251438f025977d1acffe836288cf5b3cb7b0b8812a8be0",
1100
+ "aboveOptimalUsageBorrowingFactorLong": "0x98e679255838f4a852cfe1711d2490d29a4f22d0becbe8464894f95c15c21372",
1101
+ "aboveOptimalUsageBorrowingFactorShort": "0x0945c48086a7b3eca228da45ae3e5811634c1d985fba1ef05591c2557769ccd5"
1102
+ },
1103
+ "0x6F287D071800BfA847B4a7a7104BE33F87Ce9E74": {
1104
+ "optimalUsageFactorLong": "0x90bbb46df9295b17c763bce05f9ac5d856a64dfd24e3298c6b242adedfbe7510",
1105
+ "optimalUsageFactorShort": "0x2e1131e3a19d1a6ba5dfe35f8f7b671fb05e46e448d6a4edb08575654e568070",
1106
+ "baseBorrowingFactorLong": "0x7f6e709e6b17fac1405b0a8cea7b76adeefd421663d8d84965caed5647597285",
1107
+ "baseBorrowingFactorShort": "0x6f4862a2271d2e3ebdd3280a1754297681dcb6d8c204fd6b44751178ce50a3d9",
1108
+ "aboveOptimalUsageBorrowingFactorLong": "0x19fd2a53a0b6aaf23cda804c4e832456f338926fa1e5427ac30936a881413d9a",
1109
+ "aboveOptimalUsageBorrowingFactorShort": "0x94b097a23f795ddb86ecc36fc491bf94fc246623aeb400f320091bc3520d37b1"
1110
+ },
1111
+ "0x2Ce2bc8B0f9d000f359d756a5816C125474Bb39b": {
1112
+ "optimalUsageFactorLong": "0xf925bb5c2878443d47d98b6e9f0d39dd21212f50b015a0c01fcd43adbf0c55a0",
1113
+ "optimalUsageFactorShort": "0x02f76508457d07fb8a2d7c475498c1d182054a87eca61b1c947521cfac21bbaa",
1114
+ "baseBorrowingFactorLong": "0x41c82ada55554195955056b52630f479dc5acad3eaa96970fd93735a72f50ca7",
1115
+ "baseBorrowingFactorShort": "0x85a4a75fcc2ced632df6a9dadbc46b5d4171f166572e298ac8e0f5dc0a713818",
1116
+ "aboveOptimalUsageBorrowingFactorLong": "0xfdc145dc5c86925a834513f0c78ef57f8da0f095253e561506b6367106d5caac",
1117
+ "aboveOptimalUsageBorrowingFactorShort": "0xc961a42b4a07b7f63f14fbd2a3c14c41643eb80dd5a8fdcde32ad1365bcb51a7"
1094
1118
  }
1095
1119
  },
1096
1120
  "43113": {
@@ -8299,6 +8299,189 @@
8299
8299
  "virtualMarketId": "0xdb27e89e0fe0c0ac059ed01e11b1ae3ad6f789f32e1fdddd40ca472a8daa3a03",
8300
8300
  "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5",
8301
8301
  "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960"
8302
+ },
8303
+ "0xda81cdd397210C08cFc567f93982E148A3aac8a6": {
8304
+ "isDisabled": "0xe798deebb3666821348826b2af3b45c3aba00c56517b23821f4af5dfab8aa11e",
8305
+ "maxLongPoolAmount": "0xb1a99060f6c5c2dcd4806c4214b2cb0fb479770f5c6a775c4771456198a9827d",
8306
+ "maxShortPoolAmount": "0x74ae039799b602712e8e9387ee55321dcf46af6308102961121e61350cc7a946",
8307
+ "maxLongPoolUsdForDeposit": "0xaf94714e067e07f29bcee3c1e19283a84dd0c28f6f741e54d7ee156af1046636",
8308
+ "maxShortPoolUsdForDeposit": "0xfe8be1d1fbe6f0a57d25280acf521af3e5ea6192d662b7fec68b54d8e7dddd9d",
8309
+ "reserveFactorLong": "0x7d54ebbbe3847402ec04b169bccffc92be5d7b9fff5f537eca12aefcba46a131",
8310
+ "reserveFactorShort": "0x2637dcca314ffb96177da3c97215619d83407190a7a39312cfb24857aebbdb27",
8311
+ "openInterestReserveFactorLong": "0x4735a6d1bf55542b5eea33471c5650e44b5368a6226753dc305f19839d695b54",
8312
+ "openInterestReserveFactorShort": "0x9f617438e493df62798b2da7faf7b10bc4dc32a44015e1646d0881641eb5335b",
8313
+ "maxOpenInterestLong": "0x18258eb3a5ef0f4af2692e54e73852f11c5d71bf9101402b1027c3f7bd42f5e6",
8314
+ "maxOpenInterestShort": "0x11b9445d0dbb2baea5e9b53d1d13b8a2ca5add077b565325cf799a8753f1516b",
8315
+ "minPositionImpactPoolAmount": "0x13dd0ee6946f347eb56eda1157ba1ccbf2c9f8d4e92a7d6ea71583a4e554aa2b",
8316
+ "positionImpactPoolDistributionRate": "0xf238e5219be8e487741119eaa0ab5e64a182c79d21de9f8678cab2cfd9b3e5cc",
8317
+ "borrowingFactorLong": "0x957b0087e3b03cea73c5ba6b57b1f30a1330c6a4bca39e7b819e58c83f8f67fc",
8318
+ "borrowingFactorShort": "0xb12503b76155999da1e14fa9526edd9719f417cdcdc22bb4055320aeae300375",
8319
+ "borrowingExponentFactorLong": "0x83249f197ab1734c434465b7106d14e41fe2d9fe60aa663d162ceafa89620334",
8320
+ "borrowingExponentFactorShort": "0x86d3bec5dc227d5520a4c763fe0cda6ace0985f339b7141322cdf923a0075556",
8321
+ "fundingFactor": "0x8dcd9f0dabcf58f16e52b0cf18f66621594ac31a24590cf357487193ba424093",
8322
+ "fundingExponentFactor": "0x408114a2ca96746ca24d6c1e5459dc5bd3a765c6c8811edddde3fedbc143e43f",
8323
+ "fundingIncreaseFactorPerSecond": "0x07d1caa4651893876001990da7804c2f9d64312226fc412e7789ecb972ca9df3",
8324
+ "fundingDecreaseFactorPerSecond": "0x857f645e7ce34f8ffbc2a03b896fabe20d4b48955525ca814d4b7de3199c28e7",
8325
+ "thresholdForStableFunding": "0x43de3d000c1aafacd690d771996e47acc4b344d64ebf249fb097d7b3d647f6f2",
8326
+ "thresholdForDecreaseFunding": "0x87a51eff585283a7eaa772bd09150a1dcc8676e8cb98523cf299624e16fbaaea",
8327
+ "minFundingFactorPerSecond": "0x444848606120f6d820fa0b60dbc2501c59fd3a5f659a3fd028197b6411128798",
8328
+ "maxFundingFactorPerSecond": "0xe8d62364922a1d3291298c4ea63dadcb79b020f179d988bec10c7a167fa1d2bd",
8329
+ "maxPnlFactorForTradersLong": "0x2f22d65f79095b523b664119dcc890070453d61aed5b80d2ca8f6fea7b6a551c",
8330
+ "maxPnlFactorForTradersShort": "0x93f26b6eb52f955b82d92c8804c81f16cb7c66bd3afa68efedfc742e3b3c9ea4",
8331
+ "maxPnlFactorForDepositsLong": "0x11e12df2d75ae15e9b29e7b33eecefd5fc0c58208ce6b60e220d5d19ffa309c7",
8332
+ "maxPnlFactorForDepositsShort": "0xf0e44ae7ce08170972c7995ec13fb3415ab6a019eaef3e570b601aee789a9d84",
8333
+ "maxPnlFactorForWithdrawalsLong": "0xaf1a8ae5756ce8c5fc7a7588131e3d88a2894eee762c38e61f3993422a7ae737",
8334
+ "maxPnlFactorForWithdrawalsShort": "0x90b8c856cf9d274ef2e846bf92a0ce64aa2283bf40bb48fe4dae7685f1f1b7b0",
8335
+ "positionFeeFactorForBalanceWasImproved": "0xba915215e928cb2779337f8637d905e5ec8a0ad83f4596b73bd64f007b790c9f",
8336
+ "positionFeeFactorForBalanceWasNotImproved": "0x55230277bc176eff9c44885ebc66dab28d941ce4d4f88e71dd58e64146baa07d",
8337
+ "positionImpactFactorPositive": "0x867a00d6a61dcf3085bbb2186e45c80444f2dce96bbef393ce414da79997d3c2",
8338
+ "positionImpactFactorNegative": "0x5406d146d3c06f1d1b9ae51cd0a7e165e8c1518217db4543a2736a172f49422e",
8339
+ "maxPositionImpactFactorPositive": "0x2e8b015e4e614ebfb4d32fa6976f492f24127d25a6e3eeecd8fcb29ef3c35dc9",
8340
+ "maxPositionImpactFactorNegative": "0x9617076426b2cec08e39083bb9606ac85548265bedc02d3a61f62695e3926568",
8341
+ "maxPositionImpactFactorForLiquidations": "0xfbbfa727781e378f0d40d201e66566d114aba7c173f5ffac491b99e400466725",
8342
+ "maxLendableImpactFactor": "0x5cd916471a01acc881c0cabfb307977ba940d061bacdb50cd9d7156c1b999276",
8343
+ "maxLendableImpactFactorForWithdrawals": "0xda57395a621749794f443344f9d6b5aef8736d2e01a6efedab344c04203a2f0d",
8344
+ "maxLendableImpactUsd": "0x5ee60c82481e2a8741b0150b8a7fa6f0ae549cf88a64378b2fedbdf93a8b36d3",
8345
+ "lentPositionImpactPoolAmount": "0xb3f8c8cc4a9359661d10d3e512600f95b40bf4ee3d33b156698afb3ca7361923",
8346
+ "minCollateralFactor": "0x4e00da12671ef829ce8cf8b7390ba3da17c423ce0e19475568da0ec7975faf20",
8347
+ "minCollateralFactorForLiquidation": "0xbce9a55ce62860cc37b9915bd323075009f2b23338d0e82eaf1c6f5b10c0aff9",
8348
+ "minCollateralFactorForOpenInterestLong": "0xd13f88bf2f1d6c70f32bf978e3b37e8fc5ec016a91dad528afcfc4e0e655fb8d",
8349
+ "minCollateralFactorForOpenInterestShort": "0x09b021a7935a0c4969c61293c429a01cc2cafca5767a20509a33c105a49bb617",
8350
+ "positionImpactExponentFactorPositive": "0xd3ef0c8f6679790b704791499750c15a22834dc0cfa3d19a4f1a90b7b00fd1c2",
8351
+ "positionImpactExponentFactorNegative": "0xb96e68d542fdb7cada82d122adf4c7d46f7a3770af4e08c9d9a94f1875c337fd",
8352
+ "swapFeeFactorForBalanceWasImproved": "0x89301313d2beea021375987560e2d9aa93afa076644810bfedef50599e638b76",
8353
+ "swapFeeFactorForBalanceWasNotImproved": "0x820248d94a9c178e4da16c36fff111208f2e107e0f33b871f7efa853d2fbcc3f",
8354
+ "atomicSwapFeeFactor": "0x49527108bf6bf70f1d9d154eaeac90c11fbacbd2c9362dffb445a4415d3eb71c",
8355
+ "swapImpactFactorPositive": "0x4c1a9d1b88a985a01f4e604c42402e6555a2ea04c5a105e90e1092e123edd6be",
8356
+ "swapImpactFactorNegative": "0x815011a5c896323d894dbc2ec642f6e909606f21d0d74db76b07d05c84c76ca5",
8357
+ "swapImpactExponentFactor": "0xffdee75ee6f2bc66ef32b600e7e4449b54c0dea0d3ba43b50b856ebcf44daaad",
8358
+ "withdrawalFeeFactorBalanceWasImproved": "0x7d579491fb4d00b7373302a7cd03684009a7849a4a83dc81efc52bd296074565",
8359
+ "withdrawalFeeFactorBalanceWasNotImproved": "0xa45673dcc2b760c245930db891fba2d55cd47370cf702ad65ba41c0a7a900767",
8360
+ "virtualMarketId": "0x329c35204ff9930d2d5d56c2c2c0064a58daa81971851c6461c5780284620b4e",
8361
+ "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5",
8362
+ "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960"
8363
+ },
8364
+ "0x6F287D071800BfA847B4a7a7104BE33F87Ce9E74": {
8365
+ "isDisabled": "0x4f13c7f629d71f415fd0e268d3fa7aa0821cbbf18d400d4671e4f066026e8f15",
8366
+ "maxLongPoolAmount": "0x26bc27f885de37125f9742eb5ef347fff231ca0ce25229fb33d31c0d6ab409cd",
8367
+ "maxShortPoolAmount": "0x4d03da5dc3a18d4d646bbb720e3fa691eb437b98be0abf0646b2498fb7de2fe0",
8368
+ "maxLongPoolUsdForDeposit": "0x6b50c0a5dbc4c8ad71c1d51d8fba2d3c4f16688cc67f1b9a9a6c2d977db03346",
8369
+ "maxShortPoolUsdForDeposit": "0x7d68dcc7e580506ceb9655b75b2211c80fffe32d76cc906deec049331651df46",
8370
+ "reserveFactorLong": "0x7d7530a29a7dcf3087c9851effb477b8a673f3781abf5314137b44e2104fedb2",
8371
+ "reserveFactorShort": "0x15c9a045dbff43677c233fbad341b9542f2c1d9934df556e50447086a140b534",
8372
+ "openInterestReserveFactorLong": "0xb54a8ad19e5a64c6c8d9688f69e4a6b593ad3148c6757a7b306b07cf773c5a25",
8373
+ "openInterestReserveFactorShort": "0x2c79a553886e164daf5a1f161d40cc1e8d693a32acaca6787a578e1fb27ea5ca",
8374
+ "maxOpenInterestLong": "0xba62bcb8aef98f08d5f6d06ede1cefcbd01af63068848a98736cd4f208157403",
8375
+ "maxOpenInterestShort": "0x986ae13b63b099d94fdbd31d9a2fc36f526287e4a3e4dcfd577815b573d5e938",
8376
+ "minPositionImpactPoolAmount": "0x131c61098ef437b2973963433b3ab63f4d30a9d0c74bdc13ec97a7cb149ae22d",
8377
+ "positionImpactPoolDistributionRate": "0xeff40cc96028f89608bec5825e1c84fb389a5b5c03dc7bc9665bffd05d4dd093",
8378
+ "borrowingFactorLong": "0xa1576373793c7a1b2638e57f5eb562100385757266dbece31a3a8958859d8ae2",
8379
+ "borrowingFactorShort": "0xf25e147655a8b11199f94e1392b2a004e7247815cb15fa4318d2ecb4d4ce213c",
8380
+ "borrowingExponentFactorLong": "0x7c6d1db4ccea5097306ee7ba009dc5838ac1e67717d0244cc83843d68b7dfadd",
8381
+ "borrowingExponentFactorShort": "0xc6cb77fb3436129fc3aa49866b48d9b01df60e188db96cffd6d53dcdf72629d2",
8382
+ "fundingFactor": "0xfe28e059cc7d76efe3017515c6e0509ccf9b2a13dc129a60ed8c6fc011ab9696",
8383
+ "fundingExponentFactor": "0xfdf13cc1ad47ac8bc41c0533835708fb55911fcc69ff9603347970be75f5a76d",
8384
+ "fundingIncreaseFactorPerSecond": "0x421f8e406d9f5365eb8a224fa877226b62c623c7cc39ab3e26772341fcacad5f",
8385
+ "fundingDecreaseFactorPerSecond": "0x5a0a2d2238f6c39d2af42ed2eaf6a43decb1c6f4fc01818d4f63b2d2ba8b3051",
8386
+ "thresholdForStableFunding": "0xc5e922a1a2796ebd1c66a91296c4150fe426209ee8780b14b2b2ad7d2062b401",
8387
+ "thresholdForDecreaseFunding": "0x2eadfb10dca84fbeb81999e0bb789c0c89f9e7778b746078eae432be23412c48",
8388
+ "minFundingFactorPerSecond": "0xc773b0cfb9135dffa368b4763191ae8e8705fd4ca46a49cf04584454ba3c3d73",
8389
+ "maxFundingFactorPerSecond": "0x76378bb541ec4afbd3597e04950d15d9e244cec4de41fda70e5012729846c326",
8390
+ "maxPnlFactorForTradersLong": "0x376e3fbe4769340314efe3b69c6fdc538cb1d297765a3d1e04e5b0165c76da6b",
8391
+ "maxPnlFactorForTradersShort": "0xcf8b2ebfb4bc6a253e9b3de1217a3a865d39c21352e8201e78751c236519ab1f",
8392
+ "maxPnlFactorForDepositsLong": "0x637d977450a1cddd2b1de54e01592c31c22eeeda6739960d0b6007e73735aca0",
8393
+ "maxPnlFactorForDepositsShort": "0x7d5ab6a0fb9f8a8fb4a018502b2de29ad8e85a57a8528aad9066e5ba357eee06",
8394
+ "maxPnlFactorForWithdrawalsLong": "0x3923f4c6756e92608700c7f7f6b086794778d272c6c9f5191d7ad494d938cf33",
8395
+ "maxPnlFactorForWithdrawalsShort": "0x85293e35c7c15da7f563894fe8834d149c6728da69499a841039d48d9a5c4a18",
8396
+ "positionFeeFactorForBalanceWasImproved": "0xeb81589a8c8624bf482c02f94fac8334e97b4351cd5a5b04609011d91a3b3c0a",
8397
+ "positionFeeFactorForBalanceWasNotImproved": "0x132be1ae0857c2a15f0da6e619b2ea5c1958b23278c0292c034c9e0e4ceccdcb",
8398
+ "positionImpactFactorPositive": "0xabd9b86a23832b0a19ddd8f660848ef9927bede61e554d9b299c4b66bbd85bb7",
8399
+ "positionImpactFactorNegative": "0xac7db8d42c178869db007f8570d3cdf9387c483fcaec82f6892548cf0d9e6dc4",
8400
+ "maxPositionImpactFactorPositive": "0xf82e4bbb3d3d9c1daf7937d075ba403f297b56e83cbe24ad4163a5ab900183cd",
8401
+ "maxPositionImpactFactorNegative": "0x42d2a397742d2a75d112154e28fa1a0bbaba63e789060631622602406d537464",
8402
+ "maxPositionImpactFactorForLiquidations": "0xac2cb9d8936c25c17255669c002366b81fe86d20c1c7001fe8c8d37441aca90e",
8403
+ "maxLendableImpactFactor": "0x42bcb88e17e0ece60f6e7d9948f1a5d91eccd59a8a624a480dbacfa9abeaa389",
8404
+ "maxLendableImpactFactorForWithdrawals": "0x61941d08148cf98cd380941d67f1f45aab8b0a9f2c8bef5235df3eb6b2a5f9f9",
8405
+ "maxLendableImpactUsd": "0x47c3b0a10e60584303316243bdd8b07fa3ccd7d4de80948c97cb3ac06c35d7ec",
8406
+ "lentPositionImpactPoolAmount": "0xa0632ca21f4ea0ed563b8339044a159188be593b9a593f65cb1c154907373d85",
8407
+ "minCollateralFactor": "0x9cde5d93322db493ef263f8bd399f248fe89099810f13f02f06fa86e9f377d19",
8408
+ "minCollateralFactorForLiquidation": "0x7bb90537dabeca1ca14fa83049875ac6926139a25f44f9f0dea58b18e1305e5e",
8409
+ "minCollateralFactorForOpenInterestLong": "0xb61c11377472662826f7f90695cd4ebdc628be9fd6e942b0904392528c03cce7",
8410
+ "minCollateralFactorForOpenInterestShort": "0x3e5978566bf744db5c5bd35dc76165e4f0500245e858f0ff295d412ac38f362b",
8411
+ "positionImpactExponentFactorPositive": "0x6156c558c8363d6ff33aa90d358dadcf450358b77a279dc7190b021511eed0a9",
8412
+ "positionImpactExponentFactorNegative": "0xde109854d5fef7d24d1537f8f0a337108ca59784e8dd4971bce70f80d95e9d65",
8413
+ "swapFeeFactorForBalanceWasImproved": "0x7cdb0b716119c759c979d1b3e75e56fe6001926ccdcbbf705061b5faeed028f0",
8414
+ "swapFeeFactorForBalanceWasNotImproved": "0xc07c5b27ae9a8f7d0a8484c95a711fd382ac82a83e6948f1edbafbeed84a5270",
8415
+ "atomicSwapFeeFactor": "0xa1f57325d92544e6e25d59bfeaeda8b6fa690f2e5ba489eec0368345eb8f1452",
8416
+ "swapImpactFactorPositive": "0x168eab258ed6a8d2f7eb7c2911a35d892d89f6a32eb875ce473cbf3f76550511",
8417
+ "swapImpactFactorNegative": "0xa789fa6d1249aefae8cace99c412f3a464565d4c80c08a97a3ac3596a65e7517",
8418
+ "swapImpactExponentFactor": "0xb5eb55d45c7bee8cc24ef3fa14c0cb32e2c86c03c170bc2c20b4142e4e0a0ffa",
8419
+ "withdrawalFeeFactorBalanceWasImproved": "0xcc0c34150dc81fbcc42474011e25bf0471f2e5a68681144efad94eeba383b4bd",
8420
+ "withdrawalFeeFactorBalanceWasNotImproved": "0x25cb20d2cd5d943f471b50fd7dbd474066f42b377223720864c58d691fce976f",
8421
+ "virtualMarketId": "0xc4a14ec11c733ffa3d39e35634c62d3f9cb8547c22964a19c1460a2e383f48e5",
8422
+ "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5",
8423
+ "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960"
8424
+ },
8425
+ "0x2Ce2bc8B0f9d000f359d756a5816C125474Bb39b": {
8426
+ "isDisabled": "0xec2662d8624d9017e4c7ef29ca3596dc2725c5757b5989bd3b6e9b95d085431e",
8427
+ "maxLongPoolAmount": "0xbdd8f22d7c1bf9256ec571069d72cee4fa40be4b84a4377ceee6704a0943cf0a",
8428
+ "maxShortPoolAmount": "0x102f924ca8fb05e6d27e7d88b32028a8e8d15732c184945fa01d4c623c7e9baa",
8429
+ "maxLongPoolUsdForDeposit": "0xefe8e929051651e2dcd934b433539db59c8cc786ac278cba0a68ee0d5bbd5cc8",
8430
+ "maxShortPoolUsdForDeposit": "0xc521f6543060123178a72d5f34661bc2e6ccea3f2f4d2818023fc7eb145cd22e",
8431
+ "reserveFactorLong": "0x6eb134304523f09609f9d16bcbe59e36e3ece777f47c151b05eed37229c4e290",
8432
+ "reserveFactorShort": "0x00bdda31bfa2ec3d8c66a35d0cbf95664b2f99470e4e0585a97df3e9257e306a",
8433
+ "openInterestReserveFactorLong": "0x0602776f7d4dd869b8477501997cfbc54a97f08c280f37dec0aded36d72157b0",
8434
+ "openInterestReserveFactorShort": "0x90b4a9e4dc997bd6d99fe2c04acfc485c83225becaafcc0089cbc6afde029f1a",
8435
+ "maxOpenInterestLong": "0xedce1daeab7e885f7bda76e0b53dbbfe819b700a10781743e4f48d7bd20f4714",
8436
+ "maxOpenInterestShort": "0x62e9fe81c847d3fa0e2895ce360389500d49fdc8e21ac7091e5fcb6b09ca71a2",
8437
+ "minPositionImpactPoolAmount": "0xc9337bbbe968145ffc392fe3626344a6ed594e7c3abf6382e1aae33564b4c6ba",
8438
+ "positionImpactPoolDistributionRate": "0x6459f1c29a5564c14fbff5315dff86519b0366ac3f9180c0664a961fb5e83aeb",
8439
+ "borrowingFactorLong": "0x93a6552da0e264ff93533f3b9bae663bfc9d6aeaef8e74d19d1c5ccd96f51e1d",
8440
+ "borrowingFactorShort": "0x178bca08e5808d56b703ad716c9f9bf20a50f8a141b11b280056f11a6d478a9a",
8441
+ "borrowingExponentFactorLong": "0xe5e6bcda69cf34fb086b2d7aa9bade8d731f688e911d2733fcf3d4fc9ab36323",
8442
+ "borrowingExponentFactorShort": "0x8fa4487e23a179f99c4bd6ab5f2bb395252b8b80c7c91a86c271f5b929f90f7c",
8443
+ "fundingFactor": "0xb7ce4b2d44d137089993d195cb8be39a130977f35636b5dd4136307045a7cd52",
8444
+ "fundingExponentFactor": "0x89127c89a2a2380dcc614f9ffc04e78358bbc9246498ed088347bdced5fa239a",
8445
+ "fundingIncreaseFactorPerSecond": "0xf0966e63e7d66f3335ffd5aa81d0c9e4ec46a558b4ce69f6526c0e7ae99d5d14",
8446
+ "fundingDecreaseFactorPerSecond": "0x2ba9b4642277e845fa404febbc37b005a6196e2bd50de3fdc365ac35a782f657",
8447
+ "thresholdForStableFunding": "0xc8a3d5c130d1d7ba6c53f0719254b8639410da99a3917395b87c55ac282af9db",
8448
+ "thresholdForDecreaseFunding": "0x04d9d778eed9f9ddf5820cea4dba04c498b0b9e8a6a614a98d4d1bb770be96a9",
8449
+ "minFundingFactorPerSecond": "0x8a5f4cdd4ed32d3114db052d84519dcf0fa4274dee454c055998dae99553c694",
8450
+ "maxFundingFactorPerSecond": "0x59f1c2804e9955c0360f7f0e068c97eccb884c8312a4f4bd4c8aeb6b119e99e1",
8451
+ "maxPnlFactorForTradersLong": "0x086d8ce5f1423fc95ee4ea53efe2a3ac83b87dd837f039de885b1adca6e6cccc",
8452
+ "maxPnlFactorForTradersShort": "0x45f5f94404614f10bc3b7565793373529f81fd3bc90c8ccc49cc35a0ff9e270a",
8453
+ "maxPnlFactorForDepositsLong": "0x60913b250886d680e07f746fb40e3e557184fbe01753db4f9795ff1e7fa3d844",
8454
+ "maxPnlFactorForDepositsShort": "0xe19b9811e4cb0b425425e0f6f2890db93d73c49c4f06b97a2da36c72495945bd",
8455
+ "maxPnlFactorForWithdrawalsLong": "0x4a56d7204f625d1f9893f722b94a1e8a0ce490db00bd84a3b8883f3fab7ace12",
8456
+ "maxPnlFactorForWithdrawalsShort": "0x34d861d615f3a3e0a5b45aaabdcb2a30019accfdc402606c8502cb30521d3635",
8457
+ "positionFeeFactorForBalanceWasImproved": "0x2c9bfebd3e92f8831ff776bdd4e73b40346f6b6043976e82b55df8344b120b96",
8458
+ "positionFeeFactorForBalanceWasNotImproved": "0xf825cee8fd63315d42691ee6c7a0e45691719c62597a24d64fc7c7a23548b3e5",
8459
+ "positionImpactFactorPositive": "0xd8efd50b22772f984d3ea02411069d2527eacdb4fe6ad9c90b7aa75d8cdbe8f4",
8460
+ "positionImpactFactorNegative": "0x1e5dd8416943c20c933a02bcd6a7c94e187075ecfdb1876b4a0bb0b459237a48",
8461
+ "maxPositionImpactFactorPositive": "0x8d5eed6fc142b0416cc65d9c235d20093ed74a85b07ed8d1214c0ccd29f3ac03",
8462
+ "maxPositionImpactFactorNegative": "0xc207410c990b614f65d7d7b3b6f55ab95a08dde9c89d1cd5555f43420330ec14",
8463
+ "maxPositionImpactFactorForLiquidations": "0xeaee00d92f88588cc313ba2778cc19d2cc1648dbd5d81af5aeb51c231e76c015",
8464
+ "maxLendableImpactFactor": "0x512ffc938f8382bd160a8f196611f217e78740c804340f33a4d2b67bb3ddecaa",
8465
+ "maxLendableImpactFactorForWithdrawals": "0x0dfff59d7523bb19ce0029abbc51b6357135ebcf30ad1db239e1fb1d3b4b96fc",
8466
+ "maxLendableImpactUsd": "0x66c2587602f1eec693a603de3f3a1249db182655530afc875e98ea70ae170650",
8467
+ "lentPositionImpactPoolAmount": "0x87ddc606285cfbb10f151228ce9dee3b090c4533f431bff5c5d5d45650ed0130",
8468
+ "minCollateralFactor": "0xbdeca4dee3eec5a49b56ba4ff34b17aeca6e127bac50e9d85af9f8157b112fc2",
8469
+ "minCollateralFactorForLiquidation": "0x1fa9f68211e7f99ba4000bcc27b5a1241ba5d12fd66df00640c8db4f3946f8e7",
8470
+ "minCollateralFactorForOpenInterestLong": "0x88db5d4b6a5cb99258a2f5e904b2ca51365b3daff2af614f39c1beb053832fe3",
8471
+ "minCollateralFactorForOpenInterestShort": "0x0b9dd69fb66011cf8f3eaca204ab88060c411f1c6f26f06c43965359f561336a",
8472
+ "positionImpactExponentFactorPositive": "0x4b91cd585b4858ddf191eb66ca3dfb85003965756ef0441269e6ef3c454cc51d",
8473
+ "positionImpactExponentFactorNegative": "0xee9dfb93b5eadbc66490e2080d25bfe72bb6c3e67d3dc8da93177c4736d91866",
8474
+ "swapFeeFactorForBalanceWasImproved": "0xc1b64cb2fb0c45784ae7b724b0d1d89bb8e43f35a468784d81e4012dd21d577b",
8475
+ "swapFeeFactorForBalanceWasNotImproved": "0x3316517a6d4f0f5b644e7512c676a3d941e478454c19b9517b598d57aa2ea59d",
8476
+ "atomicSwapFeeFactor": "0x256a1048e15d93572ed3e9d89fc231b5c12de136980dbec6d7116bee2c10b2de",
8477
+ "swapImpactFactorPositive": "0xa990468db719d1383930c87be2a7faecbb7ee2b003bbacdbe4de09798013236c",
8478
+ "swapImpactFactorNegative": "0x97a9f0342ed5d714ee6e7987e31d999539693401f977114bc1837c3397c74bd1",
8479
+ "swapImpactExponentFactor": "0x65d3ce5e275335e8ce478e4ef702c77ce8c037016f40267109b172ba095a2716",
8480
+ "withdrawalFeeFactorBalanceWasImproved": "0x91c8b6da83d9c06664c83f4a1c441fba4b17eedcddcce6c3bc82bd10669b7ca0",
8481
+ "withdrawalFeeFactorBalanceWasNotImproved": "0xac2842afeb305b2498606a5ca72bad928d011d9aea31d76dce9b57665dd09aab",
8482
+ "virtualMarketId": "0x0972819d24db7fb85b0d03ee48c64ce38c97f76b27b8c12da91c070c8604b4ef",
8483
+ "virtualLongTokenId": "0xaab37f889b9680dda34f58a689de3023cb22f7ae14d32a3c1d45798a973db1f5",
8484
+ "virtualShortTokenId": "0xd5258cb84f0039be58306488e8df941c05f3cf4f219e92aacb6561c736bbb960"
8302
8485
  }
8303
8486
  },
8304
8487
  "43113": {