Update Margin Mode
Update the margin mode for a specified futures trading pair.
API Information
- Method:
POST - Path:
/api/v1/futures/open-api/account/margin-mode
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Futures trading pair, e.g. AAPL |
| marginMode | int | Yes | Margin mode: 1=Cross, 2=Isolated |
Request Example
{
"symbol": "AAPL",
"marginMode": 2
}
Response Fields
| Field | Type | Description |
|---|---|---|
| code | int | Status code, 0 indicates success |
| data.symbol | string | Futures trading pair |
| data.marginMode | int | Effective margin mode |
Response Example
{
"code": 0,
"data": {
"symbol": "AAPL",
"marginMode": 2
}
}
Relationship to Order Creation
This endpoint is the dedicated API for switching margin mode. The order creation endpoint does not support changing margin mode via request parameters.
After a successful switch, subsequent Create Order requests automatically use the new margin mode. We recommend querying the current marginMode via Account Contract Config before calling this endpoint.
Error Codes
Business errors are returned with HTTP 200. Use the body code field to identify the specific error.
| code | Description |
|---|---|
| 3000 | Trading pair not found |
| 8009 | Failed to switch margin mode |
| 8010 | Cannot change margin mode while holding a position |