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

cancelOrders

const result = await perps.cancelOrders({
  provider: 'hyperliquid',
  address: userAddress,
  ids: ['12345678'],
});
Pass multiple IDs to cancel several orders in a single call:
await perps.cancelOrders({
  provider: 'hyperliquid',
  address: userAddress,
  ids: ['12345678', '12345679'],
});
Use the orderId returned from the placeOrder response to cancel orders.
API Reference: POST /createAction · /executeAction