updateLeverage action sets your account’s leverage for a specific contract. The new leverage sets the initial margin (IM) requirement of positions opened after the change — higher leverage means a smaller margin requirement per unit of notional value.
Lowering leverage triggers a validation check: the server verifies that your available margin still covers the IM of your existing position at the new, lower leverage. If it does not, the request is rejected (leverage downgrade IM insufficient) and your leverage remains unchanged. For accounts in PORTFOLIO margin mode the check uses the share group’s margin.
Read the leverage currently in effect from positions[].leverage in userAccount.
Endpoint
Request
All requests must include an ECDSA signature and a millisecond-precision nonce.Action fields
string
required
type (required) — Fixed value: "updateLeverage".int32
required
a (required) — The contract ID to update leverage for.int32
required
leverage (required) — The new leverage value. Must be a positive integer and must not exceed the tier0.maxLeverage configured for the contract. 0 returns 400 INVALID_PARAM.Response
Success
Rejection
Rejections still return HTTP 200 with
status: "ok". Check for the presence of errorCode in data to detect failures.Response fields
int
The leverage setting for the contract before the update. Returns
0 on rejection — read the current value from userAccount instead.int
The leverage setting for the contract after the update. Returns
0 on rejection.number
Present only on rejection. Identifies the failure reason; a non-zero value means the request was rejected and nothing changed.
string
Present only on rejection. Human-readable description of the failure.
