In order to understand how an orderbook works, you must first understand its four concepts which are bid, ask, quantity and spread.
- The bid is a price (labelled in green) offer given by the buyer to purchase.
- The ask is a price (labelled in red) offer given by the seller to sell.
- The quantity is the amount the buyer is willing to buy, or the seller is willing to sell.
- The spread is the difference between the Ask and Bid price. An orderbook contains all the bids and asks from traders, and once the bid matches the ask, the trading engine will execute the order.
If a user buy/sell at a market order, the order will immediately be filled at the best available price on the orderbook.