Spot Trading Orders & History
Execute spot trades on GaiaEx via API: place market and limit orders, cancel orders, and retrieve trade history.
SKILL.mdDrop-in Claude Code skill with HMAC-SHA256 signing, /fapi/v1 & /fapi/v2 schemas, and secret-redaction guardrails.
AGENTS.mdDrop-in repository AGENTS.md for OpenAI Codex CLI — tick-size rules, rate-limit budgets, and self-custody boundaries.
AGY.mdGoogle Antigravity (agy) & Gemini agent spec with verified async Python WebSocket + REST execution templates.
llms.txtSingle-URL machine-readable index of all GaiaEx documentation pages, OpenAPI 3.0 schema, and Postman collection.
Overview
Spot Trading endpoints follow the industry-standard GaiaEx Spot API standard under both https://openapi.gaiaex.com/sapi/v1/* and https://openapi.gaiaex.com/api/v3/*.
All Spot Trading endpoints require the X-MBX-APIKEY header and an HMAC-SHA256 signature + timestamp query/form parameter. Your trading account address is automatically resolved server-side from the API key.
https://openapi.gaiaex.com/sapi/v1/orderHMACNew Spot Order (TRADE)
POST https://openapi.gaiaex.com/sapi/v1/order (or /api/v3/order)
Send in a new spot market or limit order.
Parameters (Query String or Form/JSON Body):
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | YES | Spot pair (e.g. PURRUSDC, BTCUSDC) |
side | ENUM | YES | BUY or SELL |
type | ENUM | YES | LIMIT or MARKET |
timeInForce | ENUM | NO | GTC or IOC (default GTC for LIMIT) |
quantity | DECIMAL | YES | Order quantity in base token units |
price | DECIMAL | NO | Limit price (required for LIMIT orders) |
newClientOrderId | STRING | NO | Unique client order ID |
recvWindow | LONG | NO | Max 60000 (default 5000) |
timestamp | LONG | YES | Current timestamp in milliseconds |
signature | STRING | YES | HMAC-SHA256 hex digest of the query/form string |
Example — Limit Buy:
curl -X POST "https://openapi.gaiaex.com/sapi/v1/order?symbol=PURRUSDC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1000&price=0.0550×tamp=1743508800000&signature=YOUR_HMAC_SHA256_SIG" \
-H "X-MBX-APIKEY: YOUR_API_KEY"Response:
{
"symbol": "PURRUSDC",
"orderId": 555666777,
"clientOrderId": "spot_order_1",
"transactTime": 1743508800000,
"price": "0.0550",
"origQty": "1000",
"executedQty": "0",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY"
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Spot symbol (e.g. PURRUSDC, BTCUSDC) |
| side | string | Yes | BUY or SELL |
| type | string | Yes | LIMIT or MARKET |
| quantity | string | Yes | Order quantity |
| price | string | No | Limit price |
| timestamp | int | Yes | Request timestamp in ms |
| signature | string | Yes | HMAC-SHA256 signature |
symbolSpot symbol (e.g. PURRUSDC, BTCUSDC)
sideBUY or SELL
typeLIMIT or MARKET
quantityOrder quantity
priceLimit price
timestampRequest timestamp in ms
signatureHMAC-SHA256 signature
https://openapi.gaiaex.com/sapi/v1/orderHMACCancel Spot Order (TRADE)
DELETE https://openapi.gaiaex.com/sapi/v1/order (or /api/v3/order)
Cancel an active spot order by orderId or origClientOrderId.
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | YES | Spot pair (e.g. PURRUSDC) |
orderId | LONG | NO | Exchange order ID to cancel |
origClientOrderId | STRING | NO | Client order ID to cancel |
timestamp | LONG | YES | Current timestamp in milliseconds |
signature | STRING | YES | HMAC-SHA256 signature |
Response:
{
"symbol": "PURRUSDC",
"orderId": 555666777,
"origClientOrderId": "spot_order_1",
"status": "CANCELED",
"origQty": "1000",
"executedQty": "0",
"type": "LIMIT",
"side": "BUY"
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Spot symbol (e.g. PURRUSDC) |
| orderId | int | Yes | Order ID to cancel |
| timestamp | int | Yes | Request timestamp in ms |
| signature | string | Yes | HMAC-SHA256 signature |
symbolSpot symbol (e.g. PURRUSDC)
orderIdOrder ID to cancel
timestampRequest timestamp in ms
signatureHMAC-SHA256 signature
https://openapi.gaiaex.com/sapi/v1/orderHMACQuery Spot Order (USER_DATA)
GET https://openapi.gaiaex.com/sapi/v1/order (or /api/v3/order)
Check a spot order's status by orderId or origClientOrderId.
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | YES | Spot pair (e.g. PURRUSDC, BTCUSDC) |
orderId | LONG | NO | Exchange order ID |
origClientOrderId | STRING | NO | Client order ID |
recvWindow | LONG | NO | Max 60000 (default 5000) |
timestamp | LONG | YES | Current timestamp in milliseconds |
signature | STRING | YES | HMAC-SHA256 signature |
Response:
{
"symbol": "PURRUSDC",
"orderId": 555666777,
"clientOrderId": "spot_order_1",
"price": "0.0550",
"origQty": "1000",
"executedQty": "1000",
"cummulativeQuoteQty": "55.00",
"status": "FILLED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"time": 1743508800000,
"updateTime": 1743508805000,
"isWorking": false
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Spot symbol (e.g. PURRUSDC, BTCUSDC) |
| orderId | int | No | Order ID to query |
| origClientOrderId | string | No | Client order ID to query |
| timestamp | int | Yes | Request timestamp in ms |
| signature | string | Yes | HMAC-SHA256 signature |
symbolSpot symbol (e.g. PURRUSDC, BTCUSDC)
orderIdOrder ID to query
origClientOrderIdClient order ID to query
timestampRequest timestamp in ms
signatureHMAC-SHA256 signature
https://openapi.gaiaex.com/sapi/v1/openOrdersHMACCancel All Open Orders on a Symbol (TRADE)
DELETE https://openapi.gaiaex.com/sapi/v1/openOrders (or /api/v3/openOrders)
Cancels all active spot orders on a symbol.
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | YES | Spot pair (e.g. PURRUSDC) |
timestamp | LONG | YES | Current timestamp in milliseconds |
signature | STRING | YES | HMAC-SHA256 signature |
Response:
[
{
"symbol": "PURRUSDC",
"orderId": 555666777,
"status": "CANCELED",
"origQty": "1000",
"side": "BUY",
"type": "LIMIT"
}
]Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Spot symbol (e.g. PURRUSDC) |
| timestamp | int | Yes | Request timestamp in ms |
| signature | string | Yes | HMAC-SHA256 signature |
symbolSpot symbol (e.g. PURRUSDC)
timestampRequest timestamp in ms
signatureHMAC-SHA256 signature