GMX API
This module contains GMX support for Python.
# Functionality
The functions connect directly to JSON-RPC instance and interact with GMX smart contracts
Open and close GMX positions
Read historical and current market data, including onchain data like open interest and volume
Tutorials
What Is GMX?
GMX is a perpetual future (“perp”) DEX for EVM blockchains.
GMX offers dozens of perp trading pairs for popular cryptocurrencies like BTC, ETH and SOL. GMX is so-called pure onchain market with high degree of decentralisation. Thus, GMX has high composability with other decentralised finance protocols. This allows users longing and shorting different asset prices with leverage onchain.
GMX is one of the oldest pure onchain perpetual future market places still running. GMX mainly operates on Arbitrum, but has expanded to include cross-chain functionality. GMX saw a hacking incident in July 2025 from which it recovered.
GMX has its own pools for market making where pools users can provide liquidity and take the other side of the trade. There are GLP vaults in GMX v2 and older GLP vaults in GMX v1. GLV is the index pool of GMX’s markets, rebalancing liquidity to its best-performing GM pools and generating fees from them. As a result, GLV offers liquidity providers a balanced instrument with stable risk-adjusted returns and high capital efficiency.
There are multiple third-party DeFi vaults built on the top of GMX, like Umami’s GM vaults following ERC-4626 standard.
GMX price formation relies on its multi-asset liquidity pool (GLP) and a “virtual” AMM (vAMM) model that uses Chainlink oracles for price data instead of a traditional order book. When users trade, the vAMM calculates the price based on the ratio of assets in the GLP pool, and price feeds from Chainlink ensure accurate pricing for fixed-price trades.
Unlike standard AMMs, GMX’s vAMM shifts risk to liquidity providers (LPs) in the GLP pool, with traders paying a fee that is split between the GMX token holders and the GLP LPs.
More info
GMX API Module |
|
GMX Core Module |
|
GMX Configuration Module. |
|
GMX Constants Module |
|
GMX Protocol Contract Infrastructure |
|
GMX Market Data Module |
|
GMX event log decoding and parsing. |
|
GMX Gas Utilities |
|
GMX Protocol Key Generation Functions |
|
GMX Order Module |
|
GMX API Retry and Failover Logic |
|
GMX Synthetic token details fetching and caching. |
|
GMX Trading Module |
|
GMX protocol type definitions. |
|
GMX Utilities Module. |