Exchange API calls do not consume Quicknode API credits. Transactions through this endpoint are appended with a builder fee. See hyperliquidapi.com for a full breakdown. To white-label with your own builder code, contact us.
Body Parameters
- actionobjectREQUIRED
Leverage or margin action object. The type field determines which operation is performed and which additional fields are required.
- typestring
Action type. Supported values: "updateLeverage", "updateIsolatedMargin", "topUpIsolatedOnlyMargin".
- assetstring or integer
Market name (e.g. "BTC") or native asset index. Resolved to a numeric asset index in the response.
- isCrossboolean
Whether to use cross margin (true) or isolated margin (false). Required for updateLeverage.
- leveragenumber or string
Leverage value to set. Required for updateLeverage.
- isBuyboolean
Position side the margin change applies to (true for long, false for short). Required for updateIsolatedMargin.
- ntlinumber
Isolated margin delta to add (positive) or remove (negative). Required for updateIsolatedMargin.
Returns
- hashstring
Hash to sign with wallet (0x-prefixed hex string)
- nonceinteger
Unique nonce for this action (timestamp in milliseconds)
- actionobject
Processed action object with the asset resolved to a numeric asset index
- actionTypestring
The action type as submitted (e.g. "updateLeverage", "updateIsolatedMargin", "topUpIsolatedOnlyMargin")
- nextStepstring
Instructions for next step: sign the hash with private key (ECDSA), then POST /exchange with action, nonce, and signature (r, s, v)