Skip to main content
POST
Python (SDK)

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request to check and set leverage to 1x cross on a perpetual trading asset.

owner
string
required

User's EOA address

asset
string
required

Asset ticker (e.g. 'AAPL', 'CL')

Response

Successful Response

Returned by the ensure_leverage endpoint.

If the asset is already at 1x cross leverage, typed_data/action/nonce are null. If not (or no position exists), they contain the EIP-712 payload the user must sign.

leverage_ok
boolean
required

True if leverage is already 1x cross, false if update needed

typed_data
Typed Data · object | null

EIP-712 typed data for wallet signing, or null if already 1x cross

action
Action · object | null

Raw Hyperliquid action (passed back to the execute endpoint), or null

nonce
integer | null

Timestamp-based nonce, or null if no action needed