Skip to main content

Switch Position Mode

Switches between one-way and hedge position modes for a coin.

MethodPOST
Path/v5/position/switch-mode
AuthAuthenticated.
caution

You can only change mode when you have no open positions and no open orders for the coin. The call fails otherwise.

Body parameters​

ParameterTypeRequiredDescription
categorystringYeslinear.
coinstringYesSettlement coin (e.g. USDT). The mode applies to all symbols that settle in this coin.
modeintegerYes0 = one-way (single position per symbol). 3 = hedge (independent long and short positions).

Modes​

ModeValueBehaviour
One-way0One net position per symbol. Buying when short reduces / flips the position. Use positionIdx: 0 on orders.
Hedge3Independent long and short positions on the same symbol. Use positionIdx: 1 (long) or 2 (short) on orders.

Hedge mode is recommended for strategies that quote both sides simultaneously.

Request​

from reference_client import sign_request, BASE_URL
import requests, json

payload = {
"category": "linear",
"coin": "USDT",
"mode": 3
}
headers, path = sign_request("POST", "/v5/position/switch-mode")
r = requests.post(BASE_URL + path, headers=headers, data=json.dumps(payload))
print(r.json())

Response​

{
"retCode": 0,
"retMsg": "All symbols switched successfully.",
"result": {},
"retExtInfo": {},
"time": 1756460696928
}