How does the order book work

2025-09-01 UTC
27480 Read
6

What is the order book?

The order book is essentially a list that contains the current buy orders (Bids) and sell orders (Asks) for a specific asset in the market. It not only displays the prices that buyers and sellers are willing to accept, but also shows the order amount they expect to buy or sell at each price.

  • Sell orders (Asks): Typically, the top of the order book shows the sell orders, where the order with the lowest price is called the "Lowest Ask" or "Sell 1".
  • Buy orders (Bids): The bottom of the order book shows the buy orders, where the order with the highest price is called the "Highest Bid" or "Buy 1".

Order matching principle

The matching system executes orders based on the "best price and earliest time" rule:

  • The best price: For buy orders, the highest-priced order is matched first; for sell orders, the lowest-priced order is matched first.
  • The earliest time: When two orders have the same price, the order placed earlier will be executed first. In actual trading, if an order with the same price as your order price is executed but your order remains unfilled, it indicates that there are orders placed earlier with the same price.

Different types of order matching

When a user places an order, the exchange will place the order in the corresponding position in the order book based on its order type and price, and execute the matching process.

  • Market order: If the user places a market order, it means the order will be executed immediately at the best available market price. The system will directly find the matching counterparty order in the order book, execute the trade, and update the order book and market data.
  • Limit order: If the user places a limit order with a specific price (when you need to enter the order price) to buy or sell, the system will check if there are counterparty orders that match or offer a better price. If a match is found, the trade will be executed, and the order book and market information will then be updated. If no matching order is found, the limit order will be added to the order book, waiting for a suitable counterparty, or to be canceled by the user.

Gate preserves the final right to interpret the product.

Sign up now for your chance to win up to $10,000!
signup-tips