GMX Liquidity Skill
Overview
GMX V2 has two liquidity layers that back perpetual and spot trading:
- GM Pools — Single-market liquidity pools. Each GM pool backs one market (e.g., ETH/USD) and is composed of a long token and short token. Depositing mints GM tokens (LP tokens); withdrawing burns them.
- GLV Vaults (GMX Liquidity Vaults) — Multi-market vaults that hold multiple GM tokens and auto-rebalance across constituent pools. Depositing mints GLV tokens; withdrawing burns them.
Supported chains:
| Chain | Chain ID | Native Token | GLV Vaults |
|-------|----------|-------------|------------|
| Arbitrum | 42161 | ETH | Yes |
| Avalanche | 43114 | AVAX | Yes |
| Botanix | 3637 | BTC | No (contracts deployed, no vaults configured) |
Execution model: All write operations use a two-step async pattern:
- User creates a request (deposit/withdrawal/shift) via
ExchangeRouterorGlvRoutermulticall - Keeper executes the request with oracle prices (typically 1–30 seconds later)
The user pays an execution fee (in native token) upfront to cover keeper gas costs. Excess fee is refunded.
Integration paths:
- SDK (
@gmx-io/sdk) — Read pool data, balances, and market info. Write operations (deposit/withdraw) are not yet in the SDK. - Contract-level (viem) — Full read + write via
ExchangeRouter.multicall()andGlvRouter.multicall().
This skill complements gmx-trading which covers perpetual trading and swaps.
GM Pools
Each GM pool is a pair of tokens backing a specific market:
- Long token — The asset (e.g., WETH for ETH/USD)
- Short token — The stablecoin (e.g., USDC)
- GM token — The LP token representing a share of the pool
Deposits can be:
- Balanced — Deposit both long and short tokens proportionally. Lower fees (helps balance the pool).
- Single-sided — Deposit only one token. The protocol swaps a portion internally. Higher fees if it imbalances the pool.
Withdrawals burn GM tokens and return the underlying long and short tokens. A withdrawal can specify minLongTokenAmount and minShortTokenAmount for slippage protection.
Pricing: GM token price = pool value / GM token supply. Pool value is the sum of long and short token values at oracle prices plus accrued PnL.
GM pool addresses are dynamic — discover them via sdk.markets.getMarkets().
GLV Vaults
GLV vaults hold multiple GM tokens and auto-rebalance across markets: