HyperliquidHyperliquid REST APITrading

Cancel Order

Cancel existing orders by order ID or client order ID.

Rate Limit: 1 + floor(batch_length / 40) weight

Authentication: Required

POST
/v1/exchange/cancel

Authorization

HyperliquidSignature
Authorization<token>

Hyperliquid uses a custom signing scheme for authentication.

Required for: All /exchange endpoints

Format: Signature generated using private key + nonce + action data

Headers:

  • Authorization: Signature
  • Content-Type: application/json

Important Notes:

  • Use official SDKs to avoid signing errors
  • Nonce must be current timestamp in milliseconds
  • Address fields must be lowercase
  • Order of fields in msgpack serialization matters

Common Pitfalls:

  • Not understanding the two signing schemes
  • Trailing zeros on numbers
  • Case sensitivity on addresses
  • Incorrect field ordering

In: header

Request Body

application/json

action*objectrequired
type*enum<string>required
Available options: cancel
cancels*array<object>required
Array items:
a?integer

Asset index

o?integer

Order ID

cloid?string

Client order ID

nonce*integerrequired
signature*objectrequired
r*stringrequired
s*stringrequired
v*integerrequired

Response Body

application/json

application/json

application/json

curl -X POST "https://api.hypereth.io/v1/exchange/cancel" \  -H "Content-Type: application/json" \  -d '{    "action": {      "type": "cancel",      "cancels": [        {          "a": 0,          "o": 127244980388        }      ]    },    "nonce": 1681923834000,    "signature": {      "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",      "s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321",      "v": 27    }  }'
{
  "status": "ok",
  "response": {
    "type": "cancel",
    "data": {
      "statuses": [
        "success"
      ]
    }
  }
}
{
  "error": "Insufficient margin for order placement",
  "code": 1001,
  "details": {}
}
{
  "error": "Insufficient margin for order placement",
  "code": 1001,
  "details": {}
}