Skip to main content

SetLeverage

SetLeverage · write key · Body: { "accountId": "…", "symbol": "BTC", "leverage": "5" } · Response: {}
  • leverage is a decimal string from 1 up to the market’s maxLeverage in ListMarkets, with at most four decimal places. A value outside that answers invalid_argument, and the message says why, such as invalid leverage: BTC allows at most 10x.
  • A market whose leverage was never set trades at its maxLeverage.
  • Leverage can change while a position is open. A change that needs more margin than the account has free answers failed_precondition.

ListLeverage

ListLeverage · read key · Body: { "accountId": "…", "symbol": "BTC" }, with symbol optional The account’s leverage on every market, ordered by symbol, whether or not it holds a position there, or on the one market symbol names.
  • leverage is what the market’s margin is computed at, for an open position and the next order alike: the value SetLeverage last set, or maxLeverage when never set.
  • A value set above a market’s current maxLeverage reads as maxLeverage, because margin is capped there.
  • An account in ACCOUNT_STATE_AWAITING_SIGNATURE or ACCOUNT_STATE_INITIALIZING may answer not_found, because its portfolio is created during activation.