📄️ Overview
Docs for the GMX contracts. This section focuses on the contracts most integrations interact with directly, not an exhaustive page for every deployed contract.
📄️ Architecture
This page covers the GMX smart contract architecture, execution model, keeper network, and integration considerations. For contract function references, see Reader, ExchangeRouter, and GLV Reader.
📄️ ExchangeRouter
The ExchangeRouter contract exposes the main protocol functions for creating orders, deposits, and withdrawals.
📄️ Reader
The Reader contract provides convenience functions for retrieving information such as markets, positions, and pricing data.
📄️ GlvReader
The GlvReader contract provides read-only functions for querying GMX Liquidity Vault (GLV) data from on-chain storage.
📄️ GlvRouter
The GlvRouter contract is the main entry point for creating and cancelling GLV (GMX Liquidity Vault) deposits and withdrawals. It works similarly to the ExchangeRouter but targets GLV vaults instead of individual GM markets.
📄️ Fees
This page documents fee types, execution fee calculation, and how to retrieve fee parameters from the DataStore.
📄️ Simulations
The ExchangeRouter and GlvRouter contracts expose public simulation functions that let you dry-run an execution against a set of supplied prices before submitting a real request for keeper execution. Running a simulation catches validation errors — such as price impact limits or insufficient output amounts — without spending gas on a failed transaction.
📄️ Event monitoring
All protocol events are emitted through a single EventEmitter contract. Every event carries an eventName field, so you can monitor any protocol action by filtering on the EventEmitter address plus the eventName value — without needing to track individual logic contract addresses, which may be upgraded over time.
📄️ 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.
📄️ Contract addresses
This page lists the key contract addresses for each supported chain. For the complete list of all deployed contracts (100+ per chain), see the gmx-synthetics deployments folder. The machine-readable contracts.json in that folder covers mainnet deployments, while testnet deployments are published in the per-network markdown files.
📄️ Known issues
This page is based on the known issues section of the gmx-synthetics repository, with corrections and additions. It is intended for integrators, auditors, and developers building on top of the GMX contracts.