Data Structures
This document details the core data structures used throughout the CLOB system.Order
The fundamental unit of trading in the system.Field Details
| Field | Type | Description |
|---|---|---|
user | address | Wallet address that owns the order |
id | uint256 | Unique identifier assigned on creation |
quantity | uint256 | Original order size in base currency units |
filled | uint256 | Cumulative filled amount |
price | uint256 | Limit price scaled by PRICE_SCALE |
expiry | uint256 | Unix timestamp; 0 means no expiration |
status | Status | Current lifecycle status |
orderType | OrderType | Limit (0) or Market (1) |
side | Side | Buy (0) or Sell (1) |
Derived Values
Pool / PoolKey
Identifies a trading pair in the system.Pool Identification
Pools are uniquely identified by their currency pair. The system enforces a canonical ordering to prevent duplicate pools:Example Pools
| Base | Quote | Market |
|---|---|---|
| WETH | USDC | ETH/USDC |
| WBTC | USDC | BTC/USDC |
| ARB | WETH | ARB/ETH |
TradingRules
Defines the trading parameters for a pool.Field Details
| Field | Description | Example |
|---|---|---|
minTradeAmount | Smallest executable trade | 0.001 ETH |
minAmountMovement | Quantity must be multiple of this | 0.0001 ETH |
minPriceMovement | Price must be multiple of this | 0.01 USDC |
minOrderSize | Smallest allowed order | 0.01 ETH |
maxOrderSize | Largest allowed order | 1000 ETH |