chordDocs

Trading

Cancel and revoke

Take an order back, or take back the allowance entirely.

You can take back a single order, every order below a nonce, or the allowance itself. All three are on-chain transactions you sign, so no one can undo them on your behalf, and no one but you can do them.

#Cancel one order

Cancel on chain in Your orders cancels a held order. The collector prepares an unsigned cancel_nonce transaction for that order’s nonce; you sign and send it from your wallet, paying the network fee. The program writes a cancelled receipt for the nonce, and any later fill attempt with it fails.

  • Cancelling works until the order fills. If it already filled, the receipt is bound to the fill and the cancel has no effect on it.
  • If the order part filled, cancelling stops the rest. What already filled stays filled.
  • The app asks you to confirm before sending, because the cancel is permanent.

#Cancel everything below a nonce

advance_nonce raises your nonce floor. Every order with a lower nonce becomes unusable at once. The app doesn’t offer it as a button; send it with the SDK:

TypeScript
import { Transaction } from "@solana/web3.js";
import { ChordClient } from "@chord/sdk";

const client = new ChordClient(connection);
const floor = BigInt(Date.now()) * 1000n; // the app’s nonces are microseconds since 1970
const tx = new Transaction().add(client.advanceNonceInstruction(wallet.publicKey, floor));
await wallet.sendTransaction(tx, connection);

Raising the floor to the current time cancels every order you signed before it.

#Revoke the allowance

Revoke in Your orders removes Chord’s allowance on that token account with a standard SPL revoke. No open order from that account can fill afterwards. This is the broadest exit: it also covers orders the collector hasn’t told you about.

#What a cancel can’t do

A cancel doesn’t reverse a fill. Fills are atomic swaps at the committed price, and once one lands, both sides of it are final.