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.
- Download the GaiaEx mobile app — iOS or Android.
- 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.
- 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.
- 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 + tradepermission. Copy theapi_keyandapi_secretinto aconfig.jsonfile 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.
| Capability | Description |
|---|---|
| USDC Perps | 102 crypto symbols (+31 RWA/venture), up to 40x leverage, USDC margin |
| USDT Perps | 34 symbols (crypto + commodities), up to 200x leverage, USDT margin |
| RWA & Venture Perps | 31 symbols — equities, commodities, forex (xyz: prefix), cash indices (cash: prefix), and venture tokens (vntl: prefix), USDC margin |
| Spot Markets | 50 pairs, USDC settlement, TOKEN/USDC format |
| Non-Custodial | User'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 pattern | Example | Product | Margin | Max leverage |
|---|---|---|---|---|
bare ticker / -USDC | BTC, BTC-USDC | USDC Perp | USDC | up to 40x |
-USDT suffix | BTC-USDT | USDT Perp | USDT | up to 200x |
xyz: / cash: / vntl: | xyz:GOLD, cash:USA500, vntl:OPENAI | RWA / venture perp | USDC | varies |
TICKER/USDC | BTC/USDC | Spot | USDC | n/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.
| Interface | Base URL | Purpose |
|---|---|---|
| REST API | https://openapi.gaiaex.com/v1/trade | Trading, account management, market data |
| WebSocket | wss://openapi.gaiaex.com | Real-time order books, user data, wallet updates |
| WebSocket (dedicated) | wss://ws.gaiaex.com | Same 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:
| Method | Best For | Mechanism |
|---|---|---|
| API Key + HMAC-SHA256 | Bots, automated trading | Three custom headers per request (X-GAIAEX-APIKEY, X-GAIAEX-TIMESTAMP, X-GAIAEX-SIGNATURE) |
| Bearer Session Token | Mobile app, web app | Authorization: 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 Class | Prefix | Examples | Margin |
|---|---|---|---|
| Crypto perps | (none, or -USDC suffix) | BTC, ETH, SOL, BTC-USDC | USDC |
| Equities, Commodities, Forex (RWA) | xyz: | xyz:AAPL, xyz:TSLA, xyz:GOLD, xyz:EUR | USDC |
| Cash Indices | cash: | cash:USA500, cash:NAS100 | USDC |
| Venture Token Perps | vntl: | vntl:OPENAI, vntl:ANTHROPIC | USDC |
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 Class | Suffix | Examples | Margin |
|---|---|---|---|
| Crypto perps | -USDT | BTC-USDT, ETH-USDT, SOL-USDT | USDT |
| Commodities | -USDT | GOLD-USDT, OIL-USDT | USDT |
Spot Markets
50 on-chain spot pairs with direct token settlement. Symbols follow the TOKEN/USDC or TOKEN/USDT format.
| Format | Examples | Settlement |
|---|---|---|
TOKEN/USDC | BTC/USDC, ETH/USDC | USDC |
TOKEN/USDT | BTC/USDT, ETH/USDT | USDT |
Symbol Prefix Summary
| Format | Example | Market |
|---|---|---|
TICKER / TICKER-USDC | BTC, ETH-USDC | USDC Perp (up to 40x) |
TICKER-USDT | BTC-USDT | USDT Perp (up to 200x) |
xyz:TICKER | xyz:GOLD, xyz:TSLA | RWA Perp (USDC margin) |
cash:TICKER | cash:USA500, cash:NAS100 | Cash Index Perp (USDC margin) |
vntl:TICKER | vntl:OPENAI | Venture Token Perp (USDC margin) |
TOKEN/USDC | BTC/USDC | USDC Spot |
TOKEN/USDT | BTC/USDT | USDT 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.