How does a stock exchange really work?

Updated  
August 28, 2024
We explain what happens when you buy and sell stocks and shares and the fundamental process behind stock exchanges.
We explain what happens when you click 'Buy'

Stock exchanges are the soul of the stock market.

Most people have a sort of idea of how an exchange might work but the real mechanisms that drive them can be a bit more obscure. Here are the basics!

Let’s dive in

A stock exchange is a pure vehicle of supply & demand. Historically, stock exchanges operated like bustling medieval markets or chaotic bazaars. Traders would shout out prices and deal directly with each other.

There are a small handful of exchanges which still have dealing pits like this, notably the London Metal Exchange. Now though, the vast majority of modern exchanges work purely electronically.

However, the underlying principle is still the same.

Institutional and professional investors, like bank traders, fund managers or highly committed personal traders, set their own prices at which they’re willing to buy and sell. The prices they set will usually be influenced by current prices, but it’s ultimately up to them. These orders all go onto the exchange’s ledger — a list of all buying and selling interests — which is called the order book.

An electronic system called a matching engine then matches up buyers and sellers on the book and completes the orders.

A super simple example

A buyer wants to buy 200 shares of Delicious Lemonade PLC. Based on his analysis and knowledge that everyone else is paying £98 — £102/share, he’s willing to buy at £100 a share and registers that interest on the order book.

If there’s someone who wants to sell 200 shares at £100 on the order book already then no problem at all. But it doesn’t necessarily line up so smoothly.

Let’s say instead there is a seller for 100 shares at £99, which is lower than the buyer’s price. Great!

However, our buyer wants 200 shares. There is another seller of 100 shares but she’s holding out for a better price: £101. However, the matching engine can combine those two sellers for an average cost of £100/share and fulfil the order.

What if there aren’t enough sellers to fulfil at £100/share and the only people selling want £102? If the buyer really wants the shares, he’ll put up a new order at £102 and pay more. That’s how the market price goes up.

Aggregated together, the most recent transactions like this create and shift the market price of a stock.

What if the buyer thinks the lemonade business is overrated and doesn’t want to pay a penny more than £85/share, while everyone else is paying around £100. Well, he can still place that order on the order book and wait to see if anyone takes him up. It’s unlikely unless conditions change, but it can happen.

However, his opinion and lowball price won’t normally have any direct impact on the market price until someone actually sells to him at £85/share.

Market makers

The order book is the main method for matching buys and sells efficiently. However, most exchanges also have other mechanisms to keep transactions moving smoothly.

This is where market makers come in.

Market makers are financial firms that agree to take the other side of orders to buy or sell certain stocks. They help make markets more liquid, meaning everyone is able to buy and sell relatively quickly. Liquidity is the extent to which a market lets you buy and sell at stable prices.

In a liquid market, you can buy and sell without worrying too much about whether your order will be matched or whether your transactions will dramatically shift prices. Market makers provide a constant flow of supply and demand. Buyers don’t have to depend on there being available sellers at the exact moment they want to purchase and vice versa.

Market makers quote a bid-offer spread: a lower price they’ll buy at and a higher price they’ll sell at.

Bid: I’ll buy this stock from you for e.g. £99

Offer: I’ll sell the same stock to you for e.g. £101

They don’t take a positive or negative position on the assets they cover; instead they aim to end up neutral and make money on the difference between their buying and selling price.

There are many different types of market maker and their exact role and obligations vary in different countries or exchanges. However, there are usually limitations on the transaction size they have to undertake.

They’re middlemen, but very useful ones.

Push it to the limit

Some brokerage platforms allow you to sit on the order book and set your own price too. These are commonly known as limit orders and stop losses. With a limit order, you set the price at which you’re happy to buy or sell and your order will go through if/when market price hits that level or better.

With a stop loss, you set a price at which you want to sell off your stock and likewise your broker automatically tries to sell it if the price declines to that point.

OK you’re (mostly) set

This is very much a simple overview of how exchanges work. Due to centuries of financial innovation, there are get-outs, nuances and counter-examples to fill textbooks!

However, this is the fundamental process: prices driven by the order book and the whole process kept in a steady flow by market makers. 💪

Learn more:

How to invest in stocks and shares

Savings vs investing - which is better?

Detailed guide to investment risk

How to choose the best investment app

Freetrade is on a mission to get everyone investing. Whether you’re just starting out or an experienced investor, you can buy and sell thousands of UK and US stocks, ETFs and investment trusts commission-free on our trading app. Download the Freetrade app today and join over 850,000 retail investors.


Pick the plan that suits you best
Save 17% when you choose an annual subscription.
Basic
£0.00
/Month
Accounts
  • General Investment Account
Benefits
  • A great way to try Freetrade before transferring your ISA or pension
  • Unlimited commission-free trades. Other charges may apply.
  • Trade USD and EUR stocks at the exchange rate + 0.99% FX fee
  • Access to a selection of Freetrade’s 6,200+ global stocks and ETFs
  • 1% AER on up to £1,000 uninvested cash
  • Fractional US shares
  • Access to mobile app and web platform
Standard
£4.99
/Month
£59.88 billed annually
Accounts
  • General Investment Account
  • Stocks and shares ISA
Everything in Basic and:
  • Access to 6,200+ stocks and ETFs
  • A lower FX fee of 0.59% on non-GBP trades
  • 3% AER on up to £2,000 uninvested cash
  • Automated order types, including recurring orders
  • More stats and analysis, including analyst ratings and EPS estimates 
Plus
£9.99
/Month
£119.88 billed annually
Accounts
  • General Investment Account
  • Stocks and shares ISA
  • Personal pension
Everything in Standard and:
  • A lower FX fee of 0.39% on non-GBP trades
  • Priority customer service
  • 5% AER on up to £3,000 uninvested cash
  • Free, same day withdrawals
Basic
£0.00
/Month
Accounts
  • General Investment Account
Benefits
  • A great way to try Freetrade before transferring your ISA or pension
  • Unlimited commission-free trades. Other charges may apply.
  • Trade USD and EUR stocks at the exchange rate + 0.99% FX fee
  • Access to a selection of Freetrade’s 6,200+ global stocks and ETFs
  • 1% AER on up to £1,000 uninvested cash
  • Fractional US shares
  • Access to mobile app and web platform
Standard
£5.99
/Month
billed monthly
Accounts
  • General Investment Account
  • Stocks and shares ISA
Everything in Basic and:
  • Access to 6,200+ stocks and ETFs
  • A lower FX fee of 0.59% on non-GBP trades
  • 3% AER on up to £2,000 uninvested cash
  • Automated order types, including recurring orders
  • More stats and analysis, including analyst ratings and EPS estimates 
Plus
£11.99
/Month
billed monthly
Accounts
  • General Investment Account
  • Stocks and shares ISA
  • Personal pension
Everything in Standard and:
  • A lower FX fee of 0.39% on non-GBP trades
  • Priority customer service
  • 5% AER on up to £3,000 uninvested cash
  • Free, same day withdrawals

You’re just minutes away from commission-free investing

When you invest, your capital is at risk