Leverage & Margin Mode
Set leverage (1x–100x) and margin mode (cross or isolated) for perpetual futures positions on GaiaEx via API.
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.
https://openapi.gaiaex.com/fapi/v1/leverageHMACChange Initial Leverage (TRADE)
Change user's initial leverage of specific symbol market.
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | YES | Trading symbol (e.g., BTCUSDC, ETHUSDC, BTCUSDT, ETHUSDT) |
leverage | INT | YES | Target initial leverage: int from 1 to maxLeverage of the symbol |
recvWindow | LONG | NO | Timestamp validity window in ms (default 5000) |
timestamp | LONG | YES | Current Unix timestamp in milliseconds |
Example Request:
POST https://openapi.gaiaex.com/fapi/v1/leverage?symbol=ETHUSDC&leverage=10×tamp=1743508800000&signature=c3e85abeacfbb9ef64cfb7163b31d622e1a9744c128be6249e8347479c899158
X-MBX-APIKEY: your_api_key_hereResponse:
{
"leverage": 10,
"maxNotionalValue": "INF",
"symbol": "ETHUSDC"
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading symbol (e.g. ETHUSDC) |
| leverage | int | Yes | Target initial leverage (1 to max leverage) |
| timestamp | int | Yes | Request timestamp in ms |
| signature | string | Yes | HMAC-SHA256 signature |
symbolTrading symbol (e.g. ETHUSDC)
leverageTarget initial leverage (1 to max leverage)
timestampRequest timestamp in ms
signatureHMAC-SHA256 signature
https://openapi.gaiaex.com/fapi/v1/marginTypeHMACChange Margin Type (TRADE)
Change symbol level margin type between cross margin (CROSSED) and isolated margin (ISOLATED).
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | YES | Trading symbol (e.g., ETHUSDC, BTCUSDT) |
marginType | ENUM | YES | ISOLATED or CROSSED |
recvWindow | LONG | NO | Timestamp validity window in ms (default 5000) |
timestamp | LONG | YES | Current Unix timestamp in milliseconds |
Example Request:
POST https://openapi.gaiaex.com/fapi/v1/marginType?symbol=ETHUSDC&marginType=CROSSED×tamp=1743508800000&signature=8bb72b649cea0ef7e170cf82d7e7e902279cf8b4fbf73b7248c1eb00a62ddc42
X-MBX-APIKEY: your_api_key_hereResponse:
{
"code": 200,
"msg": "success"
}STRICT ISOLATED SYMBOLS
Some RWA/venture symbols (e.g. COPPERUSDC, NATGASUSDC) enforce strict isolated margin mode. For these symbols, the backend automatically applies isolated margin.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading symbol (e.g. ETHUSDC) |
| marginType | string | Yes | ISOLATED or CROSSED |
| timestamp | int | Yes | Request timestamp in ms |
| signature | string | Yes | HMAC-SHA256 signature |
symbolTrading symbol (e.g. ETHUSDC)
marginTypeISOLATED or CROSSED
timestampRequest timestamp in ms
signatureHMAC-SHA256 signature
https://openapi.gaiaex.com/fapi/v1/leverageBracketNotional and Leverage Brackets (USER_DATA)
https://openapi.gaiaex.com/fapi/v1/leverageBracket?symbol=BTCUSDCQuery notional and leverage brackets for a symbol or all symbols.
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | NO | Trading symbol (e.g., BTCUSDT, ETHUSDC). Omit to return brackets for all symbols. |
recvWindow | LONG | NO | Timestamp validity window in ms (default 5000) |
timestamp | LONG | NO | Current Unix timestamp in milliseconds |
Response:
[
{
"symbol": "BTCUSDT",
"brackets": [
{
"bracket": 1,
"initialLeverage": 100,
"notionalCap": 50000,
"notionalFloor": 0,
"maintMarginRatio": 0.005,
"cum": 0.0
},
{
"bracket": 2,
"initialLeverage": 50,
"notionalCap": 250000,
"notionalFloor": 50000,
"maintMarginRatio": 0.01,
"cum": 250.0
}
]
}
]Representative Maximum Leverage by Asset Class
| Asset Class | Typical Max Leverage | Examples |
|---|---|---|
| Crypto major (USDC) | 25x–40x | BTCUSDC 40x, ETHUSDC 25x |
| Crypto mid-cap (USDC) | 10x–20x | SOLUSDC 20x, DOGEUSDC 10x |
| USDT-margined perps | up to 100x | BTCUSDT, ETHUSDT, SOLUSDT |
| Forex RWA | 50x | EURUSDC, JPYUSDC |
| Commodities RWA | 10x–20x | GOLDUSDC 20x, NATGASUSDC 10x |
| Equities RWA | 10x | AAPLUSDC, TSLAUSDC, NVDAUSDC |
| Indices RWA | 20x–25x | USA500USDC 20x, XYZ100USDC 25x |
| Pre-IPO / Venture | 3x–5x | OPENAIUSDC 3x, ANTHROPICUSDC 3x, SPCXUSDC 5x |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | Trading symbol (e.g. ETHUSDC) |
symbolTrading symbol (e.g. ETHUSDC)
https://openapi.gaiaex.com/fapi/v1/positionSide/dualHMACPosition Mode (One-Way / Hedge Mode)
GET / POST https://openapi.gaiaex.com/fapi/v1/positionSide/dual
Query or set the account's position mode across all symbols. GaiaEx operates in One-Way Mode (dualSidePosition: false); POST accepts the parameter for 1:1 SDK compatibility.
Parameters (POST):
| Name | Type | Mandatory | Description |
|---|---|---|---|
dualSidePosition | STRING | YES | "false": One-way Mode |
recvWindow | LONG | NO | Timestamp validity window in ms (default 5000) |
timestamp | LONG | YES | Current Unix timestamp in milliseconds |
Response (GET):
{
"dualSidePosition": false
}Response (POST):
{
"code": 200,
"msg": "success"
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| timestamp | int | Yes | Request timestamp in ms |
| signature | string | Yes | HMAC-SHA256 signature |
timestampRequest timestamp in ms
signatureHMAC-SHA256 signature
https://openapi.gaiaex.com/fapi/v1/multiAssetsMarginHMACMulti-Assets Mode
GET / POST https://openapi.gaiaex.com/fapi/v1/multiAssetsMargin
Query or set Multi-Assets margin mode status across symbols.
Response (GET):
{
"multiAssetsMargin": true
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| timestamp | int | Yes | Request timestamp in ms |
| signature | string | Yes | HMAC-SHA256 signature |
timestampRequest timestamp in ms
signatureHMAC-SHA256 signature