How does a stock exchange really work?

We explain what happens when you click 'Buy'
August 23, 2018

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.

Image for post

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.

Image for post

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.

Image for post

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

This should not be read as personal investment advice and individual investors should make their own decisions or seek independent advice. This article has not been prepared in accordance with legal requirements designed to promote the independence of investment research and is considered a marketing communication.

When you invest, your capital is at risk. The value of your portfolio can go down as well as up and you may get back less than you invest. Past performance is not a reliable indicator of future results.

Freetrade is a trading name of Freetrade Limited, which is a member firm of the London Stock Exchange and is authorised and regulated by the Financial Conduct Authority. Registered in England and Wales (no. 09797821).


Thank you! Please check for your confirmation email.
Oops! Something went wrong while submitting the form.

Sign up to get stories first

You're all signed up!