Skip to main content
Cancel one or more open orders through PerpsClient.cancelOrders. The registered provider plugin authorizes each cancellation with its SDK-managed credential; the user’s wallet is not prompted.
The examples on this page use Hyperliquid (provider: 'hyperliquid'). Replace the provider value with any supported provider from getProviders().

cancelOrders

Pass multiple IDs to cancel several orders in a single call:
Use the orderId returned from the placeOrder response to cancel orders. A venue rejection does not throw; check success on each entry of result.results. See Error Handling.
Hyperliquid’s cancelOrder takes ids only. assetId and the composite id form apply to venues with per-market order ids.

Per-market order IDs

Some venues scope order IDs per market rather than globally (e.g. Lighter’s order_index). For those, supply the market context so the cancel resolves to the right order — either pass the composite "<market_id>:<order_id>" form in ids, or set assetId to the order’s market.id:

Cancel all orders

Where a provider’s descriptor advertises cancelAllOrders, cancel every open order in one action through execute. Lighter and Ondo advertise it; Hyperliquid does not. Ondo supports only timeInForce: 0.
Account reads such as getOrders go directly to the venue. After cancelling, update your UI optimistically and re-read once after a short delay rather than polling. API Reference: POST /createAction · /executeAction