Skip to main content

Set Leverage

Sets the leverage multiplier on a symbol. Applies to subsequent orders; does not change the leverage on existing positions.

MethodPOST
Path/v5/position/set-leverage
AuthAuthenticated.

Body parameters

ParameterTypeRequiredDescription
categorystringYeslinear.
symbolstringYesSymbol (e.g. BTCUSDT).
buyLeveragestringYesLeverage for long-side orders.
sellLeveragestringYesLeverage for short-side orders.

In one-way mode buyLeverage and sellLeverage must match. In hedge mode they can differ.

The allowed range and step come from leverageFilter on Instruments Info — typically 1×–100× in 0.01× steps for BTCUSDT.

Request

from reference_client import sign_request, BASE_URL
import requests, json

payload = {
"category": "linear",
"symbol": "BTCUSDT",
"buyLeverage": "2",
"sellLeverage": "2"
}
headers, path = sign_request("POST", "/v5/position/set-leverage")
r = requests.post(BASE_URL + path, headers=headers, data=json.dumps(payload))
print(r.json())

Response

{
"retCode": 0,
"retMsg": "OK",
"result": {},
"retExtInfo": {},
"time": 1756460695432
}

retCode: 110043 with retMsg: "leverage not modified" means the requested leverage matches the current value — your call was a no-op. Treat this as success.