ECON5149 Chap.5 Orders, the Limit-Order Book and Matching
Orders, the Limit-Order Book and Matching
Orders, the Limit-Order Book and Matching builds the trading institution of the course's artificial market before any trader behaviour is added. A trader holds cash and shares, and a trade simply moves both between two balance sheets, so marked-to-market wealth is unchanged at the moment of the fill. Whether an order is even allowed depends on stated rules about borrowing and short selling.
Orders are messages to an exchange: side, quantity, limit price and arrival time. Under a continuous double auction every arrival is checked at once against the best quote on the opposite side; a compatible pair trades and an incompatible order joins the book. Bids are ranked from highest down and asks from lowest up, with earlier orders first at any shared price.
The fill happens at the price of the order that was already waiting, which is why a seller asking little can still be paid more. The chapter separates several prices that students often merge: last trade, best bid, best ask, mid-price, a fundamental benchmark and private valuations.
It then traces an original six-order sequence by hand and shows that quotes and the spread change at every arrival even though prices print only at matches.
What this chapter covers
- 01
Cash, inventory and mark-to-market wealth
- 02
Borrowing and short-sale feasibility rules
- 03
Last price, best bid, best ask, mid-price and valuations
- 04
Limit orders, market orders and crossing the book
- 05
Continuous double auction versus call auction
- 06
Depth ladders and the bid-ask spread
- 07
Price-time priority and the resting-order price
- 08
Hand-tracing an order sequence and the state it leaves behind
Worked example · free
Read a depth ladder and route two orders
- 2The highest bid is 118 and the lowest ask is 121, so the spread is 121 minus 118 = 3 and the mid-price is (121 + 118)/2 = 119.5.
- 2The buy limit of 122 is at least the best ask of 121, so it crosses and fills against the earlier of the two asks at 121, at the waiting order's price of 121.
- 1One ask remains at 121, so the best ask and the spread of 3 are unchanged after the trade.
- 1The sell limit of 119 is above the best bid of 118, so it cannot trade; it joins the ask side and becomes the new best ask, leaving a spread of 119 minus 118 = 1.
Key terms
- Limit-order book
- The organised record of buy and sell limit orders that have been submitted but have not yet traded or been cancelled.
- Price-time priority
- The ranking under which better prices are matched first and, at equal prices, the earlier order is matched first.
- Resting order
- An order already waiting in the book at the moment a new order arrives.
- Marketable limit order
- A limit order whose price is compatible with the best opposite quote, so it can execute immediately.
- Bid-ask spread
- The best ask minus the best bid, defined only when both sides of the book hold orders.
Orders, the Limit-Order Book and Matching FAQ
Why does a buyer who bids 122 sometimes pay only 121?
The common convention prices a trade at the order that was waiting in the book. A bid of 122 states the most the buyer will accept paying; if a seller was already offering 121, that seller's price is used, so the newcomer receives a better deal than its own limit required.
Is the mid-price the market price in this model?
No. The mid-price is an average of the two best quotes and only exists when both sides hold orders. Nothing trades at it automatically. The recorded transaction price changes only when a compatible pair of orders actually executes, so quotes and prints can drift apart.
Do the borrowing and short-sale rules change results or only the code?
They change the economics. With them, cash and share holdings limit which orders a trader can send, so some orders never reach the book. Without them, holdings can go negative, which keeps a price-formation model simple but would be wrong for questions about leverage or default.
What should a hand trace record after every arrival?
Record the side, the opposite best quote, whether the crossing test passes, which waiting order fills and at what price, where an unfilled order is placed, and the new best bid, best ask and spread. Those six items make each step checkable and translate directly into the Lab 2 matching code.
Exam move
Start by drawing a blank ladder with prices down the middle, bids on the left and asks on the right, and practise filling it from a written list of orders until reading off the both best quotes, the spread and the mid-price takes seconds. Next, write the two crossing inequalities from memory: an incoming buy trades when its limit is at least the best ask, an incoming sell when its limit is at most the best bid.
Say aloud which order sets the fill price each time, because swapping the incoming limit for the waiting price is the most common slip. Then invent your own sequence of six to eight one-share orders, include at least one tie at a price so that arrival order decides the fill, and trace it with a table of side, opposite quote, test result, fill price and new quotes.
Plot the best bid and best ask after each event and mark the trades; check that some arrivals move the quotes without printing a price. Add balance sheets for two traders and confirm that cash and shares are conserved across every trade, since that conservation test is how you will verify your Lab 2 code.
Finally, rehearse a short written explanation of why a continuous double auction differs from a call auction and why separating trader behaviour from the institution lets a modeller study each part on its own. For the 90-minute in-person degree exam, practise turning each traced step into one precise sentence, because analysis questions reward stating the rule before applying it.
Working through Orders, the Limit-Order Book and Matching in ECON5149? Sia is AskSia’s AI Economics tutor — ask any ECON5149 Orders, the Limit-Order Book and Matching question and get a clear, step-by-step explanation grounded in how ECON5149 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.
ECON5119 Applied Time Series and Forecasting · ACCFIN5249 Investment Analysis and Asset Allocation