What is an Order Book?
An orderbook is a real-time list of buy and sell orders for a specific trading pair, organized by price level. Unlike AMM-based DEXs that use liquidity pools, orderbook exchanges match buyers and sellers directly, providing:- Precise price discovery through active market participation
- Deep liquidity with transparent market depth
- Advanced order types for sophisticated trading strategies
- Professional trading experience similar to centralized exchanges
Order Book Structure
The orderbook displays two sides:- Bids (Buy Orders) - Orders to purchase tokens at specific prices
- Asks (Sell Orders) - Orders to sell tokens at specific prices
Visual Representation
An order book depth chart dynamically shows the list of bids and asks for a specific trading pair. The buys are typically shown in green on the left, and the sells are shown in red on the right.
Figure 1: Order book depth chart showing bids in green and asks in red. The x-axis represents unit price, and the y-axis shows cumulative order depth. (Reference)
Order Types
Lightbeam supports three primary order types designed for different trading strategies:π Market Orders
Market orders execute immediately at the best available price in the orderbook. Key Features:- Instant execution - Trades execute immediately
- Price impact - May move the market price on large orders
- Best for - Quick entries/exits when speed matters more than exact price
- You specify the amount you want to buy or sell
- The order matches against the best available prices
- Execution happens instantly at current market rates
Market orders guarantee execution but not price. In volatile markets or with large orders, you may experience slippage from the expected price.
β‘ Limit Orders
Limit orders allow you to set a specific price at which youβre willing to buy or sell. Key Features:- Price control - You set the exact execution price
- No guarantee - May not execute if price isnβt reached
- Best for - Patient traders who want specific entry/exit prices
- Execute at your specified price or lower
- Only fill when market price drops to your target
- Great for buying dips or entering positions at support levels
- Execute at your specified price or higher
- Only fill when market price rises to your target
- Perfect for taking profits at resistance levels
- Partial fills - Large orders may execute in multiple smaller trades
- Time in force - Orders remain active until filled or canceled
- Cancel anytime - Unfilled orders can be canceled with no fees
π Grid Trading (Automatic Liquidity)
Grid trading automates your trading strategy by placing multiple buy and sell orders across a price range. Key Features:- Automated trading - Continuously buys low and sells high
- Range-bound strategy - Profits from price oscillations
- Hands-off approach - Works 24/7 without manual intervention
- Set Price Range - Define upper and lower price boundaries
- Grid Distribution - System places multiple orders across the range
- Automatic Execution - When orders fill, new orders are placed automatically
- Profit Capture - Each completed cycle captures the spread as profit
- Market making - Provides liquidity to the market
- Consistent returns - Profits from volatility in sideways markets
- Risk management - Positions are automatically managed
- Compound growth - Profits are reinvested into new grid orders
- Range-bound assets with regular volatility
- Markets with predictable support/resistance levels
- Pairs with sufficient trading volume and liquidity
Grid trading works best in volatile but range-bound markets. Trending markets may result in the grid being βleft behindβ if prices move significantly outside the range.
Order Book Terminology
Bid-Ask Spread The difference between the highest bid and lowest ask price. Tighter spreads indicate better liquidity. Market DepthThe total volume of orders at various price levels. Deeper markets can handle larger trades with less price impact. Top of Book The best bid (highest buy order) and best ask (lowest sell order) prices currently available. Price Levels Specific prices where orders are grouped. Multiple orders at the same price create a price level. Order Size The quantity of tokens in an order. Larger orders may require multiple matches against smaller orders.

