Docs

twapCancel - Cancel TWAP Orders

Cancel an active TWAP order on Hyperliquid. Stop time-weighted execution before completion.

Cancel an active TWAP (Time-Weighted Average Price) order before it completes execution.

Sample Data

JSON
{
  "signature": {
    "r": "0x19049f59f4a558ebde3cd54b7fec8fa7329bed21515aafa468f08b6d283f87d5",
    "s": "0x701715161c404203ec40441689c4fea25894c827a8bf48d3a46a9601d859478a",
    "v": 27
  },
  "action": {
    "type": "twapCancel",
    "a": 161,
    "t": 1506780
  },
  "nonce": 1768147413037,
  "expiresAfter": 1768147429667
}

View this transaction on Hypurrscan

Field Reference

Action Fields

FieldTypeDescription
typestringAlways "twapCancel"
anumberAsset index
tnumberTWAP order ID to cancel

Use Cases

TWAP Lifecycle Tracking

Monitor TWAP order cancellations:

Python
def process_twapCancel_action(action):
    asset = action.get('a')
    twap_id = action.get('t')
    print(f"TWAP cancelled: asset {asset}, id {twap_id}")