@gmx-io/sdk 1.2.1 → 1.3.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.
Files changed (193) hide show
  1. package/build/cjs/src/abis/ClaimHandler.json +1 -16
  2. package/build/cjs/src/abis/CustomErrors.json +642 -61
  3. package/build/cjs/src/abis/DataStore.json +25 -6
  4. package/build/cjs/src/abis/EventEmitter.json +1 -6
  5. package/build/cjs/src/abis/ExchangeRouter.json +195 -290
  6. package/build/cjs/src/abis/GelatoRelayRouter.json +251 -98
  7. package/build/cjs/src/abis/GlvReader.json +60 -3
  8. package/build/cjs/src/abis/GlvRouter.json +144 -86
  9. package/build/cjs/src/abis/GovToken.json +1 -354
  10. package/build/cjs/src/abis/LayerZeroProvider.json +372 -0
  11. package/build/cjs/src/abis/Multicall.json +134 -38
  12. package/build/cjs/src/abis/MultichainClaimsRouter.json +1266 -0
  13. package/build/cjs/src/abis/MultichainGlvRouter.json +1150 -0
  14. package/build/cjs/src/abis/MultichainGmRouter.json +1449 -0
  15. package/build/cjs/src/abis/MultichainOrderRouter.json +1820 -0
  16. package/build/cjs/src/abis/MultichainSubaccountRouter.json +2069 -0
  17. package/build/cjs/src/abis/MultichainTransferRouter.json +915 -0
  18. package/build/cjs/src/abis/MultichainUtils.json +133 -0
  19. package/build/cjs/src/abis/MultichainVault.json +275 -0
  20. package/build/cjs/src/abis/ReferralStorage.json +69 -19
  21. package/build/cjs/src/abis/RelayParams.json +85 -48
  22. package/build/cjs/src/abis/SmartAccount.json +28 -0
  23. package/build/cjs/src/abis/SubaccountGelatoRelayRouter.json +282 -148
  24. package/build/cjs/src/abis/SubaccountRouter.json +62 -118
  25. package/build/cjs/src/abis/SyntheticsReader.json +342 -474
  26. package/build/cjs/src/abis/SyntheticsRouter.json +1 -6
  27. package/build/cjs/src/abis/index.js +51 -7
  28. package/build/cjs/src/configs/__tests__/markets.spec.js +1 -1
  29. package/build/cjs/src/configs/__tests__/permits.spec.js +1 -1
  30. package/build/cjs/src/configs/__tests__/tokens.spec.js +1 -1
  31. package/build/cjs/src/configs/batch.js +48 -0
  32. package/build/cjs/src/configs/chains.js +41 -8
  33. package/build/cjs/src/configs/contracts.js +151 -41
  34. package/build/cjs/src/configs/dataStore.js +39 -5
  35. package/build/cjs/src/configs/express.js +4 -0
  36. package/build/cjs/src/configs/factors.js +1 -1
  37. package/build/cjs/src/configs/markets.js +128 -0
  38. package/build/cjs/src/configs/oracleKeeper.js +2 -0
  39. package/build/cjs/src/configs/tokens.js +217 -2
  40. package/build/cjs/src/modules/markets/index.js +9 -4
  41. package/build/cjs/src/modules/markets/query-builders.js +28 -8
  42. package/build/cjs/src/modules/orders/helpers.js +2 -2
  43. package/build/cjs/src/modules/orders/helpers.spec.js +1 -1
  44. package/build/cjs/src/modules/orders/utils.js +4 -5
  45. package/build/cjs/src/modules/positions/positions.js +38 -5
  46. package/build/cjs/src/modules/utils/utils.js +1 -0
  47. package/build/cjs/src/prebuilt/hashedKinkModelMarketRatesKeys.json +146 -0
  48. package/build/cjs/src/prebuilt/hashedMarketConfigKeys.json +2207 -532
  49. package/build/cjs/src/prebuilt/hashedMarketValuesKeys.json +272 -0
  50. package/build/cjs/src/test/mock.js +9 -4
  51. package/build/cjs/src/types/subsquid.js +507 -1
  52. package/build/cjs/src/utils/LruCache.js +4 -0
  53. package/build/cjs/src/utils/__tests__/LruCache.spec.js +18 -0
  54. package/build/cjs/src/utils/__tests__/numbers.spec.js +18 -16
  55. package/build/cjs/src/utils/__tests__/orderTransactions/batchUtils.spec.js +0 -1
  56. package/build/cjs/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +8 -0
  57. package/build/cjs/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.js +38 -30
  58. package/build/cjs/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +10 -0
  59. package/build/cjs/src/utils/__tests__/orderTransactions/swapOrders.spec.js +6 -0
  60. package/build/cjs/src/utils/__tests__/positions.spec.js +23 -6
  61. package/build/cjs/src/utils/bigmath.js +9 -2
  62. package/build/cjs/src/utils/errors/parseError.js +35 -1
  63. package/build/cjs/src/utils/fees/executionFee.js +5 -3
  64. package/build/cjs/src/utils/fees/index.js +8 -6
  65. package/build/cjs/src/utils/fees/priceImpact.js +94 -32
  66. package/build/cjs/src/utils/gelatoRelay.js +5 -0
  67. package/build/cjs/src/utils/marketKeysAndConfigs.js +24 -4
  68. package/build/cjs/src/utils/markets.js +10 -3
  69. package/build/cjs/src/utils/numbers.js +18 -17
  70. package/build/cjs/src/utils/orderTransactions.js +5 -1
  71. package/build/cjs/src/utils/positions.js +77 -9
  72. package/build/cjs/src/utils/prices.js +19 -13
  73. package/build/cjs/src/utils/swap/__tests__/mockRouting.spec.js +1 -0
  74. package/build/cjs/src/utils/swap/swapStats.js +6 -3
  75. package/build/cjs/src/utils/trade/decrease.js +470 -0
  76. package/build/cjs/src/utils/trade/{amounts.js → increase.js} +86 -31
  77. package/build/cjs/src/utils/tradeHistory.js +3 -0
  78. package/build/esm/src/abis/ClaimHandler.json +1 -16
  79. package/build/esm/src/abis/CustomErrors.json +642 -61
  80. package/build/esm/src/abis/DataStore.json +25 -6
  81. package/build/esm/src/abis/EventEmitter.json +1 -6
  82. package/build/esm/src/abis/ExchangeRouter.json +195 -290
  83. package/build/esm/src/abis/GelatoRelayRouter.json +251 -98
  84. package/build/esm/src/abis/GlvReader.json +60 -3
  85. package/build/esm/src/abis/GlvRouter.json +144 -86
  86. package/build/esm/src/abis/GovToken.json +1 -354
  87. package/build/esm/src/abis/LayerZeroProvider.json +372 -0
  88. package/build/esm/src/abis/Multicall.json +134 -38
  89. package/build/esm/src/abis/MultichainClaimsRouter.json +1266 -0
  90. package/build/esm/src/abis/MultichainGlvRouter.json +1150 -0
  91. package/build/esm/src/abis/MultichainGmRouter.json +1449 -0
  92. package/build/esm/src/abis/MultichainOrderRouter.json +1820 -0
  93. package/build/esm/src/abis/MultichainSubaccountRouter.json +2069 -0
  94. package/build/esm/src/abis/MultichainTransferRouter.json +915 -0
  95. package/build/esm/src/abis/MultichainUtils.json +133 -0
  96. package/build/esm/src/abis/MultichainVault.json +275 -0
  97. package/build/esm/src/abis/ReferralStorage.json +69 -19
  98. package/build/esm/src/abis/RelayParams.json +85 -48
  99. package/build/esm/src/abis/SmartAccount.json +28 -0
  100. package/build/esm/src/abis/SubaccountGelatoRelayRouter.json +282 -148
  101. package/build/esm/src/abis/SubaccountRouter.json +62 -118
  102. package/build/esm/src/abis/SyntheticsReader.json +342 -474
  103. package/build/esm/src/abis/SyntheticsRouter.json +1 -6
  104. package/build/esm/src/abis/index.js +51 -7
  105. package/build/esm/src/configs/__tests__/markets.spec.js +3 -3
  106. package/build/esm/src/configs/__tests__/permits.spec.js +2 -2
  107. package/build/esm/src/configs/__tests__/tokens.spec.js +2 -2
  108. package/build/esm/src/configs/batch.js +49 -1
  109. package/build/esm/src/configs/chains.js +40 -7
  110. package/build/esm/src/configs/contracts.js +152 -42
  111. package/build/esm/src/configs/dataStore.js +29 -1
  112. package/build/esm/src/configs/express.js +5 -1
  113. package/build/esm/src/configs/factors.js +1 -1
  114. package/build/esm/src/configs/markets.js +129 -1
  115. package/build/esm/src/configs/oracleKeeper.js +3 -1
  116. package/build/esm/src/configs/tokens.js +216 -2
  117. package/build/esm/src/modules/markets/index.js +9 -4
  118. package/build/esm/src/modules/markets/query-builders.js +28 -8
  119. package/build/esm/src/modules/orders/helpers.js +1 -1
  120. package/build/esm/src/modules/orders/helpers.spec.js +1 -1
  121. package/build/esm/src/modules/orders/utils.js +4 -5
  122. package/build/esm/src/modules/positions/positions.js +40 -7
  123. package/build/esm/src/modules/utils/utils.js +1 -0
  124. package/build/esm/src/prebuilt/hashedKinkModelMarketRatesKeys.json +146 -0
  125. package/build/esm/src/prebuilt/hashedMarketConfigKeys.json +2207 -532
  126. package/build/esm/src/prebuilt/hashedMarketValuesKeys.json +272 -0
  127. package/build/esm/src/test/mock.js +9 -4
  128. package/build/esm/src/types/subsquid.js +506 -0
  129. package/build/esm/src/utils/LruCache.js +4 -0
  130. package/build/esm/src/utils/__tests__/LruCache.spec.js +18 -0
  131. package/build/esm/src/utils/__tests__/numbers.spec.js +18 -16
  132. package/build/esm/src/utils/__tests__/orderTransactions/batchUtils.spec.js +0 -1
  133. package/build/esm/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +8 -0
  134. package/build/esm/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.js +38 -30
  135. package/build/esm/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +10 -0
  136. package/build/esm/src/utils/__tests__/orderTransactions/swapOrders.spec.js +7 -1
  137. package/build/esm/src/utils/__tests__/positions.spec.js +23 -6
  138. package/build/esm/src/utils/bigmath.js +9 -2
  139. package/build/esm/src/utils/errors/parseError.js +31 -0
  140. package/build/esm/src/utils/fees/executionFee.js +5 -3
  141. package/build/esm/src/utils/fees/index.js +8 -6
  142. package/build/esm/src/utils/fees/priceImpact.js +88 -30
  143. package/build/esm/src/utils/gelatoRelay.js +2 -0
  144. package/build/esm/src/utils/marketKeysAndConfigs.js +25 -5
  145. package/build/esm/src/utils/markets.js +7 -1
  146. package/build/esm/src/utils/numbers.js +18 -17
  147. package/build/esm/src/utils/orderTransactions.js +5 -1
  148. package/build/esm/src/utils/positions.js +75 -11
  149. package/build/esm/src/utils/prices.js +20 -14
  150. package/build/esm/src/utils/swap/__tests__/mockRouting.spec.js +1 -0
  151. package/build/esm/src/utils/swap/swapStats.js +6 -3
  152. package/build/esm/src/utils/trade/decrease.js +460 -0
  153. package/build/esm/src/utils/trade/{amounts.js → increase.js} +87 -33
  154. package/build/esm/src/utils/tradeHistory.js +3 -0
  155. package/build/types/src/abis/index.d.ts +1 -1
  156. package/build/types/src/configs/batch.d.ts +2 -2
  157. package/build/types/src/configs/chains.d.ts +25 -20
  158. package/build/types/src/configs/contracts.d.ts +118 -10
  159. package/build/types/src/configs/dataStore.d.ts +16 -0
  160. package/build/types/src/configs/factors.d.ts +1 -1
  161. package/build/types/src/configs/markets.d.ts +2 -2
  162. package/build/types/src/configs/tokens.d.ts +1 -0
  163. package/build/types/src/index.d.ts +1 -1
  164. package/build/types/src/modules/base.d.ts +1 -1
  165. package/build/types/src/modules/markets/query-builders.d.ts +3 -2
  166. package/build/types/src/modules/markets/types.d.ts +2 -2
  167. package/build/types/src/modules/orders/utils.d.ts +6 -5
  168. package/build/types/src/types/fees.d.ts +1 -0
  169. package/build/types/src/types/markets.d.ts +10 -5
  170. package/build/types/src/types/orders.d.ts +1 -1
  171. package/build/types/src/types/positions.d.ts +26 -2
  172. package/build/types/src/types/sdk.d.ts +2 -2
  173. package/build/types/src/types/subsquid.d.ts +1259 -9
  174. package/build/types/src/types/tokens.d.ts +7 -0
  175. package/build/types/src/types/trade.d.ts +14 -3
  176. package/build/types/src/types/tradeHistory.d.ts +3 -0
  177. package/build/types/src/utils/LruCache.d.ts +1 -0
  178. package/build/types/src/utils/bigmath.d.ts +2 -1
  179. package/build/types/src/utils/errors/parseError.d.ts +11 -0
  180. package/build/types/src/utils/fees/executionFee.d.ts +6 -3
  181. package/build/types/src/utils/fees/index.d.ts +2 -2
  182. package/build/types/src/utils/fees/priceImpact.d.ts +33 -5
  183. package/build/types/src/utils/marketKeysAndConfigs.d.ts +9 -4
  184. package/build/types/src/utils/markets.d.ts +7 -0
  185. package/build/types/src/utils/multicall.d.ts +1 -1
  186. package/build/types/src/utils/numbers.d.ts +6 -3
  187. package/build/types/src/utils/orderTransactions.d.ts +6 -4
  188. package/build/types/src/utils/positions.d.ts +30 -0
  189. package/build/types/src/utils/prices.d.ts +4 -0
  190. package/build/types/src/utils/swap/swapValues.d.ts +1 -1
  191. package/build/types/src/utils/trade/decrease.d.ts +77 -0
  192. package/build/types/src/utils/trade/{amounts.d.ts → increase.d.ts} +16 -1
  193. package/package.json +2 -2
@@ -38,6 +38,13 @@ export const MAX_PNL_FACTOR_FOR_WITHDRAWALS_KEY = hashString("MAX_PNL_FACTOR_FOR
38
38
  export const MAX_PNL_FACTOR_FOR_DEPOSITS_KEY = hashString("MAX_PNL_FACTOR_FOR_DEPOSITS");
39
39
  export const MAX_PNL_FACTOR_FOR_TRADERS_KEY = hashString("MAX_PNL_FACTOR_FOR_TRADERS");
40
40
  export const MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY = hashString("MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS");
41
+ export const CLAIMABLE_COLLATERAL_DELAY_KEY = hashString("CLAIMABLE_COLLATERAL_DELAY");
42
+ export const CLAIMABLE_COLLATERAL_REDUCTION_FACTOR_KEY = hashString("CLAIMABLE_COLLATERAL_REDUCTION_FACTOR");
43
+ export const CLAIMABLE_COLLATERAL_TIME_DIVISOR_KEY = hashString("CLAIMABLE_COLLATERAL_TIME_DIVISOR");
44
+ export const MAX_LENDABLE_IMPACT_FACTOR_KEY = hashString("MAX_LENDABLE_IMPACT_FACTOR");
45
+ export const MAX_LENDABLE_IMPACT_USD_KEY = hashString("MAX_LENDABLE_IMPACT_USD");
46
+ export const MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS_KEY = hashString("MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS");
47
+ export const LENT_POSITION_IMPACT_POOL_AMOUNT_KEY = hashString("LENT_POSITION_IMPACT_POOL_AMOUNT");
41
48
  export const POSITION_IMPACT_POOL_AMOUNT_KEY = hashString("POSITION_IMPACT_POOL_AMOUNT");
42
49
  export const MIN_POSITION_IMPACT_POOL_AMOUNT_KEY = hashString("MIN_POSITION_IMPACT_POOL_AMOUNT");
43
50
  export const POSITION_IMPACT_POOL_DISTRIBUTION_RATE_KEY = hashString("POSITION_IMPACT_POOL_DISTRIBUTION_RATE");
@@ -76,8 +83,10 @@ export const SUBACCOUNT_LIST_KEY = hashString("SUBACCOUNT_LIST");
76
83
  export const MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT = hashString("MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT");
77
84
  export const SUBACCOUNT_ACTION_COUNT = hashString("SUBACCOUNT_ACTION_COUNT");
78
85
  export const SUBACCOUNT_ORDER_ACTION = hashString("SUBACCOUNT_ORDER_ACTION");
86
+ export const SUBACCOUNT_INTEGRATION_ID = hashString("SUBACCOUNT_INTEGRATION_ID");
79
87
  export const SUBACCOUNT_AUTO_TOP_UP_AMOUNT = hashString("SUBACCOUNT_AUTO_TOP_UP_AMOUNT");
80
88
  export const GLV_MAX_MARKET_TOKEN_BALANCE_USD = hashString("GLV_MAX_MARKET_TOKEN_BALANCE_USD");
89
+ export const MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION_KEY = hashString("MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION");
81
90
  export const GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT = hashString("GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT");
82
91
  export const IS_GLV_MARKET_DISABLED = hashString("IS_GLV_MARKET_DISABLED");
83
92
  export const GLV_SHIFT_LAST_EXECUTED_AT = hashString("GLV_SHIFT_LAST_EXECUTED_AT");
@@ -90,6 +99,7 @@ export const OPTIMAL_USAGE_FACTOR = hashString("OPTIMAL_USAGE_FACTOR");
90
99
  export const BASE_BORROWING_FACTOR = hashString("BASE_BORROWING_FACTOR");
91
100
  export const ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR = hashString("ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR");
92
101
  export const SUBACCOUNT_EXPIRES_AT = hashString("SUBACCOUNT_EXPIRES_AT");
102
+ export const MULTICHAIN_BALANCE = hashString("MULTICHAIN_BALANCE");
93
103
  export const PRICE_FEED_KEY = hashString("PRICE_FEED");
94
104
  export const GASLESS_FEATURE_DISABLED_KEY = hashString("GASLESS_FEATURE_DISABLED");
95
105
  export const GELATO_RELAY_FEE_MULTIPLIER_FACTOR_KEY = hashString("GELATO_RELAY_FEE_MULTIPLIER_FACTOR");
@@ -218,7 +228,7 @@ export function depositGasLimitKey() {
218
228
  return DEPOSIT_GAS_LIMIT_KEY;
219
229
  }
220
230
  export function withdrawalGasLimitKey() {
221
- return hashData(["bytes32"], [WITHDRAWAL_GAS_LIMIT_KEY]);
231
+ return WITHDRAWAL_GAS_LIMIT_KEY;
222
232
  }
223
233
  export function shiftGasLimitKey() {
224
234
  return SHIFT_GAS_LIMIT_KEY;
@@ -241,6 +251,9 @@ export function accountOrderListKey(account) {
241
251
  export function minCollateralFactorKey(market) {
242
252
  return hashData(["bytes32", "address"], [MIN_COLLATERAL_FACTOR_KEY, market]);
243
253
  }
254
+ export function minCollateralFactorForLiquidationKey(market) {
255
+ return hashData(["bytes32", "address"], [MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION_KEY, market]);
256
+ }
244
257
  export function minCollateralFactorForOpenInterest(market, isLong) {
245
258
  return hashData(["bytes32", "address", "bool"], [MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY, market, isLong]);
246
259
  }
@@ -289,9 +302,24 @@ export function maxAllowedSubaccountActionCountKey(account, subaccount, actionTy
289
302
  export function subaccountActionCountKey(account, subaccount, actionType) {
290
303
  return hashData(["bytes32", "address", "address", "bytes32"], [SUBACCOUNT_ACTION_COUNT, account, subaccount, actionType]);
291
304
  }
305
+ export function maxLendableImpactFactorKey(market) {
306
+ return hashData(["bytes32", "address"], [MAX_LENDABLE_IMPACT_FACTOR_KEY, market]);
307
+ }
308
+ export function maxLendableImpactFactorForWithdrawalsKey(market) {
309
+ return hashData(["bytes32", "address"], [MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS_KEY, market]);
310
+ }
311
+ export function maxLendableImpactUsdKey(market) {
312
+ return hashData(["bytes32", "address"], [MAX_LENDABLE_IMPACT_USD_KEY, market]);
313
+ }
314
+ export function subaccountIntegrationIdKey(account, subaccount) {
315
+ return hashData(["bytes32", "address", "address"], [SUBACCOUNT_INTEGRATION_ID, account, subaccount]);
316
+ }
292
317
  export function subaccountAutoTopUpAmountKey(account, subaccount) {
293
318
  return hashData(["bytes32", "address", "address"], [SUBACCOUNT_AUTO_TOP_UP_AMOUNT, account, subaccount]);
294
319
  }
320
+ export function multichainBalanceKey(account, token) {
321
+ return hashData(["bytes32", "address", "address"], [MULTICHAIN_BALANCE, account, token]);
322
+ }
295
323
  export function priceFeedKey(token) {
296
324
  return hashData(["bytes32", "address"], [PRICE_FEED_KEY, token]);
297
325
  }
@@ -1,6 +1,6 @@
1
1
  import { expandDecimals, USD_DECIMALS } from "../utils/numbers";
2
2
  import { periodToSeconds } from "../utils/time";
3
- import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains";
3
+ import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains";
4
4
  import { getTokenBySymbol, getWrappedToken } from "./tokens";
5
5
  export const SUBACCOUNT_MESSAGE = "Generate a GMX 1CT (One-Click Trading) session. Only sign this message on a trusted website.";
6
6
  export const SUBACCOUNT_DOCS_URL = "https://docs.gmx.io/docs/trading/v2/#one-click-trading";
@@ -18,6 +18,10 @@ const GAS_PAYMENT_TOKENS = {
18
18
  getTokenBySymbol(AVALANCHE_FUJI, "USDC").address,
19
19
  getTokenBySymbol(AVALANCHE_FUJI, "WAVAX").address,
20
20
  ],
21
+ [ARBITRUM_SEPOLIA]: [
22
+ getTokenBySymbol(ARBITRUM_SEPOLIA, "USDC.SG").address,
23
+ getTokenBySymbol(ARBITRUM_SEPOLIA, "WETH").address,
24
+ ],
21
25
  [BOTANIX]: [getTokenBySymbol(BOTANIX, "pBTC").address],
22
26
  };
23
27
  export function getGasPaymentTokens(chainId) {
@@ -2,7 +2,7 @@ export { USD_DECIMALS, BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT, BASIS_
2
2
  // V2
3
3
  export const HIGH_PRICE_IMPACT_BPS = 80; // 0.8%
4
4
  export const HIGH_POSITION_IMPACT_BPS = 50; // 0.5%
5
- export const HIGH_COLLATERAL_IMPACT_BPS = 500; // 5%
5
+ export const HIGH_COLLATERAL_IMPACT_BPS = 2000; // 20%
6
6
  export const HIGH_SWAP_IMPACT_BPS = 50; // 0.5%
7
7
  export const DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER = 30; // 0.3%
8
8
  export const HIGH_ALLOWED_SWAP_SLIPPAGE_BPS = 20; // 0.2%
@@ -2,7 +2,7 @@
2
2
  This files is used to pre-build data during the build process.
3
3
  Avoid adding client-side code here, as it can break the build process.
4
4
  */
5
- import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains";
5
+ import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains";
6
6
  export const SWAP_GRAPH_MAX_MARKETS_PER_TOKEN = 5;
7
7
  /*
8
8
  ATTENTION
@@ -668,6 +668,83 @@ export const MARKETS = {
668
668
  longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
669
669
  shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
670
670
  },
671
+ // CVX/USD [WETH-USDC]
672
+ "0x41E3bC5B72384C8B26b559B7d16C2B81Fd36fbA2": {
673
+ marketTokenAddress: "0x41E3bC5B72384C8B26b559B7d16C2B81Fd36fbA2",
674
+ indexTokenAddress: "0x3B6f801C0052Dfe0Ac80287D611F31B7c47B9A6b",
675
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
676
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
677
+ },
678
+ // KAS/USD [WBTC-USDC]
679
+ "0x4024418592450E4d62faB15e2f833FC03A3447dc": {
680
+ marketTokenAddress: "0x4024418592450E4d62faB15e2f833FC03A3447dc",
681
+ indexTokenAddress: "0x91c6a8F6aFAC036F4ABf1bA55f4E76892E865E4a",
682
+ longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
683
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
684
+ },
685
+ // OKB/USD [WETH-USDC]
686
+ "0x2a331e51a3D17211852d8625a1029898450e539B": {
687
+ marketTokenAddress: "0x2a331e51a3D17211852d8625a1029898450e539B",
688
+ indexTokenAddress: "0xd37F01A3379f052FEF70F63c0Be27931891aa2B9",
689
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
690
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
691
+ },
692
+ // WIF/USD [WBTC-USDC]
693
+ "0x3f649eab7f4CE4945F125939C64429Be2C5d0cB4": {
694
+ marketTokenAddress: "0x3f649eab7f4CE4945F125939C64429Be2C5d0cB4",
695
+ indexTokenAddress: "0xA1b91fe9FD52141Ff8cac388Ce3F10BFDc1dE79d",
696
+ longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
697
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
698
+ },
699
+ // AERO/USD [WETH-USDC]
700
+ "0xfaEaE570B07618D3F10360608E43c241181c4614": {
701
+ marketTokenAddress: "0xfaEaE570B07618D3F10360608E43c241181c4614",
702
+ indexTokenAddress: "0xEcc5eb985Ddbb8335b175b0A2A1144E4c978F1f6",
703
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
704
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
705
+ },
706
+ // BRETT/USD [WETH-USDC]
707
+ "0x6EeE8098dBC106aEde99763FA5F955A5bBc42C50": {
708
+ marketTokenAddress: "0x6EeE8098dBC106aEde99763FA5F955A5bBc42C50",
709
+ indexTokenAddress: "0x4249F6e0808bEfF7368AaAD3F7A3Fd511F61Ee60",
710
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
711
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
712
+ },
713
+ // WLFI/USD [WETH-USDC]
714
+ "0xb3588455858a49D3244237CEe00880CcB84b91Dd": {
715
+ marketTokenAddress: "0xb3588455858a49D3244237CEe00880CcB84b91Dd",
716
+ indexTokenAddress: "0xC5799ab6E2818fD8d0788dB8D156B0c5db1Bf97b",
717
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
718
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
719
+ },
720
+ // LINK/USD [WETH-USDC]
721
+ "0xF913B4748031EF569898ED91e5BA0d602bB93298": {
722
+ marketTokenAddress: "0xF913B4748031EF569898ED91e5BA0d602bB93298",
723
+ indexTokenAddress: "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",
724
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
725
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
726
+ },
727
+ // MORPHO/USD [WETH-USDC]
728
+ "0x4De268aC68477f794C3eAC5A419Cbcffc2cD5e02": {
729
+ marketTokenAddress: "0x4De268aC68477f794C3eAC5A419Cbcffc2cD5e02",
730
+ indexTokenAddress: "0xF67b2a901D674B443Fa9f6DB2A689B37c07fD4fE",
731
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
732
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
733
+ },
734
+ // VVV/USD [WETH-USDC]
735
+ "0x947C521E44f727219542B0f91a85182193c1D2ad": {
736
+ marketTokenAddress: "0x947C521E44f727219542B0f91a85182193c1D2ad",
737
+ indexTokenAddress: "0xB79Eb5BA64A167676694bB41bc1640F95d309a2F",
738
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
739
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
740
+ },
741
+ // WELL/USD [WETH-USDC]
742
+ "0x2347EbB8645Cc2EA0Ba92D1EC59704031F2fCCf4": {
743
+ marketTokenAddress: "0x2347EbB8645Cc2EA0Ba92D1EC59704031F2fCCf4",
744
+ indexTokenAddress: "0x465A31E5bA29b8EAcC860d499D714a6f07e56E85",
745
+ longTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
746
+ shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
747
+ },
671
748
  },
672
749
  [AVALANCHE]: {
673
750
  // BTC/USD [BTC-USDC]
@@ -789,6 +866,13 @@ export const MARKETS = {
789
866
  longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
790
867
  shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
791
868
  },
869
+ // WLFI/USD [WAVAX-USDC]
870
+ "0x1cb9932CE322877A2B86489BD1aA3C3CfF879F0d": {
871
+ marketTokenAddress: "0x1cb9932CE322877A2B86489BD1aA3C3CfF879F0d",
872
+ indexTokenAddress: "0xbDF8a77ACB7A54597E7760b34D3E632912bB59b7",
873
+ longTokenAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
874
+ shortTokenAddress: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
875
+ },
792
876
  },
793
877
  [AVALANCHE_FUJI]: {
794
878
  // AVAX/USD [WAVAX-USDC]
@@ -932,6 +1016,43 @@ export const MARKETS = {
932
1016
  shortTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca",
933
1017
  },
934
1018
  },
1019
+ [ARBITRUM_SEPOLIA]: {
1020
+ // ETH/USD [WETH-USDC]
1021
+ "0x482Df3D320C964808579b585a8AC7Dd5D144eFaF": {
1022
+ marketTokenAddress: "0x482Df3D320C964808579b585a8AC7Dd5D144eFaF",
1023
+ indexTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
1024
+ longTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
1025
+ shortTokenAddress: "0x3321Fd36aEaB0d5CdfD26f4A3A93E2D2aAcCB99f",
1026
+ },
1027
+ // BTC/USD [BTC-USDC]
1028
+ "0xBb532Ab4923C23c2bfA455151B14fec177a34C0D": {
1029
+ marketTokenAddress: "0xBb532Ab4923C23c2bfA455151B14fec177a34C0D",
1030
+ indexTokenAddress: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12",
1031
+ longTokenAddress: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12",
1032
+ shortTokenAddress: "0x3321Fd36aEaB0d5CdfD26f4A3A93E2D2aAcCB99f",
1033
+ },
1034
+ // ETH/USD [WETH-USDC.SG]
1035
+ "0xb6fC4C9eB02C35A134044526C62bb15014Ac0Bcc": {
1036
+ marketTokenAddress: "0xb6fC4C9eB02C35A134044526C62bb15014Ac0Bcc",
1037
+ indexTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
1038
+ longTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
1039
+ shortTokenAddress: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773",
1040
+ },
1041
+ // BTC/USD [BTC-USDC.SG]
1042
+ "0x3A83246bDDD60c4e71c91c10D9A66Fd64399bBCf": {
1043
+ marketTokenAddress: "0x3A83246bDDD60c4e71c91c10D9A66Fd64399bBCf",
1044
+ indexTokenAddress: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12",
1045
+ longTokenAddress: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12",
1046
+ shortTokenAddress: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773",
1047
+ },
1048
+ // CRV/USD [WETH-USDC]
1049
+ "0xAde9D177B9E060D2064ee9F798125e6539fDaA1c": {
1050
+ marketTokenAddress: "0xAde9D177B9E060D2064ee9F798125e6539fDaA1c",
1051
+ indexTokenAddress: "0xD5DdAED48B09fa1D7944bd662CB05265FCD7077C",
1052
+ longTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
1053
+ shortTokenAddress: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773",
1054
+ },
1055
+ },
935
1056
  [BOTANIX]: {
936
1057
  // BTC/USD [stBTC-stBTC]
937
1058
  "0x6682BB60590a045A956541B1433f016Ed22E361d": {
@@ -947,5 +1068,12 @@ export const MARKETS = {
947
1068
  longTokenAddress: "0xF4586028FFdA7Eca636864F80f8a3f2589E33795",
948
1069
  shortTokenAddress: "0x29eE6138DD4C9815f46D34a4A1ed48F46758A402",
949
1070
  },
1071
+ // BTC/USD [PBTC-PBTC]
1072
+ "0x6bFDD025827F7CE130BcfC446927AEF34ae2a98d": {
1073
+ marketTokenAddress: "0x6bFDD025827F7CE130BcfC446927AEF34ae2a98d",
1074
+ indexTokenAddress: "0x1B9e25f54225bcdCf347569E38C41Ade9BB686e5",
1075
+ longTokenAddress: "0x0D2437F93Fed6EA64Ef01cCde385FB1263910C56",
1076
+ shortTokenAddress: "0x0D2437F93Fed6EA64Ef01cCde385FB1263910C56",
1077
+ },
950
1078
  },
951
1079
  };
@@ -1,15 +1,17 @@
1
- import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains";
1
+ import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains";
2
2
  const ORACLE_KEEPER_URLS = {
3
3
  [ARBITRUM]: "https://arbitrum-api.gmxinfra.io",
4
4
  [AVALANCHE]: "https://avalanche-api.gmxinfra.io",
5
5
  [AVALANCHE_FUJI]: "https://synthetics-api-avax-fuji-upovm.ondigitalocean.app",
6
6
  [BOTANIX]: "https://botanix-api.gmxinfra.io",
7
+ [ARBITRUM_SEPOLIA]: "https://dolphin-app-a2dup.ondigitalocean.app",
7
8
  };
8
9
  const ORACLE_KEEPER_FALLBACK_URLS = {
9
10
  [ARBITRUM]: ["https://arbitrum-api-fallback.gmxinfra.io", "https://arbitrum-api-fallback.gmxinfra2.io"],
10
11
  [AVALANCHE]: ["https://avalanche-api-fallback.gmxinfra.io", "https://avalanche-api-fallback.gmxinfra2.io"],
11
12
  [AVALANCHE_FUJI]: ["https://synthetics-api-avax-fuji-upovm.ondigitalocean.app"],
12
13
  [BOTANIX]: ["https://botanix-api-fallback.gmxinfra.io", "https://botanix-api-fallback.gmxinfra2.io"],
14
+ [ARBITRUM_SEPOLIA]: ["https://dolphin-app-a2dup.ondigitalocean.app"],
13
15
  };
14
16
  export function getOracleKeeperUrl(chainId) {
15
17
  if (!ORACLE_KEEPER_URLS[chainId]) {
@@ -1,5 +1,5 @@
1
1
  import { zeroAddress } from "viem";
2
- import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains";
2
+ import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains";
3
3
  import { getContract } from "./contracts";
4
4
  export const NATIVE_TOKEN_ADDRESS = zeroAddress;
5
5
  export const TOKENS = {
@@ -1068,6 +1068,105 @@ export const TOKENS = {
1068
1068
  imageUrl: "https://assets.coingecko.com/coins/images/3688/standard/hbar.png?1696504364",
1069
1069
  coingeckoUrl: "https://www.coingecko.com/en/coins/hedera-hashgraph",
1070
1070
  },
1071
+ {
1072
+ name: "Convex Finance",
1073
+ symbol: "CVX",
1074
+ address: "0x3B6f801C0052Dfe0Ac80287D611F31B7c47B9A6b",
1075
+ decimals: 18,
1076
+ priceDecimals: 4,
1077
+ isSynthetic: true,
1078
+ categories: ["defi"],
1079
+ imageUrl: "https://assets.coingecko.com/coins/images/15585/standard/convex.png?1696515221",
1080
+ coingeckoUrl: "https://www.coingecko.com/nl/coins/convex-finance",
1081
+ },
1082
+ {
1083
+ name: "Kaspa",
1084
+ symbol: "KAS",
1085
+ address: "0x91c6a8F6aFAC036F4ABf1bA55f4E76892E865E4a",
1086
+ decimals: 8,
1087
+ priceDecimals: 6,
1088
+ isSynthetic: true,
1089
+ categories: ["layer1"],
1090
+ imageUrl: "https://assets.coingecko.com/coins/images/25751/standard/kaspa-icon-exchanges.png?1696524837",
1091
+ coingeckoUrl: "https://www.coingecko.com/nl/coins/kaspa",
1092
+ },
1093
+ {
1094
+ name: "Aero",
1095
+ symbol: "AERO",
1096
+ address: "0xEcc5eb985Ddbb8335b175b0A2A1144E4c978F1f6",
1097
+ decimals: 18,
1098
+ priceDecimals: 4,
1099
+ isSynthetic: true,
1100
+ categories: ["defi"],
1101
+ coingeckoUrl: "https://www.coingecko.com/en/coins/aerodrome-finance",
1102
+ imageUrl: "https://assets.coingecko.com/coins/images/31745/standard/token.png?1696530564",
1103
+ },
1104
+ {
1105
+ name: "Brett",
1106
+ symbol: "BRETT",
1107
+ address: "0x4249F6e0808bEfF7368AaAD3F7A3Fd511F61Ee60",
1108
+ decimals: 18,
1109
+ priceDecimals: 4,
1110
+ isSynthetic: true,
1111
+ categories: ["meme"],
1112
+ imageUrl: "https://assets.coingecko.com/coins/images/54317/standard/AERO.png?1728309870",
1113
+ coingeckoUrl: "https://www.coingecko.com/en/coins/brett-2",
1114
+ },
1115
+ {
1116
+ name: "World Liberty Financial",
1117
+ symbol: "WLFI",
1118
+ address: "0xC5799ab6E2818fD8d0788dB8D156B0c5db1Bf97b",
1119
+ decimals: 18,
1120
+ priceDecimals: 5,
1121
+ isSynthetic: true,
1122
+ categories: ["defi"],
1123
+ imageUrl: "https://assets.coingecko.com/coins/images/50767/standard/wlfi.png?1756438915",
1124
+ coingeckoUrl: "https://www.coingecko.com/en/coins/world-liberty-financial",
1125
+ },
1126
+ {
1127
+ name: "OKB",
1128
+ symbol: "OKB",
1129
+ address: "0xd37F01A3379f052FEF70F63c0Be27931891aa2B9",
1130
+ decimals: 18,
1131
+ priceDecimals: 3,
1132
+ isSynthetic: true,
1133
+ categories: ["layer2"],
1134
+ imageUrl: "https://assets.coingecko.com/coins/images/4463/standard/WeChat_Image_20220118095654.png?1696505053",
1135
+ coingeckoUrl: "https://www.coingecko.com/nl/coins/okb",
1136
+ },
1137
+ {
1138
+ name: "Morpho",
1139
+ symbol: "MORPHO",
1140
+ address: "0xF67b2a901D674B443Fa9f6DB2A689B37c07fD4fE",
1141
+ decimals: 18,
1142
+ priceDecimals: 4,
1143
+ isSynthetic: true,
1144
+ categories: ["defi"],
1145
+ imageUrl: "https://assets.coingecko.com/coins/images/29837/standard/Morpho-token-icon.png?1726771230",
1146
+ coingeckoUrl: "https://www.coingecko.com/nl/coins/morpho",
1147
+ },
1148
+ {
1149
+ name: "Venice Token",
1150
+ symbol: "VVV",
1151
+ address: "0xB79Eb5BA64A167676694bB41bc1640F95d309a2F",
1152
+ decimals: 18,
1153
+ priceDecimals: 4,
1154
+ isSynthetic: true,
1155
+ categories: ["defi"],
1156
+ imageUrl: "https://assets.coingecko.com/coins/images/54023/standard/VVV_Token_Transparent.png?1741856877",
1157
+ coingeckoUrl: "https://www.coingecko.com/en/coins/venice-token",
1158
+ },
1159
+ {
1160
+ name: "Moonwell",
1161
+ symbol: "WELL",
1162
+ address: "0x465A31E5bA29b8EAcC860d499D714a6f07e56E85",
1163
+ decimals: 18,
1164
+ priceDecimals: 4,
1165
+ isSynthetic: true,
1166
+ categories: ["defi"],
1167
+ imageUrl: "https://assets.coingecko.com/coins/images/26133/standard/WELL.png?1696525221",
1168
+ coingeckoUrl: "https://www.coingecko.com/en/coins/moonwell",
1169
+ },
1071
1170
  ],
1072
1171
  [AVALANCHE]: [
1073
1172
  {
@@ -1310,6 +1409,17 @@ export const TOKENS = {
1310
1409
  isSynthetic: true,
1311
1410
  categories: ["meme"],
1312
1411
  },
1412
+ {
1413
+ name: "World Liberty Financial",
1414
+ symbol: "WLFI",
1415
+ address: "0xbDF8a77ACB7A54597E7760b34D3E632912bB59b7",
1416
+ decimals: 18,
1417
+ priceDecimals: 5,
1418
+ isSynthetic: true,
1419
+ categories: ["defi"],
1420
+ imageUrl: "https://assets.coingecko.com/coins/images/50767/standard/wlfi.png?1756438915",
1421
+ coingeckoUrl: "https://www.coingecko.com/en/coins/world-liberty-financial",
1422
+ },
1313
1423
  {
1314
1424
  name: "Escrowed GMX",
1315
1425
  symbol: "ESGMX",
@@ -1575,6 +1685,107 @@ export const TOKENS = {
1575
1685
  isPlatformToken: true,
1576
1686
  },
1577
1687
  ],
1688
+ [ARBITRUM_SEPOLIA]: [
1689
+ {
1690
+ name: "Ethereum",
1691
+ symbol: "ETH",
1692
+ decimals: 18,
1693
+ address: zeroAddress,
1694
+ wrappedAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
1695
+ isNative: true,
1696
+ isShortable: true,
1697
+ categories: ["layer1"],
1698
+ imageUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png?1595348880",
1699
+ coingeckoUrl: "https://www.coingecko.com/en/coins/ethereum",
1700
+ },
1701
+ {
1702
+ name: "Wrapped ETH",
1703
+ symbol: "WETH",
1704
+ address: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
1705
+ decimals: 18,
1706
+ isWrapped: true,
1707
+ baseSymbol: "ETH",
1708
+ categories: ["layer1"],
1709
+ imageUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png?1595348880",
1710
+ coingeckoUrl: "https://www.coingecko.com/en/coins/ethereum",
1711
+ },
1712
+ {
1713
+ name: "Bitcoin",
1714
+ symbol: "BTC",
1715
+ address: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12",
1716
+ decimals: 8,
1717
+ imageUrl: "https://assets.coingecko.com/coins/images/1/small/bitcoin.png?1746042828",
1718
+ coingeckoUrl: "https://www.coingecko.com/en/coins/bitcoin",
1719
+ },
1720
+ {
1721
+ name: "USD Coin GMX",
1722
+ symbol: "USDC",
1723
+ address: "0x3321Fd36aEaB0d5CdfD26f4A3A93E2D2aAcCB99f",
1724
+ decimals: 6,
1725
+ isStable: true,
1726
+ imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389",
1727
+ coingeckoUrl: "https://www.coingecko.com/en/coins/usd-coin",
1728
+ },
1729
+ {
1730
+ name: "USD Coin Stargate",
1731
+ symbol: "USDC.SG",
1732
+ address: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773",
1733
+ decimals: 6,
1734
+ isStable: true,
1735
+ imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389",
1736
+ coingeckoUrl: "https://www.coingecko.com/en/coins/usd-coin",
1737
+ },
1738
+ {
1739
+ name: "CRV",
1740
+ symbol: "CRV",
1741
+ address: "0xD5DdAED48B09fa1D7944bd662CB05265FCD7077C",
1742
+ decimals: 18,
1743
+ priceDecimals: 5,
1744
+ imageUrl: "https://assets.coingecko.com/coins/images/12134/small/curve.png?1596358786",
1745
+ isSynthetic: true,
1746
+ coingeckoUrl: "https://www.coingecko.com/en/coins/curve-dao-token",
1747
+ },
1748
+ /** Placeholder tokens */
1749
+ {
1750
+ name: "GMX",
1751
+ symbol: "GMX",
1752
+ address: "<gmx-address>",
1753
+ decimals: 18,
1754
+ imageUrl: "https://assets.coingecko.com/coins/images/18323/small/arbit.png?1631532468",
1755
+ isPlatformToken: true,
1756
+ },
1757
+ {
1758
+ name: "Escrowed GMX",
1759
+ symbol: "ESGMX",
1760
+ address: "<esgmx-address>",
1761
+ decimals: 18,
1762
+ isPlatformToken: true,
1763
+ },
1764
+ {
1765
+ name: "GMX LP",
1766
+ symbol: "GLP",
1767
+ address: "<glp-address>",
1768
+ decimals: 18,
1769
+ imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true",
1770
+ isPlatformToken: true,
1771
+ },
1772
+ {
1773
+ name: "GMX Market tokens",
1774
+ symbol: "GM",
1775
+ address: "<market-token-address>",
1776
+ decimals: 18,
1777
+ imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png",
1778
+ isPlatformToken: true,
1779
+ },
1780
+ {
1781
+ name: "GLV Market tokens",
1782
+ symbol: "GLV",
1783
+ address: "<market-token-address>",
1784
+ decimals: 18,
1785
+ imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png",
1786
+ isPlatformToken: true,
1787
+ },
1788
+ ],
1578
1789
  [BOTANIX]: [
1579
1790
  {
1580
1791
  name: "Bitcoin",
@@ -1720,7 +1931,7 @@ export const SYNTHETIC_TOKENS = {};
1720
1931
  export const TOKENS_BY_SYMBOL_MAP = {};
1721
1932
  export const WRAPPED_TOKENS_MAP = {};
1722
1933
  export const NATIVE_TOKENS_MAP = {};
1723
- const CHAIN_IDS = [ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX];
1934
+ const CHAIN_IDS = [ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ARBITRUM_SEPOLIA];
1724
1935
  for (let j = 0; j < CHAIN_IDS.length; j++) {
1725
1936
  const chainId = CHAIN_IDS[j];
1726
1937
  TOKENS_MAP[chainId] = {};
@@ -1786,6 +1997,9 @@ export function isValidToken(chainId, address) {
1786
1997
  }
1787
1998
  return address in TOKENS_MAP[chainId];
1788
1999
  }
2000
+ export function isValidTokenSafe(chainId, address) {
2001
+ return address in TOKENS_MAP[chainId];
2002
+ }
1789
2003
  export function getToken(chainId, address) {
1790
2004
  // FIXME APE_deprecated token which is not in use but can be displayed
1791
2005
  if (chainId === ARBITRUM && address === "0x74885b4D524d497261259B38900f54e6dbAd2210") {
@@ -152,16 +152,21 @@ export class Markets extends Module {
152
152
  minCollateralFactor: dataStoreValues.minCollateralFactor.returnValues[0],
153
153
  minCollateralFactorForOpenInterestLong: dataStoreValues.minCollateralFactorForOpenInterestLong.returnValues[0],
154
154
  minCollateralFactorForOpenInterestShort: dataStoreValues.minCollateralFactorForOpenInterestShort.returnValues[0],
155
- positionFeeFactorForPositiveImpact: dataStoreValues.positionFeeFactorForPositiveImpact.returnValues[0],
156
- positionFeeFactorForNegativeImpact: dataStoreValues.positionFeeFactorForNegativeImpact.returnValues[0],
155
+ minCollateralFactorForLiquidation: dataStoreValues.minCollateralFactorForLiquidation.returnValues[0],
156
+ positionFeeFactorForBalanceWasImproved: dataStoreValues.positionFeeFactorForBalanceWasImproved.returnValues[0],
157
+ positionFeeFactorForBalanceWasNotImproved: dataStoreValues.positionFeeFactorForBalanceWasNotImproved.returnValues[0],
157
158
  positionImpactFactorPositive: dataStoreValues.positionImpactFactorPositive.returnValues[0],
158
159
  positionImpactFactorNegative: dataStoreValues.positionImpactFactorNegative.returnValues[0],
159
160
  maxPositionImpactFactorPositive: dataStoreValues.maxPositionImpactFactorPositive.returnValues[0],
160
161
  maxPositionImpactFactorNegative: dataStoreValues.maxPositionImpactFactorNegative.returnValues[0],
161
162
  maxPositionImpactFactorForLiquidations: dataStoreValues.maxPositionImpactFactorForLiquidations.returnValues[0],
163
+ maxLendableImpactFactor: dataStoreValues.maxLendableImpactFactor.returnValues[0],
164
+ maxLendableImpactFactorForWithdrawals: dataStoreValues.maxLendableImpactFactorForWithdrawals.returnValues[0],
165
+ maxLendableImpactUsd: dataStoreValues.maxLendableImpactUsd.returnValues[0],
166
+ lentPositionImpactPoolAmount: dataStoreValues.lentPositionImpactPoolAmount.returnValues[0],
162
167
  positionImpactExponentFactor: dataStoreValues.positionImpactExponentFactor.returnValues[0],
163
- swapFeeFactorForPositiveImpact: dataStoreValues.swapFeeFactorForPositiveImpact.returnValues[0],
164
- swapFeeFactorForNegativeImpact: dataStoreValues.swapFeeFactorForNegativeImpact.returnValues[0],
168
+ swapFeeFactorForBalanceWasImproved: dataStoreValues.swapFeeFactorForBalanceWasImproved.returnValues[0],
169
+ swapFeeFactorForBalanceWasNotImproved: dataStoreValues.swapFeeFactorForBalanceWasNotImproved.returnValues[0],
165
170
  swapImpactFactorPositive: dataStoreValues.swapImpactFactorPositive.returnValues[0],
166
171
  atomicSwapFeeFactor: dataStoreValues.atomicSwapFeeFactor.returnValues[0],
167
172
  swapImpactFactorNegative: dataStoreValues.swapImpactFactorNegative.returnValues[0],
@@ -301,13 +301,13 @@ export async function buildMarketsConfigsRequest(chainId, { marketsData, markets
301
301
  methodName: "getUint",
302
302
  params: [prebuiltHashedKeys.maxPnlFactorForTradersShort],
303
303
  },
304
- positionFeeFactorForPositiveImpact: {
304
+ positionFeeFactorForBalanceWasImproved: {
305
305
  methodName: "getUint",
306
- params: [prebuiltHashedKeys.positionFeeFactorForPositiveImpact],
306
+ params: [prebuiltHashedKeys.positionFeeFactorForBalanceWasImproved],
307
307
  },
308
- positionFeeFactorForNegativeImpact: {
308
+ positionFeeFactorForBalanceWasNotImproved: {
309
309
  methodName: "getUint",
310
- params: [prebuiltHashedKeys.positionFeeFactorForNegativeImpact],
310
+ params: [prebuiltHashedKeys.positionFeeFactorForBalanceWasNotImproved],
311
311
  },
312
312
  positionImpactFactorPositive: {
313
313
  methodName: "getUint",
@@ -329,10 +329,30 @@ export async function buildMarketsConfigsRequest(chainId, { marketsData, markets
329
329
  methodName: "getUint",
330
330
  params: [prebuiltHashedKeys.maxPositionImpactFactorForLiquidations],
331
331
  },
332
+ maxLendableImpactFactor: {
333
+ methodName: "getUint",
334
+ params: [prebuiltHashedKeys.maxLendableImpactFactor],
335
+ },
336
+ maxLendableImpactFactorForWithdrawals: {
337
+ methodName: "getUint",
338
+ params: [prebuiltHashedKeys.maxLendableImpactFactorForWithdrawals],
339
+ },
340
+ maxLendableImpactUsd: {
341
+ methodName: "getUint",
342
+ params: [prebuiltHashedKeys.maxLendableImpactUsd],
343
+ },
344
+ lentPositionImpactPoolAmount: {
345
+ methodName: "getUint",
346
+ params: [prebuiltHashedKeys.lentPositionImpactPoolAmount],
347
+ },
332
348
  minCollateralFactor: {
333
349
  methodName: "getUint",
334
350
  params: [prebuiltHashedKeys.minCollateralFactor],
335
351
  },
352
+ minCollateralFactorForLiquidation: {
353
+ methodName: "getUint",
354
+ params: [prebuiltHashedKeys.minCollateralFactorForLiquidation],
355
+ },
336
356
  minCollateralFactorForOpenInterestLong: {
337
357
  methodName: "getUint",
338
358
  params: [prebuiltHashedKeys.minCollateralFactorForOpenInterestLong],
@@ -345,13 +365,13 @@ export async function buildMarketsConfigsRequest(chainId, { marketsData, markets
345
365
  methodName: "getUint",
346
366
  params: [prebuiltHashedKeys.positionImpactExponentFactor],
347
367
  },
348
- swapFeeFactorForPositiveImpact: {
368
+ swapFeeFactorForBalanceWasImproved: {
349
369
  methodName: "getUint",
350
- params: [prebuiltHashedKeys.swapFeeFactorForPositiveImpact],
370
+ params: [prebuiltHashedKeys.swapFeeFactorForBalanceWasImproved],
351
371
  },
352
- swapFeeFactorForNegativeImpact: {
372
+ swapFeeFactorForBalanceWasNotImproved: {
353
373
  methodName: "getUint",
354
- params: [prebuiltHashedKeys.swapFeeFactorForNegativeImpact],
374
+ params: [prebuiltHashedKeys.swapFeeFactorForBalanceWasNotImproved],
355
375
  },
356
376
  atomicSwapFeeFactor: {
357
377
  methodName: "getUint",
@@ -3,7 +3,7 @@ import { getByKey } from "../../utils/objects";
3
3
  import { getSwapAmountsByFromValue, getSwapAmountsByToValue } from "../../utils/swap";
4
4
  import { createFindSwapPath } from "../../utils/swap/swapPath";
5
5
  import { convertToUsd, getIsUnwrap, getIsWrap, getTokensRatioByPrice } from "../../utils/tokens";
6
- import { getIncreasePositionAmounts } from "../../utils/trade/amounts";
6
+ import { getIncreasePositionAmounts } from "../../utils/trade/increase";
7
7
  function passThoughOrFetch(value, condition, fetchFn) {
8
8
  if (condition(value)) {
9
9
  return value;