Docs

cancelByCloid - Cancel Orders by Client ID

Cancel orders on Hyperliquid using client-assigned order IDs. Enables easier order tracking for trading systems.

Cancel orders using the client-assigned order ID (cloid) instead of the exchange-assigned order ID. This is useful for trading systems that track orders by their own identifiers.

Sample Data

JSON
{
  "signature": {
    "r": "0x2a0b6667955f197d530797576107b663fa08b20397286076f1684b3112738588",
    "s": "0x91a7dee6fae7c212e7b3f3a6dfbec5c555ac13986c56ec39bdc361b1713b8fb",
    "v": 28
  },
  "action": {
    "type": "cancelByCloid",
    "cancels": [
      {
        "asset": 159,
        "cloid": "0x00000000000007550096147985161351"
      },
      {
        "asset": 1,
        "cloid": "0x00000000000007580071223980263264"
      },
      {
        "asset": 5,
        "cloid": "0x00000000000007580071644980263273"
      }
    ]
  },
  "nonce": 1768146912996,
  "vaultAddress": "0x621c5551678189b9a6c94d929924c225ff1d63ab"
}

View this transaction on Hypurrscan

Field Reference

Action Fields

FieldTypeDescription
typestringAlways "cancelByCloid"
cancelsarrayArray of cancel requests

Cancel Object Fields

FieldTypeDescription
assetnumberAsset index of the order to cancel
cloidstringClient order ID (hex string) assigned when order was placed

Optional Fields

FieldTypeDescription
vaultAddressstringVault address if cancelling vault orders
expiresAfternumberTimestamp after which the cancel request expires

Client Order ID Format

Client order IDs are 16-byte hex strings that you assign when placing orders. A common pattern encodes:

  • Date/timestamp information
  • Sequential counter
  • System identifier

Example: 0x20260109000000000000000000150997

  • 20260109 - Date encoding (2026-01-09)
  • 150997 - Sequence number

Use Cases

Trading System Integration

Use cloids to maintain order state without querying the exchange:

Python
def process_cancelByCloid_action(action):
    for cancel in action.get('cancels', []):
        asset = cancel['asset']
        cloid = cancel['cloid']

        # Match against your order management system
        order = order_tracker.get_by_cloid(cloid)
        if order:
            order.mark_cancelled()

Order Lifecycle Tracking

Track orders from submission to cancellation using consistent identifiers across your systems.

Latency Analysis

Compare timestamps between cancel request and block inclusion to measure execution latency.

  • order - Submit orders with cloid
  • cancel - Cancel by exchange order ID
  • modify - Modify orders