Skip to main content
United Market offers two real-time interfaces. Most integrations should use the backend Socket.IO endpoint; server-side bots that want the matcher’s native order-book stream can connect to the CLOB WebSocket directly.
United Market is now live on BNB Smart Chain mainnet. We just launched — start trading on-chain prediction markets today.
The Socket.IO endpoint adds market rooms, automatic reconnection, price snapshots, and normalized payloads. The direct CLOB WebSocket is a lower-level feed intended for advanced, server-side consumers. Use a Socket.IO client — not a plain WebSocket client — to connect to https://api.unitedmarket.ai. The transport upgrades to a secure WebSocket (wss://) automatically.

Install Client

Connect

Subscribe to a Market

Join a market room with the market conditionId.

Client Events

Server Events

orderbook:update

After this event, clients can refetch GET /markets/{id}/orderbook or GET /markets/{id}/trading.

trade:new

ob:snapshot

L2 levels are 18-decimal fixed-point strings — divide price and size by 1e18. When synthAsks is true, asks already include complement synthetic asks, so do not re-derive them client-side.

price:snapshot

Reconnection

Socket.IO reconnects automatically when configured with reconnection: true. Re-emit join:market subscriptions after reconnecting if your client manages rooms outside a persistent component.

Direct WebSocket (CLOB)

Advanced and server-side clients can connect straight to the CLOB matcher’s raw WebSocket. This is a lower-level feed: it streams the matcher’s native events without the backend’s room management, price snapshots, or payload normalization.

Connect & Subscribe

Send a JSON subscribe message with a market conditionId. The server replies with a subscribed acknowledgement, then streams that market’s events. Subscribe to multiple markets by sending multiple messages; remove one with unsubscribe.
If you never send a subscribe message, the socket receives events for all markets. Send at least one subscribe to scope the stream to the markets you care about.

Event Format

Every market event shares one envelope. The event name uses the matcher’s native form (ob_snapshot / ob_diff with underscores, and order:*), and the per-event detail lives under data.
For ob_snapshot, data carries the full L2 book. As with the Socket.IO API, price and size are 18-decimal fixed-point strings, and synthAsks: true means asks already include complement synthetic asks.
This is the same data the backend relays, but in the matcher’s raw form: event names use underscores (ob_snapshot, not ob:snapshot) and the payload is wrapped in the MatcherEvent envelope (fields under data) rather than flattened. Use the Socket.IO API if you want the normalized, room-scoped events.