Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

cancel

Cancel one open order by its on-chain oid. The name argument is verified for parity (typos fail loudly).

Signature

def cancel(self, name: str, oid: int) -> dict[str, Any]

Example

result = exchange.cancel("BTC", oid=12345)

Parameters

namestr. HL coin name (e.g. "BTC"). Used only for verification — info.name_to_pair(name) runs first to surface typos before the cancel is dispatched.

oidint. On-chain order id to cancel.

Returns

dict[str, Any] — Hyperliquid-shaped cancel envelope.

Notes

  • Native cancel only needs the oid, but verifying name first gives a clearer error if the caller passes the wrong coin.

See also