Order Book DEX
The Sanect Order Book is a fully on-chain central limit order book (CLOB). Unlike the AMM-based Swap DEX, the Order Book lets you place limit orders at exact prices, with price-time priority matching and ~400ms settlement.
How it works
The Order Book uses a taker-pays-for-matching model — no off-chain relayer or keeper is needed. Every order placement, fill, and cancellation happens on-chain in a single transaction.
Key mechanics:
- Limit orders — place buy/sell orders at a specific price. Orders sit on the book until filled, cancelled, or expired.
- Market orders — execute immediately at the best available price with slippage protection via a worst-price parameter.
- Partial fills — large orders fill incrementally as matching liquidity appears.
- Self-trade prevention — the contract prevents your own orders from matching against each other.
- Price-time priority — orders at the same price fill in FIFO order (first placed, first filled).
Fee structure:
| Side | Fee |
|---|---|
| Maker | 0.01% (1 bps) |
| Taker | 0.05% (5 bps) |
| Hard cap | 50 bps max per side |
Mainnet contracts
| Contract | Address |
|---|---|
| OrderBookFactory | 0xE850462927f45C1d782A6aBF1dD2306EB7daC35f |
| OrderBookRouterV2 | 0x8f7c84113AE8C2007fEd4D3Ef5095aFD5c0c5dfC |
| OrderBookViewer | 0xf6Fd048ED7D9913d4E8b61C1e674fc86C02c605c |
Live pairs
| Pair | Order Book Address |
|---|---|
| SNCT/USDC | 0xe9Ae4819BEed607a675807bD46cE93860783b080 |
| SNCT/USDT | 0x1964EF1E9c8700899F87B508167766B48A3C04cD |
How to place a limit order
- Go to trade.sanect.com.
- Connect your MetaMask wallet (the app will prompt you to add the Sanect network if needed).
- Select the trading pair from the pair selector (top left).
- Choose Limit order type and Buy or Sell.
- Enter the Price (in quote token, e.g. USDC) and the Amount (in base token, e.g. SNCT).
- Click the submit button. If you're trading with native SNCT, the order executes in a single transaction — no wrapping or approval needed.
- For ERC-20 tokens, you'll be prompted to Approve the token first, then submit the order.
- Your order appears in the Open Orders panel below the order form. You can cancel individual orders or all at once.
How to place a market order
- Select Market order type.
- Enter the Amount you want to buy or sell.
- Set your Slippage Tolerance (default 0.5%). This sets the worst price you'll accept.
- Click submit. The order fills immediately against resting limit orders on the book.
Reading the order book
The order book display has three sections:
- Asks (red, top) — sell orders, sorted highest to lowest price. The bottom ask is the best (lowest) sell price.
- Spread — the gap between the best bid and best ask.
- Bids (green, bottom) — buy orders, sorted highest to lowest price. The top bid is the best (highest) buy price.
Click any price level to auto-fill that price in the order entry form.
The depth chart below the candlestick chart shows cumulative order depth — how much liquidity is available at each price level.
Managing open orders
Open orders appear in the panel below the order entry form. Each row shows:
- Side — BUY or SELL
- Price — the limit price
- Amount — the original order size
- Filled — percentage filled with a progress bar
- Total — price × amount in quote token
Click × to cancel a single order, or Cancel All to cancel all open orders in one transaction.
Architecture
The Order Book system consists of three contracts:
- OrderBookFactory — deploys new order book pairs and registers the router on each.
- OrderBookRouterV2 — handles token transfers, WSNCT wrapping for native SNCT orders, deposit-balance flow, and calls into the OrderBook for matching.
- OrderBookViewer — read-only contract for depth queries and order estimates without gas costs.
Each trading pair gets its own OrderBook contract that holds escrowed tokens and performs all matching. The sorted doubly-linked price list with FIFO matching ensures deterministic, transparent execution.
Backend services
The Order Book is supported by two dedicated backend services:
- Indexer — scans OrderBook events and builds trade history, OHLCV candles (1m/5m/15m/1h/4h/1d), ticker data, and order state.
- Frontend — Next.js trading UI with a 3-column layout: order book, candlestick chart with depth chart, and order entry with open orders.
Next step: Swap & provide liquidity on the AMM DEX, or Bridge assets from Ethereum