Update to v2.2c contracts#2310
Open
qwinndev wants to merge 25 commits into
Open
Conversation
- Add SimulationRouter ABI and contract address for Arbitrum Sepolia - Remove simulation methods from ExchangeRouter ABI (cleanup) - Update simulateExecuteOrder.ts (SDK) with two-step simulation: create on ExchangeRouter, execute on SimulationRouter - Update simulateExecuteTxn.tsx (frontend) with three-path routing: GLV -> GlvRouter, v2.2c -> SimulationRouter, legacy -> ExchangeRouter - Add tryGetContract helper to SDK contracts config
…ion) - Add minCollateralFactorForLiquidation to subsquid codegen types - Update useFastMarketsInfoRequest GraphQL query to fetch dedicated field instead of duplicating minCollateralFactor - Fix getEstimatedLiquidationTimeInHours to use minCollateralFactorForLiquidation for accurate liquidation time estimation
- Update dataStore key functions to encode isLong boolean parameter - Rename MarketInfo type fields: minFundingFactorPerSecond -> minFundingFactorPerSecondLong/Short, maxFundingFactorPerSecond -> maxFundingFactorPerSecondLong/Short - Update hashKeys.ts with per-side key encoding and regenerate prebuilt hashedMarketConfigKeys.json - Update multicall.ts to fetch 4 per-side funding values from DataStore - Update useFastMarketsInfoRequest GraphQL query for per-side fields - Update SyntheticsStats tooltip to display per-side funding factors - Update test mocks, specs, and data fixtures for new field names - Add per-side funding fields to subsquid codegen types
…g floor logic Adds the MIN_FUNDING_INCREASE_RATE_PER_SECOND config key across the SDK pipeline: dataStore, hashKeys, multicall, types, subsquid codegen, prebuilt hashed keys, GraphQL fast path, and all test/mock data files.
…ens balance) - Update SyntheticsReader ABI to include positionValueInUsd field - Implement useOpenInterestInTokensForBalance logic in getPriceImpactForPosition using tokenDelta * midPrice as effectiveUsdDelta - Thread sizeDeltaInTokens through getAcceptablePriceInfo, getCappedPositionImpactUsd, and all decrease/increase trade paths - Pass sizeDeltaInTokens in liquidation price and position info calculations
Sync CustomErrors.ts ABI with the latest v2.2c contract error definitions.
- Add cancelledByKeeper flag to PositionOrderAction and SwapOrderAction types - Update trade history keys to include cancelledByKeeper for proper re-rendering - Update position and swap trade history row utils to show keeper-cancel messaging
- Update ExchangeRouter ABI with createTwapOrder method signature - Add nativeTwapParams to BatchOrderTxnParams and wire through order callbacks - Build native TWAP multicall encoding in orderTransactions utils - Add selectTradeBoxNativeTwapParams selector for TWAP order parameters - Update PositionSeller and TradeBox to handle native TWAP flow - Exclude native TWAP from express/relayer path with explicit guard
SimulationRouter uses NonceUtils.getCurrentKey which requires the order to exist on-chain. Since PayableMulticall uses delegatecall (can only call methods on its own contract), createOrder (ExchangeRouter) and simulateExecuteLatestOrder (SimulationRouter) cannot run atomically in one eth_call. The two-step approach caused OrderNotFound errors. Now v2.2c chains only validate the create payload on ExchangeRouter. Execution validation relies on Reader/SDK local calculations. Also adds debug logs ([v2.2c ...] prefix) for manual testing.
…/update-v22c-contracts
- Add MAX_COLLATERAL_SUM DataStore key, hash keys (4 per market), types, and multicall fetch paths (FEDEV-3590) - Update Arbitrum Sepolia contract addresses to latest v2.2c deployment (ExchangeRouter, Reader, GlvReader/Router, relay routers, multichain routers) - Update Sepolia squid URL to new deployment - Fix market config debug log to skip stale markets (maxLongPoolAmount > 0) - Regenerate prebuilt hashedMarketConfigKeys.json with new keys
e0763ff to
0d827ad
Compare
Deploying gmx-interface-home with
|
| Latest commit: |
8fc485d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e2117726.gmx-interface-home.pages.dev |
| Branch Preview URL: | https://qwinndev-update-v22c-contrac.gmx-interface-home.pages.dev |
Deploying gmx-interface with
|
| Latest commit: |
8fc485d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f5c63b96.gmx-interface.pages.dev |
| Branch Preview URL: | https://qwinndev-update-v22c-contrac.gmx-interface.pages.dev |
…efix from TWAP naming
…imulation push+slice
…o Position type - Add MaxRelayFeeSwapExceeded, InvalidEdgeDataStreamDecimals, InsufficientBridgeOutputAmount to CustomErrors ABI so reverts decode - Add positionValueInUsd to Position type and populate it from the v2.2c Reader positionInfo tuple in usePositions and SDK positions module
…2c-contracts # Conflicts: # sdk/src/configs/api.ts # src/components/TradeBox/hooks/useTradeboxTransactions.tsx # src/components/TradeHistory/keys.ts # src/config/indexers.ts # src/domain/synthetics/orders/simulation.ts # src/domain/synthetics/positions/usePositions.ts # src/locales/de/messages.po # src/locales/en/messages.po # src/locales/es/messages.po # src/locales/fr/messages.po # src/locales/ja/messages.po # src/locales/ko/messages.po # src/locales/pseudo/messages.po # src/locales/ru/messages.po # src/locales/zh-tw/messages.po # src/locales/zh/messages.po # vite.config.ts
…ugh SimulationRouter - Update 6 MegaEth addresses redeployed in 2.2c phase 1+2: MultichainOrderRouter, MultichainGlvRouter, MultichainGmRouter, MultichainTransferRouter, LayerZeroProvider, ClaimHandler - Route simulateExecuteLatestJitOrder through SimulationRouter (v2.2c moves the method off ExchangeRouter)
…2c-contracts # Conflicts: # src/config/indexers.ts
# Conflicts: # sdk/src/utils/balances/api.ts # src/components/TradeHistory/TradeHistoryRow/utils/position.ts # src/components/TradeHistory/TradeHistoryRow/utils/swap.ts # src/config/indexers.ts # src/domain/synthetics/subaccount/utils.ts # src/domain/utm/index.ts # src/locales/de/messages.po # src/locales/en/messages.po # src/locales/es/messages.po # src/locales/fr/messages.po # src/locales/ja/messages.po # src/locales/ko/messages.po # src/locales/pseudo/messages.po # src/locales/ru/messages.po # src/locales/zh-tw/messages.po # src/locales/zh/messages.po
…ed error structure; updated parseGetOrdersResponse to include uiFeeFactor in the response type.
Refactor CustomErrors: removed unused error definitions and streamlin…
createTwapOrder is only available on ExchangeRouter and the Gelato/Subaccount relay routers, not the multichain routers, so TWAP can't go through Express/1CT/multichain uniformly. Restore the previous buildTwapOrdersPayloads mechanism (TWAP as N batched limit orders) which works through batch on all routers, and drop the createTwapOrder usages (native order building, the twapParams batch field, and the express guard that excluded TWAP). Reverts FEDEV-3479.
Playwright Component Test ReportAll tests passed. Commit 8fc485d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: https://linear.app/gmx-io/issue/FEDEV-3309/update-interface-to-v22c-contracts