Central Limit Order Book
Boros implements a gas-optimized central limit order book (CLOB) specifically designed for the EVM. The order book architecture minimizes gas costs through lazy settlement and efficient data structures while maintaining the functionality expected from professional trading platforms.
Order Book Structureβ
The order book consists of two independent sides:
- Long Side (Bids): Orders to buy/go long on interest rates
- Short Side (Asks): Orders to sell/go short on interest rates
Each side contains 65,536 discrete rate levels (ticks) ranging from -32768 to 32767.
The tick system uses an exponential function to map discrete tick indices to interest rates. This design provides:
- Compactness: Entire rate range expressed with just 16 bits
- Expressiveness: Finer granularity near zero, coarser at extremes
- Symmetry: Equal precision for positive and negative rates
The tick spacing is configurable per market via the tickStep parameter. A larger tickStep creates wider rate intervals between ticks, suitable for more volatile markets.
Tick vs Rateβ
Ticks are for the order book only. The order book uses integer tick values to represent discrete rate levels. The AMM, on the other hand, operates with continuous rates (not ticks). This distinction is important:
- Order placement requires an integer
tickvalue β you cannot place orders at arbitrary rates - AMM implied rate is a continuous value and does not correspond to any specific tick
- Mid APR is typically
(bestBid + bestAsk) / 2or the AMM implied rate, which is a continuous value that generally cannot be expressed as an integer tick - When converting a rate to a tick for order placement, you must round to the nearest valid tick β this introduces a small rounding difference
Tick to Rate Conversionβ
The conversion between tick indices and interest rates follows an exponential formula: