Skip to main content

Change Initial Leverage

Type: TRADE

POST /fapi/v1/leverage

Status: Implemented.

Sets your leverage preference for a symbol. Subsequent POST /fapi/v1/order calls on that symbol use this value (1–100x) until you change it again — matching real Binance Futures, leverage is a standing per-symbol setting, not an inline order parameter. Positions already open at a leverage keep that leverage for margin purposes until fully closed; a later /fapi/v1/leverage call or a differently-levered order only affects new exposure (opens, same-direction adds, or a flip), never retroactively recomputes an existing position's locked margin on a mere reduce/close.

Query params

Parameters are read from the URL query string only (the body is only part of the signed payload); a required parameter missing from the query string fails with HTTP 400 (plain-text axum rejection, not a {code, msg} JSON body).

NameTypeRequiredNotes
symbolstringyesstandard pair, e.g. BTCUSDT.
leverageintegeryes1–100 (unsigned integer). 0 or > 100 returns -1100; a non-integer or negative value fails query parsing (HTTP 400, plain text).

Response — 200

{
"symbol": "BTCUSDT",
"leverage": 25
}

leverage is returned as a JSON number here (on GET /fapi/v2/positionRisk it is a string). The setting is stored per (user, symbol) in ledger.user_leverage and is not a per-position value.

Errors

HTTPcodemsg
400-1100Unknown symbol, or leverage outside 1–100.
401-2015Invalid or revoked API key.
500-1000Database failure.

Signature and API-key failures (-1021, -1022, -1102, -2014, -2015) and rate limiting (-1003, HTTP 429) apply to every signed endpoint; see Error Codes.

Source: rocky-backend/services/api-gateway/src/fapi/routes_orders.rs (set_leverage), backed by ledger.user_leverage.