45e75b871a1576/docs/botanix-deployments.md)
| Contract | Address |
| --------------------- | -------------------------------------------- |
| DataStore | `0xA23B81a89Ab9D7D89fF8fc1b5d8508fB75Cc094d` |
| RoleStore | `0x51Aa17ca59E9e9C3cEc3c3c05c2B35f473b35D39` |
| Reader | `0x922766ca6234cD49A483b5ee8D86cA3590D0Fb0E` |
| ExchangeRouter | `0xBCB5eA3a84886Ce45FBBf09eBF0e883071cB2Dc8` |
| Router | `0x3d472afcd66F954Fe4909EEcDd5c940e9a99290c` |
| Oracle | `0x40d680E41FC4Bf973F0EA664981f6359195a6383` |
| OrderVault | `0xe52B3700D17B45dE9de7205DEe4685B4B9EC612D` |
| DepositVault | `0x4D12C3D3e750e051e87a2F3f7750fBd94767742c` |
| WithdrawalVault | `0x46BAeAEdbF90Ce46310173A04942e2B3B781Bf0e` |
| ShiftVault | `0xa7EE2737249e0099906cB079BCEe85f0bbd837d4` |
| OrderHandler | `0xBAD04dDcc5CC284A86493aFA75D2BEb970C72216` |
| DepositHandler | `0x839B6e19E54A5862da61974A01675a5f6CC5c8b4` |
| WithdrawalHandler | `0x5bB6DCb09010069228B2aA766FAE513EF7923472` |
| AdlHandler | `0xec0e4A27a9fbfc64e4915c254B961260df28054c` |
| LiquidationHandler | `0x1bC32eeCAa8F504D2225096649A0347153A37f10` |
| ShiftHandler | `0xAD712E1667bC8AAa6C4EA5f47dcD487ddd96BC35` |
| GlvHandler | `0xB75AdE19252A9db51ea861E9A39C80BB0D7aAd82` |
| GlvVault | `0xd336087512BeF8Df32AF605b492f452Fd6436CD8` |
| EventEmitter | `0xAf2E131d483cedE068e21a9228aD91E623a989C2` |
| MarketFactory | `0xcb7656751B0f8aFCBe15D135D7aC58727DE06768` |
| GlvRouter | `0xC92741F0a0D20A95529873cBB3480b1f8c228d9F` |
| GlvReader | `0x955Aa50d2ecCeffa59084BE5e875eb676FfAFa98` |
| SubaccountRouter | `0xa1793126B6Dc2f7F254a6c0E2F8013D2180C0D10` |
| Multicall3 | `0x4BaA24f93a657f0c1b4A0Ffc72B91011E35cA46b` |
| Config | `0x5a1344252f0CdfDB765DD5ab97C98734f1D7ED6d` |
| ConfigTimelockController | `0x3d6BA4a91Ffde7C519379F8dCA5FE58b7125c294` |
| GovTimelockController | `0x610701662CD64De835d53B2dE508d342781CC1Bd` |
| Timelock | `0xca3e30b51A7c3bd40bFc52a61AB0cE57B3Ab3ad8` |
| TimelockConfig | `0x72a30e76827Ce83cEf0b1BEd7e9aAF9F4a576990` |
#### Multichain contracts (Botanix)
| Contract | Address |
| -------------------------- | -------------------------------------------- |
| MultichainOrderRouter | `0xbC074fF8b85f9b66884E1EdDcE3410fde96bd798` |
| MultichainGmRouter | `0x6a960F397eB8F2300F9FfA746F11375A613C5027` |
| MultichainGlvRouter | `0x9C11DFa4DAFA9227Ef172cc1d87D4D5008804C47` |
| MultichainClaimsRouter | `0x421eB756B8f887f036e7332801288BC2bbA600aC` |
| MultichainTransferRouter | `0x844D38f2c3875b8351feB4764718E1c64bD55c46` |
| MultichainSubaccountRouter | `0x8138Ce254Bc0AfE40369FDC2D1e46cE90944406d` |
| MultichainReader | `0x9511FAb77C8d7Acf56c9D8AE9278Cd3bd8Bd9D5c` |
| MultichainVault | `0x9a535f9343434D96c4a39fF1d90cC685A4F6Fb20` |
#### Relay and oracle provider contracts (Botanix)
| Contract | Address |
| --------------------------- | -------------------------------------------- |
| GelatoRelayRouter | `0x98e86155abf8bCbA566b4a909be8cF4e3F227FAf` |
| SubaccountGelatoRelayRouter | `0xd6b16f5ceE328310B1cf6d8C0401C23dCd3c40d4` |
| ChainlinkDataStreamProvider | `0x1A4D623301b9f58405d3Fff7a63624411d5eb940` |
| ChainlinkPriceFeedProvider | `0xDc613305e9267f0770072dEaB8c03162e0554b2d` |
| EdgeDataStreamProvider | `0x02E209c2c47956e4E2934A7516d81e86d88A5Dbc` |
| LayerZeroProvider | `0x9E721ef9b908B4814Aa18502692E4c5666d1942e` |
### MegaETH (Chain ID: 4326)
Explorer: [megaeth.blockscout.com](https://megaeth.blockscout.com) | [Full deployment list](https://github.com/gmx-io/gmx-synthetics/blob/bf30ebb4cff17b7f92f8c738f145e75b871a1576/docs/megaEth-deployments.md)
| Contract | Address |
| --------------------- | -------------------------------------------- |
| DataStore | `0xE43C7B694f6b652a9F4A0f275C008d18758Dce35` |
| RoleStore | `0xecA46636BDDbb4F451ca2B7062C7E36744934655` |
| Reader | `0x51fe0b7919e1208a717E9B16a097C1C3D70eFbf6` |
| ExchangeRouter | `0xF68560cA917717639be497BF6283aC08C9Bf0264` |
| SimulationRouter | `0x321EB66dD95ad33715ee615AAb8dAC6394E7b3F9` |
| Router | `0x1eAfB14236C489C28845EC04F78DECA5Fb9879Aa` |
| Oracle | `0xfD0596f708d9D950E0eF7b5d191e5F8e55b8a67f` |
| OrderVault | `0xD5AE04762E2afb1506695b3F36286EBE7B0E6772` |
| DepositVault | `0x8231A60862F9b0bA93fFA050c0E94AC902D901d2` |
| WithdrawalVault | `0x0Ec53dda9676219dE63eC703212219b07811F33C` |
| ShiftVault | `0xC255c70b50623054CADbAD9A02E1CFE73d286666` |
| OrderHandler | `0x2fFbC877Bd50c7A1c27887F012dba6469a7092F2` |
| DepositHandler | `0x2dC2315039bf3617e815969c613428F36e9Baf98` |
| WithdrawalHandler | `0xC993eF170859DAE0241a3c12B8186e456Fa1c1B0` |
| AdlHandler | `0x882f5b61Fb61a060857065FC4AB420C96aa7A467` |
| LiquidationHandler | `0x4421E804896Caa8383e7239D87637eb4644BF40E` |
| ShiftHandler | `0xd4F6C2332b36D1Ccb22C7ac479b270fa0cA26a41` |
| GlvVault | `0x52e4875EB5603d21912d30A1dBA6B0B97192459A` |
| EventEmitter | `0xAf2E131d483cedE068e21a9228aD91E623a989C2` |
| MarketFactory | `0x5Fb9121Ca153B93dD70ae53280Dc3b64E1805940` |
| GlvRouter | `0xef1BA2A3fcf0244361d63FCAe0c4772586Cd1925` |
| GlvReader | `0x804f206a2ec78F505FD5D397450EAB9E7CBD1b21` |
| SubaccountRouter | `0x03B59961bF30b973fBd793A6C8ad57dA38D4D0a6` |
| Multicall3 | `0xF516BC01c50eebdBad4d7E506c8f690ae8EAFc52` |
| Config | `0x5aDD4cD559424941C3d06B66c5eD71dAc7261986` |
| ConfigTimelockController | `0xCb60d0A8372Cb8f8a074d304F88bA851FC5E8e29` |
| GovTimelockController | `0x0a42516de743D87572f5788cac23F0a2c1a39f69` |
| TimelockConfig | `0x1eAa0E46a40CB7D6F656193d053493658548114e` |
#### Multichain contracts (MegaETH)
| Contract | Address |
| -------------------------- | -------------------------------------------- |
| MultichainOrderRouter | `0x00205f26BCc52537D12fA9b0eFA5Fcc58F03ab76` |
| MultichainGmRouter | `0x5CCD0b91Cfe6B0FBA1c98290dc39E71ff806d9bF` |
| MultichainGlvRouter | `0x5F65a3B91923840cD5254489A57c873427bA3A91` |
| MultichainClaimsRouter | `0x6614E9eAfE2FE583049333C03a2D6f9D7F252121` |
| MultichainTransferRouter | `0x62B1691B067278E5B1167d0443d4c957473611D2` |
| MultichainSubaccountRouter | `0xDB8906520812840b9835E3B84dE62C826249e20B` |
| MultichainReader | `0x7664Aa3F9609C614bf161B0805375CbDd3Ddb418` |
| MultichainVault | `0xd6922E889cE4CF14e59427F20e7d857ff81A5A9D` |
#### Relay and oracle provider contracts (MegaETH)
| Contract | Address |
| --------------------------- | -------------------------------------------- |
| GelatoRelayRouter | `0xbAAA3a693191e2e3E0973DE641C879D1aDD84e04` |
| SubaccountGelatoRelayRouter | `0x603B3D3aB077CA433b888c05fa59c777d5b6dCAD` |
| ChainlinkDataStreamProvider | `0x118510dD4bbB6a18863EfAA1867D4a7Ae3756c8d` |
| ChainlinkPriceFeedProvider | `0xaD3051cB1aE3a86b335f12A9a41BD4d995a137ea` |
| EdgeDataStreamProvider | `0x206B582F309724dAd259058Bc3289Ca3519F34B1` |
| StaticOracleProvider | `0x9c05880A2AaD7530c69e18e342eDC9E06cc757db` |
| LayerZeroProvider | `0x8A959d38216ad67AEBBF31F46Cb3cA4D7fe584c8` |
## Testnet
Testnet contracts are redeployed more frequently than mainnet. Verify addresses before integrating. Arbitrum Sepolia is usually the most current testnet, but Avalanche Fuji deployment artifacts are also published in the `updates` branch.
### Arbitrum Sepolia (Chain ID: 421614)
Explorer: [sepolia.arbiscan.io](https://sepolia.arbiscan.io) | [Full deployment list](https://github.com/gmx-io/gmx-synthetics/blob/bf30ebb4cff17b7f92f8c738f145e75b871a1576/docs/arbitrumSepolia-deployments.md)
The Arbitrum Sepolia deployment is the most current testnet. For a frontend that connects to testnet, see [Testnet frontend](../frontend-integration.md#testnet-frontend).
| Contract | Address |
| ------------------------ | -------------------------------------------- |
| DataStore | `0xCF4c2C4c53157BcC01A596e3788fFF69cBBCD201` |
| RoleStore | `0x433E3C47885b929aEcE4149E3c835E565a20D95c` |
| Reader | `0x92659fEf40582ceCC3CBa4D096d28291C238D358` |
| ExchangeRouter | `0x6B489dD5bB1AAE8df246359d59aA7316760a75d2` |
| SimulationRouter | `0x82f1bb43b7E93dE4c38EC3198ed13e33D0904555` |
| Router | `0x72F13a44C8ba16a678CAD549F17bc9e06d2B8bD2` |
| Oracle | `0x0dC4e24C63C24fE898Dda574C962Ba7Fbb146964` |
| StaticOracleProvider | `0xC2619263f91f53C2acc72f79E87Feaa82Ac7FdF6` |
| OrderVault | `0x1b8AC606de71686fd2a1AEDEcb6E0EFba28909a2` |
| DepositVault | `0x809Ea82C394beB993c2b6B0d73b8FD07ab92DE5A` |
| WithdrawalVault | `0x7601c9dBbDCf1f5ED1E7Adba4EFd9f2cADa037A5` |
| ShiftVault | `0x6b6F9B7B9a6b69942DAE74FB95E694ec277117af` |
| OrderHandler | `0xC881c2391611829d7bc81c12a285cB0201F08f8c` |
| DepositHandler | `0xa9cf0cF995eFD4aDF5CE93A36fce1A6CD9eEE070` |
| WithdrawalHandler | `0xb6c9217D582a6Bd0A149943f995a0855f7ee0ED3` |
| AdlHandler | `0xF7BcBA3A2907db79b37e93BD48e76D5509521093` |
| LiquidationHandler | `0xC1C5A1Da634398154B5134Ce1317d365CB0db3CD` |
| ShiftHandler | `0xfc36c7aA0Ab3EEa2f7b2759a416B77F8a850f8F8` |
| GlvVault | `0x40bD50de0977c68ecB958ED4A065E14E1091ce64` |
| EventEmitter | `0xa973c2692C1556E1a3d478e745e9a75624AEDc73` |
| MarketFactory | `0x1934838E3d85416A6cF5bF7A5E619f12BE01C4b2` |
| GlvRouter | `0x792D48B94F430965FE85645cF72527b3343d4BdD` |
| GlvReader | `0x45356cEE7f8668b7030577c13b4638802D3397Df` |
| SubaccountRouter | `0xAFdD3e0B6c162974594AcA157eA642B8847CC5b1` |
| Multicall3 | `0xD84793ae65842fFac5C20Ab8eaBD699ea1FC79F3` |
| Config | `0x2c76c5f86032e45B32A1Af9FDB1cC80aE157c58f` |
| ConfigTimelockController | `0x08a24334C21413Fcdf885a7cD933b6c7E7675C60` |
| GovTimelockController | `0xb1854C5CfB3D25be6198972d5c3AEa0592e933a4` |
| TimelockConfig | `0x09D240e8833Ae0C3C40748103b626139bC1761cD` |
### Avalanche Fuji (Chain ID: 43113)
Explorer: [testnet.snowtrace.io](https://testnet.snowtrace.io) | [Full deployment list](https://github.com/gmx-io/gmx-synthetics/blob/bf30ebb4cff17b7f92f8c738f145e75b871a1576/docs/avalancheFuji-deployments.md)
| Contract | Address |
| ------------------------ | -------------------------------------------- |
| DataStore | `0xEA1BFb4Ea9A412dCCd63454AbC127431eBB0F0d4` |
| RoleStore | `0x19a8085537078e7847a332A76ABaDD5b02B1e736` |
| Reader | `0xf82Cc6EB57F8FF86bc5c5e90B8BA83DbBFB517eE` |
| ExchangeRouter | `0x0a458C96Ac0B2a130DA4BdF1aAdD4cb7Be036d11` |
| Router | `0x5e7d61e4C52123ADF651961e4833aCc349b61491` |
| Oracle | `0xae7c79ED2807Fe544f5757890ca8afB9d553f17c` |
| OrderVault | `0x25D23e8E655727F2687CC808BB9589525A6F599B` |
| DepositVault | `0x2964d242233036C8BDC1ADC795bB4DeA6fb929f2` |
| WithdrawalVault | `0x74d49B6A630Bf519bDb6E4efc4354C420418A6A2` |
| ShiftVault | `0x257D0EA0B040E2Cd1D456fB4C66d7814102aD346` |
| OrderHandler | `0xb525036363BC44695d36fD56Bcb86CEF39cd444A` |
| DepositHandler | `0x12383b2AB771471003185a83cf983c98A826bD4E` |
| WithdrawalHandler | `0xe80Fea80cA767a105A65D67bFA970ecF1B4e9127` |
| AdlHandler | `0x96b2004d52d30b21385E6757b1EEbd1565864f6A` |
| LiquidationHandler | `0x4092cC8E8dC0893f93f35f5998585a6109d91a46` |
| ShiftHandler | `0xd96Eb278505EF101B3a1328636DFb2F215Bb6bA5` |
| GlvVault | `0x76f93b5240DF811a3fc32bEDd58daA5784e46C96` |
| EventEmitter | `0xc67D98AC5803aFD776958622CeEE332A0B2CabB9` |
| MarketFactory | `0x89810f23585FDCfAFfB1712e5B76d9b0F722e1d6` |
| GlvRouter | `0x6B6595389A0196F882C0f66CB1F401f1D24afEdC` |
| GlvReader | `0xdeaC9ea3c72C102f2a9654b8E1A14Ef86Cdd3146` |
| SubaccountRouter | `0xD5EE3ECAF5754CE5Ff74847d0caf094EBB12ed5e` |
| Multicall3 | `0x966D1F5c54a714C6443205F0Ec49eEF81F10fdfD` |
| Config | `0x63725E32b05324042Fe78C34be3E72497C91e1E0` |
| ConfigTimelockController | `0xc120bD6756171691fC2e2D5EE876ae79526412c1` |
| GovTimelockController | `0x8beF3F7f3B2d8b8490Cf30b42c728293D1C2a9Ef` |
| Timelock | `0x0f0c78405A4E6dAfc188d539D61C69D74f42f9dB` |
| TimelockConfig | `0xa2c59bf9999915C2DF87998739c2e3Efa9c856f4` |
:::note
Testnet deployments may include additional test contracts (`MockPriceFeed`, test tokens) not present on mainnet. See the full deployment list linked above for all testnet contracts.
:::
## Contract categories
The sections below describe the purpose of each contract category listed in the address tables.
### Multichain contracts
The `Multichain*` contracts enable cross-chain operations through the [GMX Account](../../trading/overview.md#gmx-account-multichain) system. They let users on one chain submit orders, manage positions, and transfer funds to GMX deployments on other chains via LayerZero messaging.
| Contract | Purpose |
| -------------------------- | --------------------------------------------------------- |
| MultichainOrderRouter | Routes cross-chain order creation requests |
| MultichainGmRouter | Routes cross-chain GM token deposit/withdrawal requests |
| MultichainGlvRouter | Routes cross-chain GLV deposit/withdrawal requests |
| MultichainClaimsRouter | Routes cross-chain claim requests (funding fees, rebates) |
| MultichainTransferRouter | Routes cross-chain token transfers |
| MultichainSubaccountRouter | Routes cross-chain subaccount operations |
| MultichainReader | Reads cross-chain state and pending operations |
| MultichainVault | Holds funds in transit during cross-chain operations |
### Gelato relay contracts
The `GelatoRelayRouter` and `SubaccountGelatoRelayRouter` contracts accept signed relay-router calls for gasless submission. GMX Relay, GMX's self-hosted relay, is the off-chain submitter. GMX no longer uses Gelato Relay. The contracts keep their deployed `Gelato` names and addresses because the on-chain relay logic doesn't depend on Gelato. These contracts power Express Trading.
| Contract | Purpose |
| --------------------------- | ------------------------------------------------ |
| GelatoRelayRouter | Accepts relay requests for standard operations |
| SubaccountGelatoRelayRouter | Accepts relay requests for subaccount operations |
### Oracle provider contracts
Multiple oracle providers feed price data into the protocol. The `Oracle` contract aggregates prices from these providers, selecting the most appropriate source for each token.
| Contract | Purpose |
| --------------------------- | --------------------------------------------------------------------------- |
| ChainlinkDataStreamProvider | Fetches prices from Chainlink Data Streams (primary source for most tokens) |
| ChainlinkPriceFeedProvider | Fetches prices from Chainlink Price Feeds (fallback and reference) |
| EdgeDataStreamProvider | Fetches prices from Edge oracle data streams |
| StaticOracleProvider | Returns stored static minimum and maximum prices configured for a token |
### Governance and configuration contracts
The governance and configuration contracts control protocol parameters. Most parameter changes flow through the `Config` contract, which is gated by the `ConfigTimelockController` to enforce a delay before changes take effect. `RiskOracleConfig` provides a separate role-gated path for a fixed allowlist of risk parameters, and only for markets that a config keeper has enabled for the risk oracle. Higher-level governance actions are managed through `GovTimelockController` and `Timelock`.
| Contract | Purpose |
| ------------------------ | ----------------------------------------------------------------------- |
| Config | Applies parameter changes to the protocol through the timelock system |
| ConfigTimelockController | Enforces time delays on configuration updates submitted via Config |
| RiskOracleConfig | Applies allowlisted risk-parameter updates to enabled markets |
| GovTimelockController | Controls governance-level actions with time-delayed execution |
| Timelock | Manages protocol upgrades, role assignments, and privileged operations |
| TimelockConfig | Stores timelock duration settings for different operation categories |
### Cross-chain messaging
| Contract | Purpose |
| ----------------- | ------------------------------------------------- |
| LayerZeroProvider | Handles cross-chain message and data verification |
---
## Advanced entry points
This page covers the contract surfaces beyond the core `ExchangeRouter` / `GlvRouter` flow: delegated subaccount trading, gasless relay routers, and multichain GMX Account routers. Some of these are end-user or integrator entry points, while others are specialized router or controller surfaces.
If you need an end-to-end implementation pattern for delegated trader flows rather than just the raw contract surface, see [Delegated trading integration](./delegated-trading.md).
For the core request lifecycle, see [Architecture](./architecture.md). For standard GM and GLV actions, see [ExchangeRouter](./exchange-router.md) and [GlvRouter](./glv-router.md).
## SubaccountRouter
`SubaccountRouter` is a legacy contract that is still deployed but no longer used for order operations. The current GMX interface only calls it for wallet-based subaccount removal outside the express flow. New integrations should use `SubaccountGelatoRelayRouter` for delegated order execution.
The contract originally let a main account delegate order management to a subaccount without giving that subaccount full custody of the account.
### Management functions
| Function | Purpose |
| --- | --- |
| `addSubaccount(address subaccount)` | Authorize a delegated subaccount |
| `removeSubaccount(address subaccount)` | Remove a delegated subaccount |
| `setSubaccountExpiresAt(address subaccount, bytes32 actionType, uint256 expiresAt)` | Set an expiry timestamp for a delegated action type |
| `setMaxAllowedSubaccountActionCount(address subaccount, bytes32 actionType, uint256 maxAllowedCount)` | Cap how many actions a subaccount can perform |
| `setSubaccountAutoTopUpAmount(address subaccount, uint256 amount)` | Configure automatic native-token top-ups for the subaccount |
| `setIntegrationId(address subaccount, bytes32 integrationId)` | Bind the subaccount to an integration identifier |
### Order functions
`SubaccountRouter` only exposes delegated order actions:
| Function | Purpose |
| --- | --- |
| `createOrder(address account, CreateOrderParams params)` | Create an order for the main account |
| `updateOrder(bytes32 key, ...)` | Update a pending order |
| `cancelOrder(bytes32 key)` | Cancel a pending order |
### Integration notes
- Subaccount order actions are gated by `Keys.SUBACCOUNT_ORDER_ACTION`.
- The router validates the main account's integration id before handling the action.
- For swap and increase orders, the router transfers the main account's collateral into `OrderVault` through the core `Router` plugin mechanism.
- Auto top-up uses the main account's WNT allowance and balance, then unwraps native token to the subaccount. The top-up amount is capped to the native tokens actually spent on gas plus execution fee.
For the exact implementation, see [`SubaccountRouter.sol`](https://github.com/gmx-io/gmx-synthetics/blob/updates/contracts/router/SubaccountRouter.sol).
## Gelato relay routers
GMX exposes two relay entry points for gasless order management. GMX Relay, GMX's self-hosted relay, submits the signed calls on-chain. The routers keep their `Gelato` contract names but don't depend on Gelato: any submitter that isn't Gelato's forwarder takes the sponsored-call path, where the contract computes the relay fee and pays it in WNT to `RELAY_FEE_ADDRESS`.
| Contract | Purpose |
| --- | --- |
| `GelatoRelayRouter` | Gasless create / update / cancel / batch order flow for the main account |
| `SubaccountGelatoRelayRouter` | Gasless delegated order flow for subaccounts, plus `removeSubaccount` |
### Supported actions
| Function | `GelatoRelayRouter` | `SubaccountGelatoRelayRouter` |
| --- | --- | --- |
| `batch(...)` | Yes | Yes |
| `createOrder(...)` | Yes | Yes |
| `createTwapOrder(...)` | Yes | Yes |
| `updateOrder(...)` | Yes | Yes |
| `cancelOrder(...)` | Yes | Yes |
| `removeSubaccount(...)` | No | Yes |
### RelayParams structure
Relay calls share the `IRelayUtils.RelayParams` envelope:
- `oracleParams`: optional oracle data for GMX-based fee swaps
- `externalCalls`: optional external swap / call bundle
- `tokenPermits`: optional EIP-2612 permits
- `fee`: `feeToken`, `feeAmount`, and optional `feeSwapPath`
- `userNonce`: replay-protection nonce chosen by the user
프로젝트로 돌아가기