Exchange endpoint
Endpoint
POST /exchange
Purpose
Submits signed customer trading actions and owner-authorized withdrawal requests. The request's action.type selects the operation; the action names below share this route.
Supported calls
| Action | Purpose |
|---|---|
order | Place supported perpetual limit orders. |
cancel | Cancel orders by order ID. |
cancelByCloid | Cancel orders by client order ID. |
updateLeverage | Update a customer's cross-margin leverage setting. |
requestWithdrawal | Reserve an owner-authorized USDC payout request. |
requestWithdrawal is a brokerage extension. The other action names follow Hyperliquid.
Authorization
The SDK handles signing. Custom clients use the fields below.
The owner or an approved trading agent signs orders, cancellations and leverage updates. Only the owner can sign withdrawals. See authentication for permissions and signing for exact formats.
Request fields
Orders, cancellations and leverage updates use the native-style trading envelope:
| Field | Type | Required | Meaning |
|---|---|---|---|
action | Object | Yes | One supported action shape; action.type selects the operation. |
nonce | Unsigned integer | Yes | Trading nonce; native-style millisecond timestamp convention. |
signature | Object | Yes | Wallet signature containing r, s and recovery byte v (27 or 28). |
expiresAfter | Unsigned integer or null | No | Request expiry in Unix milliseconds. |
vaultAddress | Null | No | Omit or use null; customer subaccount/vault routing is outside this profile. |
requestWithdrawal instead carries action.type, action.intent and the owner signature as a canonical 65-byte hex string. Its intent contains a separate nonce and deadline. See its call page for the full fields and signing requirements; the five-field trading envelope does not apply to that extension.
Request example
Example cancellation. Replace the sample order ID, nonce and signature with your own values.
{
"action": {
"type": "cancel",
"cancels": [
{
"a": 0,
"o": 12345
}
]
},
"nonce": 1796250000000,
"signature": {
"r": "0x1111111111111111111111111111111111111111111111111111111111111111",
"s": "0x2222222222222222222222222222222222222222222222222222222222222222",
"v": 27
}
}requestWithdrawal uses the separate owner-signed intent.
Response fields
Inspect status, response and each child result; HTTP success alone is insufficient.
| Field or shape | Type | Meaning |
|---|---|---|
status | String | ok for an accepted action response or err for a request-level rejection. |
response | Object or string | The typed action result on success, or a rejection reason on error. |
response.type | String | order for orders, cancel for both cancellation actions, default for leverage updates, or withdrawal for a withdrawal request. |
response.data.statuses | Array | One status per submitted order or cancellation, in request order; children can succeed or fail independently. |
response.data for withdrawals | Object | Withdrawal ID and structured lifecycle state, such as reserved; acceptance is not receipt of funds. |
Orders return resting, filled or error; cancellations return "success" or an error. Outer ok does not mean every child succeeded.
Response example
A successful single-child cancellation returns:
{
"status": "ok",
"response": {
"type": "cancel",
"data": {
"statuses": [
"success"
]
}
}
}Inspect each child's status in a batch; the outer ok alone does not establish that all cancellations succeeded.
Constraints
Default-DEX perps, cross margin and GTC orders only. Spot, customer vault/subaccount routing, other DEXes, public data and unlisted actions or fields are unsupported.
An accepted withdrawal request is not a completed payout. If a trading acknowledgement is lost, check the order before submitting a replacement.
The Hyperliquid exchange endpoint is the native protocol reference. The action pages above define Hyperjutsu's supported subset.