FIFO Applies Even When Orders Are Partially Executed

Reading time: 2.5-3.5 min

In previous lessons, execution occurred at a single price and followed the arrival time exactly.

In those examples, earlier orders were fully exhausted before later orders were touched.

In this lesson, the same price and time rules apply — but the incoming order is not large enough to fully consume all eligible orders.

This reveals how time priority persists through partial execution.

Stage 1. Multiple Asks at the Same Price, Different Times

Event: Two ask orders arrive, both at $20 for a total of 11 apples.

The first order arrives at the second arrives at

Both new asks share the same price.
They differ only by arrival time.

No trade occurs yet.

Stage 2. A Smaller Buy Order Arrives

Event: At a buyer submits an order to buy 10 apples at $20

The buy price overlaps with multiple asks.
Execution can proceed.

Stage 3. Execution Proceeds by Time Priority

Execution follows the same rules used throughout the tutorial:

  1. Orders at better prices execute before orders at worse prices.
  2. When prices are equal, earlier arrival executes first.

Execution 1

The earliest ask that overlaps incoming bid is order at @ $15 for 7 apples.

  • A - 7 apples are taken from the ask recorded at The order is consumed.
  • B - the $20 bid order's amount reduced from 10 to 3
  • C - a trade is recorded at @ $15 for 7 apples.

D - the earliest ask timestamp at $20 is now.

The latest reported price is $15

Execution 2

All remaining eligible asks are priced at $20
Arrival time determines execution sequence.

The earliest $20 ask is

3 apples are exchanged at $20

  • E - the buy order is fully executed and removed.
  • F - the ask’s amount recorded at is reduced from 5 to 2
  • G - a trade is recorded at for 3 apples @ $20

The latest reported price is $20

Execution Summary

After execution:

  • The ask @ $15 was fully consumed.
  • The earliest ask @ $20 was partially consumed.
  • The later ask @ $20 was not touched.
  • The buy order @ $20 was fully removed.

Conclusion

FIFO rule does not weaken or reset when execution becomes partial.

When multiple eligible orders share the same price, arrival time continues to determine execution sequence, even if only part of an order is executed.

Earlier orders are always evaluated first.
Later orders are reached only if the quantity remains.

Partial execution preserves time priority rather than overriding it.

This completes the definition of FIFO behavior under both full and partial execution conditions and closes the price–time execution model used throughout the tutorial.