Central Limit Order Book

March 1, 2024 - Rohan van der Walt

What's an Order Book?

More specifically, a Central Limit Order Book (CLOB), is used to keep track of trading participants' intent to buy or sell at various prices for each market that's traded on the exchange.


Order Book L2

An exchange is a central entity that facilitates centralised trading of various markets.

Members of the exchange can submit their orders to the exchange depending on the integration options provided by the exchange. (e.g REST, Websocket, FIX)

Background

I first used Order Books when I started streaming the Bitcoin orderbook for the local South African cryptocurrency exchange, Luno (back then it was "BitX").

While working on Position and Risk Management professionaly at a local investment bank, this gave me the rare chance to trade directly on an exchange without paying for expensive price feeds or high brokerage fees. Trying something like this on the JSE as a hobby project would've been impossible.

Once I collected some data, I started using statistical models to try my hand at systematic trading. This led me down an interesting path, that eventually brought me to Berlin. Working for a Hong Kong based cryptocurrency exchange, that was using FIS Cross-Asset Trading and Risk (formerly Front Arena)for Position and Risk management. Combining my professional and hobby interests.

Open APIs provided by all crypto exchanges make it very easy to collect data and start algorithmic trading. Providing a low barrier to entry for "professional" participants. I think the traditional finance institutions can learn a lot from this.

Order Types

Depending on the specific exchange and market, various types of orders can be placed. The simplest one being LIMIT Order.

A limit order is defined by side, price and amount.

  • Side : Buy or Sell
  • Price: The highest/lowest price you are willing to buy/sell for.
  • Amount: The number of units of the market underlying. Pay attention to "lot sizes" and "contract sizes" on some markets, especially for derivatives. But most of the time this is simply 1 to 1.

Exchanges and Brokers do offer more advanced order types as well, but they can differ from exchange to exchange. Here's an example of order types offered by Interactive Brokers

Orders are processed in sequence they are received by the exchange. This is why colocation is such an important topic for algorithic traders, especially market makers and other HFTs (High Frequency Traders)

When an order is received, it will first be evaluated against the resting orders on the orderbook for potential matches. Any remaining volume will then be inserted into the orderbook.

Realtime Order Book Feed Type

  • L1 - Best Bid and Offer only Most common, lightest bandwidth-wise, and easiest to handle.
  • L2 - List of prices and aggregated amounts for both bid and offer sides of the order book Requires special consideration during implementation depending on the exchange's protocol.
  • L3 - Complete list of orders on both bid and ask sides of the order book. Also requires special implementation considerations. Most detailed representation, usually including OrderIDs for each order.

Various types of market data feeds are available: REST (snapshots only), WEBSOCKET (realtime), or FIX (realtime). Common realtime feed protocol involves receiving an initial snapshot followed by delta updates. Algorithmic efficiency of used data structures are crucial.

It's also important to distinguish between orderbook feeds and OHLCV (Open High Low Close Volume) feeds. Most "historical data" downloads are provided as OHLCV over a fixed window size.

Visualising orderbook

This used to be something reserved for finance professionals. Thesedays it's easy to see on cryptocurrency exchanges. Example of Market Depth on Binance BTC/BUSD:


Depth Chart

Here's the pricing if you'd like to see this data for NASDAQ

Keywords:

#OrderBook #MarketData #Cryptocurrency #Exchange #MatchingEngine #AlgorithmicTrading