spot.trades.
A stream costs no request budget after its handshake, so it is the cheaper way to follow anything that changes more than once a minute.
Snapshot, then stream
A stream sends only what happens after you subscribe. To show a complete view, combine the two:- Subscribe first, and buffer the updates that arrive.
- Read the snapshot from the REST endpoint.
- Apply the buffered updates on top of the snapshot, then apply new updates as they arrive.
Merging without duplicates
After a reconnect
Subscriptions end when a connection closes. When you reconnect:- Resubscribe, and buffer updates again.
- Re-read the REST endpoint to cover the gap: the latest trades, or candles with
toleft out. - Merge with the rules above.