How Price Changes Interrupt FIFO
In previous lessons, execution followed a clear pattern:
- Price determined which orders were eligible.
- Time determined the execution sequence only when prices were equal.
- FIFO held because no better-priced orders appeared during execution.
In this lesson, that condition is intentionally broken.
A new order at a better price enters the book while older orders are still waiting.
This shows how price priority interrupts FIFO without violating it.
FIFO still applies — but only within the same price level.
The asks ledger contains two resting orders at the same price.
FIFO would apply if execution occurred now.
Stage 1. A Better-Priced Ask Arrives
Event: At a seller submits an order to sell 4 apples at $18
This price is better than the existing $20 asks.
No trade occurs yet.
However, the best ask price has changed.
Stage 2. A Buy Order Arrives
Event: At a buyer submits an order to buy 5 apples at $20
The buy price overlaps with multiple asks.
Execution can proceed.
Stage 3. Execution Proceeds by Price First
Execution rules still apply:
- Orders at better prices execute before orders at worse prices.
- Time is consulted only when prices are equal.
The presence of the $18 ask changes execution order.
Execution 1 — Better Price Interrupts FIFO
The best available ask price is now $18
4 apples are exchanged at $18
- A - the ask @ $18 is fully removed.
- B - the buy order is reduced from 5 to 1
- C - a trade is recorded at for 4 apples @ $18
The reported price is now $18
Execution 2 — FIFO Resumes at the Original Price
All remaining eligible asks are at $20
FIFO applies again within that price level.
The earliest $20 ask time D is
1 apple is exchanged at $20
- D - the ask @ $20 at is reduced from 2 to 1 apple.
- E - the buy order is fully executed and removed.
- F - a trade is for 1 apple recorded at @ $20
Execution stops because the incoming buy order has no remaining quantity.
Execution Summary
After execution:
- The better-priced ask @ $18 was executed before older $20 asks.
- FIFO among the $20 asks was temporarily interrupted.
- The earliest $20 ask was partially reduced.
- The later $20 ask was not touched.
Conclusion
FIFO is never violated — but it is subordinate to price priority.
Arrival time determines execution order only among orders at the same price.
When a better price appears, it supersedes time, regardless of arrival order.
Once execution returns to a single price level, FIFO resumes exactly where it left off.
This lesson completes the execution hierarchy:
- Price determines eligibility.
- Time determines sequence when prices are equal.
- Price changes interrupt FIFO without breaking it.
From this point forward, all execution behavior in the tutorial can be explained using these three rules alone.