Skip to content
LogoLogo

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.

Quickstart · HTTP schemas

Supported calls

ActionPurpose
orderPlace supported perpetual limit orders.
cancelCancel orders by order ID.
cancelByCloidCancel orders by client order ID.
updateLeverageUpdate a customer's cross-margin leverage setting.
requestWithdrawalReserve 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:

FieldTypeRequiredMeaning
actionObjectYesOne supported action shape; action.type selects the operation.
nonceUnsigned integerYesTrading nonce; native-style millisecond timestamp convention.
signatureObjectYesWallet signature containing r, s and recovery byte v (27 or 28).
expiresAfterUnsigned integer or nullNoRequest expiry in Unix milliseconds.
vaultAddressNullNoOmit 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 shapeTypeMeaning
statusStringok for an accepted action response or err for a request-level rejection.
responseObject or stringThe typed action result on success, or a rejection reason on error.
response.typeStringorder for orders, cancel for both cancellation actions, default for leverage updates, or withdrawal for a withdrawal request.
response.data.statusesArrayOne status per submitted order or cancellation, in request order; children can succeed or fail independently.
response.data for withdrawalsObjectWithdrawal 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.