Skip to main content

API Overview

GMX exposes several integration points for developers, integrators, and AI agents building on the protocol. Start with the integration surface that matches your task instead of trying to use one API for everything.

For AI agent frameworks with pre-built trading skills, see AI Agents.

Available APIs

GMX offers four integration points depending on the type of data or action you need.

REST APIs

GMX provides two REST API generations. API v2 is under active development and will become the primary HTTP integration point.

API v1 — REST APIAPI v2 — OpenAPI Reference
Base URLsgmxinfra.iogmx-api-*.ondigitalocean.app
DataOracle prices, markets, liquidityMarkets, tickers, tokens, positions, orders, rates, APY, and performance
StatusStableExpanding — will become the primary HTTP API

Other integration points

  • Contracts — Interact directly with ExchangeRouter, Reader, and GlvReader contracts on-chain.
  • GraphQL — Historical on-chain data via Subsquid endpoints.

Start here

  • Integration guide — "I want to do X" workflows, cache and retry guidance, and when to use REST, GraphQL, or the SDK
  • Troubleshooting — What to do when reads look stale, validation fails, or write-path state does not appear yet
  • API v1 (REST API) — Manual docs for prices, markets, liquidity, and fallback URLs
  • API v2 (OpenAPI Reference) — Generated endpoint schemas for the current API v2 read surface

TypeScript SDK

The @gmx-io/sdk package provides a high-level TypeScript interface that wraps these APIs. It ships two clients: SDK v1 (GmxSdk) for full read/write access via RPC, and SDK v2 (GmxApiSdk) for lightweight read-only access over HTTP. The current SDK v2 surface covers markets, tickers, tokens, pairs, rates, APY, performance, positions, orders, and OHLCV. See the SDK docs for details.

The generated API v2 reference covers the current documented HTTP endpoints. SDK-specific convenience coverage such as fetchPairs() and fetchOhlcv() is documented in the SDK pages.

Supported networks

GMX V2 is deployed on the following networks.

  • Arbitrum One
  • Avalanche C-Chain
  • Botanix

Not every API surface is available on every deployed network. Check the specific REST, GraphQL, SDK, or generated API v2 page you plan to use before wiring a production integration.

For contract and API update announcements, see Updates and Support.

AI agent integration

GMX's oracle-based pricing and two-phase execution model make it well-suited for autonomous trading agents. For pre-built agent plugins that bundle SDK references, API endpoints, contract addresses, and order specifications, see the AI Agents section. This documentation site also generates LLM-friendly bundles at llms.txt and llms-full.txt for direct model consumption.