GaiaExGaiaEx
API

GaiaEx API Platform Overview

What is GaiaEx, our non-custodial architecture, supported markets, and how the clearinghouse model works for traders.

Start Trading in Four Steps

Everything you need to go from zero to a live order via the API.

  1. Download the GaiaEx mobile app — iOS or Android.
  2. Open an account — one tap. Account setup and the EIP-712 wallet handshake happen in-app; no paperwork, no waiting. This step is required once and cannot be completed via the API.
  3. Deposit collateral:
    • USDC margin: fund your USDC balance from the GaiaEx app. Minimum 5 USDC. Funds are credited in 1–5 minutes.
    • USDT margin: fund your USDT balance from the GaiaEx app. USDC and USDT are independent margin balances.
  4. Create an API key — Settings → API Keys → Create. This step requires a passkey step-up in the app and cannot be automated via the REST API (bots cannot self-issue keys). Give the key read + trade permission. Copy the api_key and api_secret into a config.json file next to your script:
{
  "api_key":      "your_api_key_here",
  "api_secret":   "your_api_secret_here",
  "user_address": "0xYourWalletAddress"
}

That's it — you're trading-ready. The snippet below authenticates and fetches your USDC Perps balance. If it returns a number, you can place your first order (see Quick Start).

import hmac, hashlib, time, json, requests

cfg = json.load(open("config.json"))
ts  = str(int(time.time() * 1000))
path = f"/user/{cfg['user_address']}/balance"
sig  = hmac.new(cfg["api_secret"].encode(), (ts + "GET" + path).encode(), hashlib.sha256).hexdigest()

r = requests.get(
    f"https://openapi.gaiaex.com/v1/trade{path}",
    headers={
        "X-GAIAEX-APIKEY":    cfg["api_key"],
        "X-GAIAEX-TIMESTAMP": ts,
        "X-GAIAEX-SIGNATURE": sig,
    },
)
print(r.json())

WHY config.json?

Every example in these docs loads credentials from config.json. Rotate your API key by editing one file — your code never changes and never contains a literal secret.

What is GaiaEx

GaiaEx is a self-custody derivatives DEX offering USDC-margined and USDT-margined perpetuals from a single API. GaiaEx supports ~217 tradable instruments (167 perpetuals + up to 50 spot) across crypto, real-world assets (equities, commodities, forex), venture tokens, and spot markets.

All positions settle on-chain; GaiaEx never takes custody of your collateral.

Why no chain names?

GaiaEx uses embedded MPC wallets (Wallet-as-a-Service). Chain selection, deposit routing, and settlement are handled automatically by the platform. The API operates at the instrument level — chain mechanics are not part of the integration surface.

CapabilityDescription
USDC Perps102 crypto symbols (+31 RWA/venture), up to 40x leverage, USDC margin
USDT Perps34 symbols (crypto + commodities), up to 200x leverage, USDT margin
RWA & Venture Perps31 symbols — equities, commodities, forex (xyz: prefix), cash indices (cash: prefix), and venture tokens (vntl: prefix), USDC margin
Spot Markets50 pairs, USDC settlement, TOKEN/USDC format
Non-CustodialUser's embedded wallet (Privy MPC) signs the EIP-712 onboarding handshake once; the resulting agent key is scoped to trading only (canWithdraw=false) and stored encrypted server-side

How Self-Custody Works

When you first open the GaiaEx app, you sign a one-time EIP-712 structured-data message with your embedded wallet. This authorizes GaiaEx to derive an agent key — a narrowly scoped key that can submit and cancel orders on your behalf but cannot move collateral. All on-chain order settlement happens under this agent key. Your main wallet retains full custody; the agent key cannot withdraw funds.

GaiaEx routes your order to the correct margin product based on the symbol you pass — no manual switching required.

Margin Products & Symbol Routing

GaiaEx offers two independent margin products. Each has its own order book and margin pool. From the API's perspective you interact with both through the same endpoint patterns — the correct product is selected automatically based on the symbol you pass.

Symbol patternExampleProductMarginMax leverage
bare ticker / -USDCBTC, BTC-USDCUSDC PerpUSDCup to 40x
-USDT suffixBTC-USDTUSDT PerpUSDTup to 200x
xyz: / cash: / vntl:xyz:GOLD, cash:USA500, vntl:OPENAIRWA / venture perpUSDCvaries
TICKER/USDCBTC/USDCSpotUSDCn/a

Separate Margin Accounts

Your USDC balance and USDT balance are completely independent. Your USDC balance and USDT balance are completely independent margin accounts. When querying balances, the response reflects the account for whichever product the queried symbol belongs to — or you can query each account separately.

Withdrawal Paths

Withdrawals are initiated from the GaiaEx app (not available via API keys) and use an EIP-712 signature from the user's main wallet:

  • USDC balance — withdraw USDC from the GaiaEx app
  • USDT balance — withdraw USDT from the GaiaEx app

No manual switching

You never need to "select" a margin product in the API. Pass the symbol — the backend does the rest. Two margin products means two separate margin pools; plan your collateral deposits accordingly.

API Overview

The GaiaEx API exposes the full trading platform through a REST API and real-time WebSocket streams.

InterfaceBase URLPurpose
REST APIhttps://openapi.gaiaex.com/v1/tradeTrading, account management, market data
WebSocketwss://openapi.gaiaex.comReal-time order books, user data, wallet updates
WebSocket (dedicated)wss://ws.gaiaex.comSame streams, shorter URL paths

Two Account Namespaces

Because GaiaEx has two margin products, account endpoints (balance, positions, open orders, fills, funding history) return data for one product at a time. The product is inferred from the symbol you pass — or, for balance queries without a symbol, from the market parameter where supported. USDC Perps and USDT Perps accounts have separate margin, separate balance, and separate position state. The endpoint URL pattern is identical for both; only the symbol prefix differs.

Authentication

Two methods are supported — choose based on your use case:

MethodBest ForMechanism
API Key + HMAC-SHA256Bots, automated tradingThree custom headers per request (X-GAIAEX-APIKEY, X-GAIAEX-TIMESTAMP, X-GAIAEX-SIGNATURE)
Bearer Session TokenMobile app, web appAuthorization: Bearer <token> — issued after EIP-712 wallet handshake in-app

Public market data endpoints require no authentication.

API KEY CREATION IS APP-ONLY

The POST /api-keys endpoint requires a passkey step-up — a biometric or hardware-key confirmation inside the GaiaEx mobile app. This means bots and scripts cannot self-issue API keys. Keys must be created manually in the app (Settings → API Keys) and then used programmatically.

What You Can Build

  • Trading bots — place, cancel, and modify orders across both USDC Perps and USDT Perps; set leverage and TP/SL
  • Portfolio dashboards — stream positions, balances, PnL, and funding history in real time
  • Market data feeds — subscribe to order book updates, candles, and ticker data
  • Risk management tools — query liquidation prices, margin usage, and position history
  • Wallet read integrations — portfolio tracking and swap-route previews (read-only; quote endpoints return prices and routes for display)

Scope of the API

The REST API covers trading, account reads, referral, and read-only wallet data. Funding (deposits and withdrawals), on-chain transfers, swaps, account setup (EIP-712 handshake), passkey registration, and API key creation happen in the GaiaEx mobile app using the user's embedded wallet — they are not callable via API key.

Supported Markets

USDC Perps

Perpetual futures margined in USDC. 102 crypto symbols available, up to 40x leverage. Symbols use plain uppercase tickers for crypto and prefixed tickers for RWA and venture products:

Asset ClassPrefixExamplesMargin
Crypto perps(none, or -USDC suffix)BTC, ETH, SOL, BTC-USDCUSDC
Equities, Commodities, Forex (RWA)xyz:xyz:AAPL, xyz:TSLA, xyz:GOLD, xyz:EURUSDC
Cash Indicescash:cash:USA500, cash:NAS100USDC
Venture Token Perpsvntl:vntl:OPENAI, vntl:ANTHROPICUSDC

USDT Perps

Perpetual futures margined in USDT. 34 symbols covering crypto and commodities, up to 200x leverage. Add the -USDT suffix to trade these:

Asset ClassSuffixExamplesMargin
Crypto perps-USDTBTC-USDT, ETH-USDT, SOL-USDTUSDT
Commodities-USDTGOLD-USDT, OIL-USDTUSDT

Spot Markets

50 on-chain spot pairs with direct token settlement. Symbols follow the TOKEN/USDC or TOKEN/USDT format.

FormatExamplesSettlement
TOKEN/USDCBTC/USDC, ETH/USDCUSDC
TOKEN/USDTBTC/USDT, ETH/USDTUSDT

Symbol Prefix Summary

FormatExampleMarket
TICKER / TICKER-USDCBTC, ETH-USDCUSDC Perp (up to 40x)
TICKER-USDTBTC-USDTUSDT Perp (up to 200x)
xyz:TICKERxyz:GOLD, xyz:TSLARWA Perp (USDC margin)
cash:TICKERcash:USA500, cash:NAS100Cash Index Perp (USDC margin)
vntl:TICKERvntl:OPENAIVenture Token Perp (USDC margin)
TOKEN/USDCBTC/USDCUSDC Spot
TOKEN/USDTBTC/USDTUSDT Spot

Use GET /v1/trade/symbols/list for the complete, always-current symbol list with max leverage, tick sizes, and which margin product each symbol belongs to.

Multi-Chain Ecosystem

The GaiaEx wallet supports asset management and cross-chain operations across the following networks:

Network
Ethereum
Polygon
Optimism
Solana
TRON
Bitcoin

Trading collateral: USDC Perps are collateralized with USDC; USDT Perps with USDT. Deposits and withdrawals are handled in the GaiaEx app — the backend manages all collateral routing transparently.

Next Steps

  • Follow the Quick Start for a complete code cookbook — auth, balance, positions, orders, place / modify / cancel — in Python, JavaScript, Go, Rust, C++, Java, C#, and curl.
  • Read General Info for base URL, authentication details, HMAC signing walkthrough, timeouts, retries, and idempotency.
  • Review Common Definitions for order types, symbol formats, and margin modes.
  • Ready for AI? See AI Agent Integration — give Claude or GPT these same tools via MCP. The agent trades within the API key's scope; it cannot move funds.