Skip to content
All library documents

Binance SBE WebSocket Streams for Trades and Order Book Data

Article Binance API docs

Summary

This reference explains how to connect to Binance’s SBE market-data WebSocket service and what the streams provide. It covers real-time trade events, best bid and ask updates, incremental order-book depth updates, and periodic snapshots of the top levels. Depth updates can be used to maintain a local order book, while best-quote events may be automatically culled under load, meaning stale updates can be discarded in favor of newer ones.

The document also specifies operational constraints: API key authentication with Ed25519 keys, connection and subscription limits, heartbeat handling, timestamps in microseconds, and a maximum connection lifetime that requires reconnect handling. Control messages and shutdown notices use JSON, while market events use binary SBE encoding. These details are useful for building market-data infrastructure, but the reference does not describe a trading strategy or evaluate feed latency, completeness, or execution outcomes. In particular, consumers of the best-quote stream should account for its stated event-culling behavior.

Key ideas

  • The service publishes trade, best bid and ask, incremental depth, and limited-depth snapshot streams.
  • Incremental depth events support maintenance of a local order book.
  • Best-quote events may be culled under server load, so they can omit stale intermediate updates.
  • Connections require Ed25519 API key authentication and must handle heartbeats, limits, and reconnects.
  • Market events use binary SBE encoding, while control messages and shutdown notices use JSON.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.