Cancel an Order — Hard Cancel

Immediately cancel a limit order on-chain by submitting a transaction to the Limit Order contract. Requires a gas fee.

Cancel an Order — Hard Cancel

Hard Cancel writes the cancellation directly to the blockchain, making it effective immediately regardless of any in-flight Operator signatures. Use this when you need certainty that an order is cancelled right now.

You can cancel multiple orders in a single transaction to pay gas only once. Alternatively, increment the contract nonce to cancel all of your open orders at once.

For cancellation without gas, use Gasless Cancel. Expect up to a 5-minute wait.

Flow

GET /orders  →  POST /encode/cancel-batch-orders  →  send transaction

To cancel all orders instead: POST /encode/increase-nonce → send transaction

Step 1 — Get Active Orders

const { data } = await axios.get(
    "https://limit-order.kyberswap.com/read-ks/api/v1/orders",
    { params: { chainId: 137, maker: signerAddress, status: "active" } }
);

const targetOrderId = data.data[0].id;

Step 2 — Encode the Cancel Calldata

Pass one or more orderIds to cancel in a single transaction:

Alternative: Cancel All Orders

To invalidate all open orders by incrementing the Maker's nonce:

Step 3 — Execute On-chain

See Contracts & Addresses for the limitOrderContract address per chain.

Last updated

Was this helpful?