Skip to main content

Global Orderbook Module Websocket

Real-time orderbook streaming using Socket.IO. Get live updates from multiple exchanges with aggregated global orderbook view.

Connection

Authentication

No authentication required - Orderbook data is publicly available market data.

Connection Keepalive

Socket.IO handles keepalive automatically via ping/pong: No client-side action required - the Socket.IO client library handles ping/pong responses automatically. As long as the connection is open and the network is stable, the connection stays alive. If you need to detect connection health in your app:

Events

Client → Server Events

Server → Client Events


Subscribing to Orderbooks

Subscribe to Single Exchange

Subscribe to Multiple Exchanges + Global Book

Subscribe to All Exchanges

Subscription Parameters

Supported Venues


Message Formats

Per-Venue Update (orderbook_update)

Sent for each exchange when the orderbook changes:

Global Book (global_book)

Aggregated view showing best prices across all subscribed venues:

Initial Snapshot (orderbook_snapshot)

Sent immediately after subscribing:

Quality Metrics

Quality Levels

Confidence Score (0.0 - 1.0)

Confidence is calculated based on:
  • Staleness: Up to -0.4 penalty for old data
  • Spread: Up to -0.2 penalty for wide spreads
  • Sequence gaps: -0.05 per gap (max -0.3)
  • If UNAVAILABLE: confidence = 0
Recommendation: Only trade when confidence > 0.7

Complete Example (React)


Unsubscribing


Error Handling


Performance Tips

  1. Limit depth - Use depth: 5 unless you need more levels
  2. Filter venues - Only subscribe to venues you’ll display
  3. Throttle UI updates - Don’t re-render on every update (10-20/sec)
  4. Use include_global: false if you only need raw venue data
  5. Unsubscribe when components unmount

REST Fallback

If WebSocket is unavailable, use REST endpoints:
See Orderbook REST API for full REST documentation.