For the complete documentation index, see llms.txt. This page is also available as Markdown.

Indexer & API

The indexer is an off-chain service that indexes on-chain events and serves real-time orderbook data. It is non-authoritative — all data can be independently verified from the chain.

What It Indexes

Event
Data Extracted

OrderPlaced

Order details, tick, side, amount

OrderResting

Order parked outside active tree

OrderCancelled

Order removal

OrderSettled

Per-order fill result, amounts

BatchCleared

Clearing price, volume, fill fractions

GtcAutoCancelled

GTC order auto-cancelled on market close

MarketCreated

Market parameters, expiry

MarketResolved

Outcome, settlement price

REST API

The canonical versioned API surface lives under /v1/.

Public OpenAPI Spec

The generated OpenAPI spec is published at:

Use this as the source of truth for routes, params, enums, and response schemas.

Key Endpoints

Market Status Values

The current market status enum exposed by the indexer is:

  • active

  • closed

  • resolving

  • resolved

  • cancelled

WebSocket

Connect to receive real-time updates:

For local development, the service also exposes /ws on the indexer host.

Message Format

All messages use the format { type, event, data: {...} }. Always access fields via msg.data.field.

On BatchCleared, the WebSocket broadcasts a full orderbook snapshot so clients can reconcile state.

Infrastructure

  • RPC: uses a dedicated RPC provider (public BSC endpoints may disable eth_getLogs)

  • Database: PostgreSQL

  • Deployment: systemd service, configurable via .env

Last updated