BTC-USD——
Order book
Trade tape
How it works
- One upstream, many viewers. A single Cloudflare Durable Object holds one WebSocket to Coinbase Exchange (ticker, level2_50, heartbeat) for 5 pairs, keeps order books in memory, and fans out batched updates every 250 ms to every connected browser.
- Browser transport. WebSocket first (DO hibernatable sockets; ping/pong is auto-answered without waking the object). If WebSockets are blocked, the page falls back to Server-Sent Events on /sse.
- Resilience. If the Coinbase socket drops, the DO reconnects with exponential backoff and meanwhile polls Coinbase REST (~1 s per pair). When the last viewer leaves, an alarm closes the upstream so the object can hibernate — it costs nothing while nobody watches.
- History. Candles come from Coinbase REST via /api/candles (edge-cached 15 s); the live candle is built in the browser from ticks.
- Latency. RTT = browser ↔ edge ping. Feed age = now − Coinbase trade timestamp (includes clock skew between your device and Coinbase).
- HLS channel. Workers can't encode video, so the channel is rendered off-edge (Node canvas → ffmpeg → HLS) and served as static segments. See that page for details.