Set leverage (defaults to market maximum)
Check leverage and prepare an updateLeverage action to the requested value.
If leverage is omitted, targets the asset’s maximum leverage for that
market. If the asset is already at the requested leverage, returns
leverage_ok=true with null typed_data — no signing needed. Otherwise,
returns EIP-712 typed data for the user to sign. After signing, submit the
signature via the /execute endpoint.
Body
Request to set leverage on a global markets perps asset.
Omit leverage (or pass null) to target the asset's maximum leverage.
User's EOA address
Asset ticker (e.g. 'AAPL', 'CL')
Target leverage as a whole-number multiplier. Omit (or pass null) to use the asset's maximum leverage. Must be between 1 and the asset's max leverage, which is available from the /opportunities endpoint.
x >= 1Response
Successful Response
Returned by the set_leverage endpoint.
If the asset is already at the requested leverage, typed_data/action/nonce are null. If not, they contain the EIP-712 payload the user must sign.
True if leverage already matches the requested value, false if an update is needed
EIP-712 typed data for wallet signing, or null if no change is needed
Raw Hyperliquid action (passed back to the execute endpoint), or null
Timestamp-based nonce, or null if no action needed