Set Margin Mode
Switch between isolated and crossed margin modes for a specific trading symbol.
HTTP Request
POST /api/v1/future/account/set-margin-mode
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading pair symbol (e.g., BTCUSDT) |
| marginMode | string | Yes | Margin mode: "CROSS" or "ISOLATED" |
Request Example
Set to Crossed Margin
curl -X POST "https://open-api.bydoxe.com/api/v1/future/account/set-margin-mode" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000" \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTCUSDT",
"marginMode": "CROSS"
}'
Set to Isolated Margin
curl -X POST "https://open-api.bydoxe.com/api/v1/future/account/set-margin-mode" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000" \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTCUSDT",
"marginMode": "ISOLATED"
}'
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code |
| msg | string | Response message |
| requestTime | number | Request timestamp in milliseconds |
| data | object | Margin mode change data |
| > symbol | string | Trading pair symbol |
| > marginCoin | string | Margin coin (e.g., USDT) |
| > longLeverage | string | Current leverage for long positions |
| > shortLeverage | string | Current leverage for short positions |
| > marginMode | string | Updated margin mode: "CROSS" or "ISOLATED" |
Response Example
Success Response
{
"code": "00000",
"msg": "success",
"requestTime": 1732000000000,
"data": {
"symbol": "BTCUSDT",
"marginCoin": "USDT",
"longLeverage": "10",
"shortLeverage": "10",
"marginMode": "CROSS"
}
}
Error Codes
| Code | Message |
|---|---|
| 40034 | symbol does not exist |
| 40001 | marginMode mode is not supported |
| 40001 | A different margin mode is not available than the position currently opened. |
Notes
- Cross Margin Mode: All available balance in your futures account is used as margin. Positions share the same margin pool, which can help prevent liquidation but risks the entire account balance.
- Isolated Margin Mode: Only the margin allocated to a specific position is at risk. If liquidated, you only lose the margin allocated to that position, not your entire account balance.
- You cannot change margin mode if you have open positions for the symbol. Close all positions first before switching margin modes.