How Exchanges Work

Lesson 3 of 20, about 16 minutes

What you will learn

  • Follow an order from your brokerage app to the exchange
  • Read a basic order book and tell a bid from an offer
  • Use price-time priority to work out which order fills first
  • Describe what clearing and settlement do, and what T+1 means

When you tap buy in a brokerage app, the app sends your order to an exchange. The exchange uses a set of rules to match it with an order from someone who wants to sell. The process continues after the match, because the buyer still needs to receive the shares and the seller still needs to receive the money.

How does the stock market work?

Finance & Quant Society made this overview of how a stock market works.

The order book

A modern exchange keeps an order book: a live list of buy and sell orders waiting to be filled. The exchange sorts those orders by price and updates the list as traders add, fill, or cancel orders.

Key terms

Order book
The live list of all waiting buy and sell orders for a security, organized by price.
Bid
A buy order. It shows the price a buyer is willing to pay and how many shares they want.
Offer (also called the ask)
A sell order. It shows the price a seller wants and how many shares they are selling.
Fill
The completion of an order. A partial fill means only some of your shares traded.

The table shows a small order book for an imaginary stock. The highest price offered by a buyer sits below the lowest price a seller will accept. That gap is the spread, which you will study in another lesson.

A simple order book snapshot (imaginary stock)
SidePriceShares waiting
Sellers (offers)$50.12200
Sellers (offers)$50.11100
Buyers (bids)$50.09150
Buyers (bids)$50.08300

Price-time priority

Most exchanges use price-time priority to decide which order trades next. Price comes first: the highest bid and lowest offer move to the front of their lines. If several orders have the same price, the exchange fills the oldest one first. A better price earns priority, and speed matters when prices are tied. This is one reason firms spend heavily on faster trading systems.

  • A trade takes place when a buyer will pay at least the price a seller asks. The orders cross and execute.
  • If no one accepts your price, the order waits in the book until someone does or you cancel it.
  • Orders can arrive, fill, and disappear thousands of times each second, so the book keeps changing.
Worked example

Walking a market buy through the book

Using the order book above, you place a market order to buy 250 shares. A market order takes the best available sell prices, starting with the cheapest offer.

  1. Take the best offer. The lowest sell price is $50.11, with 100 shares available. Your order takes all 100.
  2. Move to the next offer. You still need 150 shares. The next offer has 200 shares at $50.12, so your order takes 150.
  3. Check the total. The 100 shares at $50.11 and 150 shares at $50.12 fill all 250 shares.
Result: You bought 250 shares, 100 at $50.11 and 150 at $50.12, for an average of about $50.116 each.

Why it matters: A large order may use all the shares at the best price and then move to a worse one. The difference between the expected price and the actual result is called slippage.

Calculation

Which level fills the rest?

Same order book. The best offer is 100 shares at $50.11, and the next is 200 shares at $50.12. You send a market buy for 250 shares. How many of your shares are filled at the $50.12 level?

Need a hint?

First take everything at the cheapest price, then see how many shares you still need.

Decision scenario

Whose order trades first?

Two sellers are waiting. Seller A offers 100 shares at $50.11 and placed the order at 9:45. Seller B also offers 100 shares at $50.11 but placed the order at 9:47. A buyer arrives willing to buy 100 shares at $50.11. Whose shares trade?

Clearing and settlement

A match on the exchange starts the trade, but two more steps finish it. Clearing calculates what each side owes. Settlement transfers the shares to the buyer and the money to the seller. A central clearinghouse stands between the two sides and guarantees completion even if one side fails to deliver. That guarantee reduces the risk of a failed trade.

A standard US stock trade settles one business day after it takes place. Traders call this T+1. If you buy shares on Monday, the shares and cash officially change hands on Tuesday. Your screen shows the trade at once, while settlement happens later.

How does the stock market work? (TED-Ed)

TED-Ed reviews the exchange as a whole. Use it if you want to see the order process a second time.

The exchange matches the orders. The clearinghouse makes sure the trade finishes.
Reflection

Explain what happens to an order

In your own words, follow an order from the moment you tap buy until the shares belong to you. Use the words order book, cross, and settlement.

Write an answer before comparing it with the model response.

You can now follow an order through matching, clearing, and settlement. The next lesson explains where new shares come from and how later trades between investors differ from the original sale.

Quiz

This lesson ends with a 5-question quiz. Create a free account or sign in to take it, save your progress and earn points.