University of Glasgow · FACULTY OF ECONOMICS

ECON5149 Chap.5 Orders, the Limit-Order Book and Matching

- one subject, every graph, every model, every mark
8 Chapters5-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 5 of 11 · ECON5149

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.

In this chapter

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

Q [6 marks]. A book holds one-share bids of 1 at 118, 2 at 117 and 2 at 116, and asks of 2 at 121, 1 at 122 and 3 at 123. State the highest bid, the lowest ask, the gap between them and the mid-price. Then a buy limit at 122 arrives, followed by a sell limit at 119. Say what happens to each and give the final quotes. The mark allocation was written for revision and is not published by the course.
Each block is one resting one-share order at the price in the centre column, bids to the left and asks to the right.Each block is one resting one-share order at the price in the centre column, bids to the left and asks to the right. Notice the empty row at 64: best bid 63 and best ask 65 leave a spread of 2 around a mid-price of 64.61626364656667spread 2mid-price 64bid depthask depth
Each block is one resting one-share order at the price in the centre column, bids to the left and asks to the right. Notice the empty row at 64: best bid 63 and best ask 65 leave a spread of 2 around a mid-price of 64.
  • 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.
Initial quotes are 118 and 121 with spread 3 and mid-price 119.5. The buy fills at 121, not 122, and the later sell at 119 rests as the new best ask, so the book ends with best bid 118, best ask 119 and spread 1. The mark allocation is an original practice weighting, not a university marking scheme.
Sia tip — Before writing any fill price, point to the order that was already waiting and copy its price, never the newcomer's limit.
Glossary

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.
FAQ

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.

Study strategy

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.

A+Everything unlocked
Unlocks this Bible + all 26 of your subjects at University of Glasgow, plus 1,000+ more Bibles across the AskSia library.
Sia - your ECON5149 tutor, unlimited, worked the way the exam marks it
The full 5-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works