Skip to main content

6.1 Rationale for a CLOB Architecture

Parallelshots adopts a Central Limit Order Book rather than an automated market maker in order to achieve explicit price discovery, reduced slippage under size, and compatibility with professional trading strategies. In memecoin markets, where liquidity is often discontinuous and volatility is extreme, AMM-based curves introduce nonlinear execution costs and reflexive price distortions. A CLOB provides discrete pricing, transparent depth, and strict execution ordering, all of which are critical for leveraged trading systems. The CLOB is implemented as a logical construct maintained by the matching engine, while its economic effects are enforced by on-chain settlement. The blockchain remains the system of record for balances, margin, and positions, while the order book itself is treated as ephemeral state that can be reconstructed from signed orders and execution events.

6.2 Order Book Structure

For each market m, the order book is defined as two priority queues:
Each price level may contain multiple orders sorted by submission timestamp. An order is defined as:
Orders are immutable after submission except for remaining_quantity.

6.3 Price-Time Priority Enforcement

Execution priority is strictly defined as:
Formally, for two orders o1 and o2 on the same side:
No discretionary reordering or batching is permitted.

6.4 Matching Conditions

A match is executable when:
Execution proceeds iteratively:
The resting order defines the execution price to prevent price manipulation by aggressive orders.

6.5 Market Orders

Market orders are represented internally as limit orders with extreme price bounds:
They consume available liquidity until fully filled or until margin constraints are violated.

6.6 Risk-Gated Order Admission

Before insertion into the order book, each order must satisfy:
Orders failing pre-trade checks are rejected and never enter the book.

6.7 On-Chain Settlement Interface

Each executed trade is settled via a canonical interface:
Settlement updates:
  • Position size
  • Average entry price
  • Locked margin
  • Unrealized PnL
The CLOB itself cannot mutate balances.

6.8 Failure and Recovery Guarantees

If the matching engine halts:
  • No orders are lost
  • No balances are affected
  • On-chain state remains authoritative
The order book can be reconstructed deterministically from signed orders and executed trades.