Skip to content
Finality

Crypto protocol and market news

Cancel a Partially Filled Limit Order Without Losing Track

A partial fill changes how much of your order remains executable. Check the settled amount, cancel the remainder, and verify the final state before replacing it.

The Finality Desk5 min read#40cc91

Cancel a Partially Filled Limit Order Without Losing Track

After a partial fill, canceling a limit order should stop only the unfilled remainder; the executed portion is already settled and cannot be recalled. The key is to identify which state you are looking at: a trade may have settled while the order book or interface still shows the cancellation as pending. Treat the order as live until cancellation takes effect, then check the executed amount and remaining balance before placing a replacement.

What changes when a limit order is partially filled?

A partially fillable order can execute in smaller trades while its signed conditions remain valid. Each successful settlement transfers the executed sell amount and the corresponding buy amount; the remaining quantity can still be matched later. A fill-or-kill order has different semantics: it must execute in full in a single settlement or not execute at all.

That distinction matters when canceling. Cancellation does not reverse earlier fills or restore the original order size. It prevents future execution once it takes effect. If an order offered 10 tokens for sale and 4 have settled, the relevant remainder is 6, subject to the order’s price constraints and any fees. The precise amounts should come from settled trades, not from subtracting a displayed progress figure that may be stale or rounded.

For CoW Protocol orders, partial fillability is an order setting. CoW Swap’s documentation notes that limit orders are partially fillable by default, which lets them execute as liquidity becomes available; small leftovers can remain if settlement costs make them uneconomic. A fuller comparison of cowswap order types helps place that behavior alongside market and TWAP execution.

How do you cancel the remaining amount?

Request cancellation through the venue or order book that holds the signed order, then confirm whether the request is off-chain or on-chain. In CoW Swap, an off-chain cancellation is sent to the order-book service and does not itself require a blockchain transaction. An on-chain cancellation costs gas and invalidates the order through an on-chain transaction.

Neither path guarantees the order stops at the moment you click. With off-chain cancellation, the order can be matched before the service processes the request. With on-chain cancellation, it can be matched before the invalidation transaction is confirmed. A winning match may also be in the process of settlement while the cancellation is pending. The cancellation status and the trade status therefore answer different questions: one concerns whether future fills are allowed, the other whether a fill already occurred.

For an on-chain CoW Protocol order using the pre-signature scheme, the relevant control is the settlement contract’s setPreSignature function with the order UID and false. This revokes the pre-signature that makes that order executable. Other signing schemes have different validation paths, so do not assume that revoking a pre-signature applies to every order. The interface’s on-chain cancellation option should select the appropriate method for the order.

How do you calculate what remains?

Start with confirmed execution data for the order, then compare the cumulative settled amount with the signed order amount. For a sell order, the remaining sell amount is the signed sell amount less the sell amount already executed. For a buy order, inspect both the remaining buy target and the maximum sell amount: the order’s constraints determine which side is the limiting quantity.

Use the order UID or equivalent order identifier to correlate fills and cancellation state. A transaction receipt or the venue’s trade history can confirm settlement; an open-order screen can lag because it depends on indexing and order-book updates. If those records disagree, avoid treating the displayed remainder as authoritative until the underlying fills and cancellation are reconciled.

Before submitting a replacement, check these points:

  • Which fills have settled on-chain, and what amounts were executed?
  • Has the cancellation been processed or confirmed for this order’s signing scheme?
  • Does the order still appear executable in the venue’s current order book?
  • Will the replacement sell only the intended remaining balance?

That last check prevents accidental overselling. A replacement for the full original amount can coexist briefly with the old order if cancellation is still pending. If both execute, the total sold can exceed the intended amount, up to the available balance and allowance constraints.

When should you replace the order?

Place a replacement only after you can account for settled fills and establish that the old remainder is no longer executable. Then choose whether to carry forward the same limit price or change it. A more aggressive price can improve the chance of execution, but it gives up some price protection; a stricter price preserves the limit while extending the wait.

Do not recreate a tiny remainder automatically. On CoW Protocol, a partially fillable limit order may leave dust that is not worth settling after fees. Compare the remaining amount with the practical cost and constraints of another settlement. If it is uneconomic, letting the remainder expire or remain unfilled may be cleaner than creating another order with the same execution problem.

The reliable sequence is simple: verify settled fills, request cancellation, wait for the relevant cancellation state, reconcile the remainder, then replace only that remainder if it is still worth trading. A cancellation request is an instruction in flight; the confirmed order state is what determines whether the old quantity can still execute.