Skip to content

Order book

Price-time priority, order identifiers, depth snapshots, and how the book is represented in the API.

Updated Nov 4, 2026Traders · Builders2 min read
On this page

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

  1. Price priority. The best bid and best ask are matched first.
  2. Time priority. At the same price, the earliest accepted order fills first.
  3. Maker/taker. The resting order is the maker; the incoming order is the taker.
  4. Self-trade prevention. An account cannot match its own order. The older order is canceled by default; see self-trade prevention.

Order identifiers

IdentifierTypeScope
oidintegerAssigned by the exchange, unique per market
cloid128-bit hexClient-supplied, unique per account
assetintegerMarket 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:

code
{
  "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:

FieldMeaning
szDecimalsMaximum decimal places for size
maxLeverageMaximum leverage for the market
tickSizeMinimum price increment
lotSizeMinimum 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.

Was this page helpful?