Every market on Nexwest has a single central limit order book. Orders are matched continuously in price-time priority. The book is part of consensus state, not an offchain cache.
Matching rules
- Price priority. The best bid and best ask are matched first.
- Time priority. At the same price, the earliest accepted order fills first.
- Maker/taker. The resting order is the maker; the incoming order is the taker.
- Self-trade prevention. An account cannot match its own order. The older order is canceled by default; see self-trade prevention.
Order identifiers
| Identifier | Type | Scope |
|---|---|---|
oid | integer | Assigned by the exchange, unique per market |
cloid | 128-bit hex | Client-supplied, unique per account |
asset | integer | Market identifier |
Use cloid for idempotent order placement. If a request is retried with the same cloid, the exchange returns the existing order instead of creating a duplicate.
Book snapshots
The l2Book endpoint returns aggregated levels:
{
"coin": "BTC-PERP",
"time": 1762732800123,
"levels": [
[["104279.5", "0.842", 4], ["104278.0", "1.204", 7]],
[["104281.0", "0.514", 3], ["104282.5", "0.987", 9]]
]
}Each level is [price, size, orderCount]. Bids are first, asks second, both sorted best-first. Use nSigFigs and mantissa to request aggregated precision.
Snapshot + stream
Do not poll l2Book for real-time data. Subscribe to the l2Book WebSocket feed, which sends a snapshot followed by deltas. Reconnect and resnapshot after any gap.
Depth and tick size
Price must be a multiple of the market tick; size must be a multiple of the lot size. The metadata endpoint returns both:
| Field | Meaning |
|---|---|
szDecimals | Maximum decimal places for size |
maxLeverage | Maximum leverage for the market |
tickSize | Minimum price increment |
lotSize | Minimum size increment |
Sending an invalid tick or lot returns 400 with Invalid price or Invalid size. See assets and tick sizes.
Market hours
Perpetuals trade continuously. Spot markets also trade continuously, but a market can be halted by the deployer or by governance during an emergency. A halted market cancels open orders and settles positions at the last mark price.