SetLeverage
SetLeverage · write key · Body: { "accountId": "…", "symbol": "BTC", "leverage": "5" } · Response: {}
leverageis a decimal string from 1 up to the market’smaxLeveragein ListMarkets, with at most four decimal places. A value outside that answersinvalid_argument, and the message says why, such asinvalid 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.
leverageis what the market’s margin is computed at, for an open position and the next order alike: the value SetLeverage last set, ormaxLeveragewhen never set.- A value set above a market’s current
maxLeveragereads asmaxLeverage, because margin is capped there. - An account in
ACCOUNT_STATE_AWAITING_SIGNATUREorACCOUNT_STATE_INITIALIZINGmay answernot_found, because its portfolio is created during activation.

