Reference · FIX and API Reliability
Cancel/Replace Races: Handling Fills During an Amendment
Follow an order amendment through intervening fills, pending replacement and acceptance, preserving cumulative quantities and the confirmed order version.
Published Updated
Published by FxTrusts, a supplier of brokerage and prop firm technology. Prepared with AI-assisted research and drafting; reviewed against the cited public sources. Examples are illustrative. Product links describe our services.
What is Cancel/replace race?
A cancel/replace request asks to amend an order; it does not immediately change the working order. Fills can arrive while the request is pending. Preserve the original and requested versions, process intervening executions, then apply the counterparty's confirmed replacement or rejection without losing cumulative traded quantity.

Keep requested and confirmed terms separately
Record the current order identity, requested replacement identity, original client-order reference, old terms and proposed terms. An interface can display the pending request, but its exposure calculation must not assume the new terms already govern. A price or size amendment can be rejected after the operator sends it.
The FIX trade specification states that an order is not replaced until the replacement is explicitly accepted. It also describes cumulative quantities across versions. The order-state matrices illustrate fills during cancellation or replacement, so the event processor needs more than a linear new-to-amended-to-filled diagram.
Sources for this section
- FIX Latest EP284: Trade business-area specificationwww.fixtrading.org
- FIX Latest as of EP284 — Order State Changeswww.fixtrading.org
Apply fills to the correct history
When a fill arrives during the pending interval, record it against the order history and update the economic position once. Keep the fill's reported terms and identity; do not rewrite them to the requested price. Its cumulative quantity can reduce the amount left available under the proposed total quantity.
Clarify whether an amendment field means total order quantity or remaining quantity in the agreed dialect. In the FIX example used here, the replacement total includes executions already completed. Confusing total and remaining size can create an unintended larger order. A request below the amount already executed also needs the counterparty's documented handling rather than a negative leaves quantity.
Handle rejection, chaining and late responses
A rejected amendment leaves a result to reconcile with the current order, including fills that happened while it was pending. Preserve the rejection reason and the active order version. Do not restore an old cumulative quantity simply because the amendment failed.
Multiple overlapping amendments add another identity chain. Unless the counterparty explicitly supports a chaining pattern, wait according to its rules and test sequencing behavior before production. If a response arrives after reconnection, match it to the exact request rather than the latest screen state. A late cancellation acceptance cannot undo a fill that occurred before acceptance; any execution correction follows a different documented event.
Worked example: changing the total to 80
A fictional order has total quantity 100, cumulative fills 20 and remaining quantity 80. An amendment requests total quantity 80. Before acceptance, another fill of 15 arrives: cumulative fills become 35 while the original total remains 100. If the replacement is then accepted at total 80, remaining quantity is 45. The requested 80 was a new total, not an additional 80 units.
| Stage | Confirmed total | Cumulative fills | Remaining |
|---|---|---|---|
| Before request | 100 | 20 | 80 |
| Request for total 80 pending | 100 | 20 | 80 |
| Intervening fill of 15 | 100 | 35 | 65 |
| Replacement accepted | 80 | 35 | 45 |
Implementation checklist
- Retain old, requested and confirmed order versions.
- Confirm total-versus-remaining quantity semantics.
- Process intervening fills before reconciling replacement quantities.
- Test accepted, rejected and late-response paths.
- Separate order cancellation from trade cancellation or correction.
Sources
These documents support the reference. Check the original publication for current requirements and the limits of its scope.
- FIX Latest EP284: Trade business-area specificationwww.fixtrading.org
- FIX Latest as of EP284 — Order State Changeswww.fixtrading.org
Continue with the broader guides
Connect this reference to platform selection and the wider operating workflow.
