Introduction to order book, market order and limit order
An order book is a list of buy and sell orders. Market orders execute a trade immediately, while limit orders execute it at a specific price.
In this article, we provide an overview of the Order Book and the two basic order types: the Market Order and the Limit Order.
The central limit order book, or more commonly known as just the “order book” can be compared to a real-time auction. Anyone that wants to buy or sell can show up and offer their best price.
There are three parts in the order book: buyers, sellers and the spread.
Buyers are referred to as bids. They’re making an offer to buy an asset at a given price. Think of a bid as a buy: someone bids on an auction because they want to buy it.
The highest price anybody is willing to list it is referred to as the best bid.
Sellers are referred to as asks. They’re making an offer to sell an asset at a given price. Think of an ask as a sell: someone is asking for this price because they want to sell it.
The lowest price anybody is willing to list it is referred to as the best ask.
There is a small gap between the best bid and the best ask. This gap is referred to as the spread.
The spread is the difference between the highest bidder (buyer) and the lowest asker (seller). This gap may differ from exchange to exchange, and there may be a minimum spread that exchanges allow for Spot or Futures contracts.
Note: The middle of the spread is referred to as the mid-price. The mid-price is halfway between the best bid and the best ask. The best prices available are sometimes also referred to as top of book, or front of book.
Market order and limit order
Every time a trade is matched, it involves one person accepting the best available price. The act of taking that price in the order book is referred to as crossing the spread.
- The person who has crossed the spread is called the taker, because they took liquidity from the order book.
- The person who has its limit order accepted is called the maker, because they made liquidity in the order book.
There are two ways a person can participate in the order book: using a market order, or a limit order.
A market order is when a trader accepts the best available price. The trade is matched instantly. It’s like the Buy Now (1 click) button on Amazon. Traders choose the market order when they want speed of execution.
When a trader places a market order, it automatically starts at the best bid or the best ask. Then it works its way through the order book until the order is filled.
The exchange’s liquidity is usually used with the word depth, as in “the exchange has deep liquidity”. This depth refers to the amount of contracts available at a given price. It’s the dollar value of contracts traders can get matched at that price.
When someone says “XYZ exchange has deep liquidity”, it means there is a high amount of limit orders on either side of the mid-price. It can be seen by constant action of the order book as shown in the image below.
If a trader was to place a market order, it would not go far beyond the best bid or ask to fill (the best ask).
If a trader has a market order that is larger than the best bid or ask, the system buys everything available at the best price at the time, and then the next price and so on, until the order is filled or until it hits the 1% limit (usually, for most exchanges).
Note: It’s common on Futures contracts for market orders to be limited to 1% worse than the best bid or ask. This means a market order cannot hit a price that’s worse than 1% of the best available price. This feature exists to protect traders from things like slippage and “fat finger trade” (trader mistakes).
The slippage is when a market order is much larger than the best bid or ask, and therefore the average fill price will be slightly worse.
Let’s look at an example of doing a market order on an exchange’s order book.
We’re going to buy 1000 USD worth of BTC at the market price. Since we are buying, and doing a market order, we will be buying from the best ask (the top row of the ask column).
The best ask entry sets 1 BTC = 21,455 USD, with 5,532.8 USD worth of BTC available.
What happens when we click the buy button?
After clicking the buy button, the system buys 1,000 USD from the 5,532.8 USD available, leaving 4,532.8 USD (5,532.8 - 1000 = 4,532.8) worth of BTC left at that price point (1 BTC = 21,455).
Now let’s look at the example of slippage occurring in an order. Let’s recall that slippage is when an order is placed that’s larger than the best bid or ask available amount.
What would happen if, instead of 1,000 USD, we bought 22,000 USD worth of BTC?
The system would put us at a price of 21 458 BTC, third row from the top. This is because reaching the third row is necessary to fill our 22,000 order, as the first two rows amount to 5,532.8 + 14,539.0 = 20,071.8.
We would buy 22,000 USDC worth of BTC at a price point of 21 458 (third row), and not 21 455 (first row). In the previous example we placed a smaller order of 1000 USDC, which got filled in the first row.
That is the slippage.
A limit order is when a trader chooses the price they’d like to get matched at.
- If a trader chooses a price that’s better than the current best bid or ask, the order will enter the order book and wait to be matched.
- If a trader chooses a price that’s worse than the current best bid or ask, the order will enter the order book and get matched immediately.
All the orders in the order book are other traders’ existing limit orders.
Traders can set the limit price anywhere, change it or withdraw it at any time, until they’re matched. The closer they are to the best bid or ask, the higher the chance that somebody else matches their limit order.
Let’s look at an example of a limit order.
We’re doing a limit order for 1000 USDC and selecting the limit price we’re willing to pay for. We do this by clicking on the best bid of 21 515 per BTC, which is the top row of the green bid column of the order book.
After placing the order, it will show up in the chart as well as an open order in a location below, depending on the interface of the exchange.
This buy limit order will be filled once it matches orders on the other side of the order book, i.e. once the order is filled on the ask side from traders who set sell limit orders.
In this article, we went over the order book and its two most basis orders: the market order and the limit order.
The order book is the live list of all limit orders from all traders on the exchange. It consists of bids, asks and the spread.
A market order is a firm offer to buy or sell the asset at the best available price on offer. The advantage is speed, as the order is matched instantly.
A limit order is a firm offer to buy or sell an asset at a specified price by the trader. There may be a small rebate if the limit order stays on the order book and then filled.