Bids and asks
The order book has two sides:- Bids — buy orders, sorted from the highest price to the lowest. Buyers are willing to purchase the base asset at or below these prices.
- Asks — sell orders, sorted from the lowest price to the highest. Sellers are willing to sell the base asset at or above these prices.
Price levels
Each side of the order book is aggregated into price levels. A price level groups all open orders at the same price and reports the total liquidity available at that price.| Field | Type | Description |
|---|---|---|
price | DecimalPrice | Price ratio (quote per base unit) |
accumulated_liquidity | u64 | Total base asset available at this price, in lovelace or token units |
Spot price
Thespot field on the order book response is the price of the most recent trade for the pair. It reflects the last execution price, not the current best bid or ask. If no trades have occurred, spot is null.
Reading the order book
To interpret the order book:- The best bid is
bids[0]— the highest price a buyer will pay. - The best ask is
asks[0]— the lowest price a seller will accept. - A trade occurs when a new order crosses the spread (a buy order at or above the best ask, or a sell order at or below the best bid).
Get order book
Fetch a live snapshot of the order book for any trading pair.