UBDCC: A self-hosted DepthCache cluster for Binance order books (MIT, any language via REST)If you run more than one bot or service against Binance order books, you have probably bumped into the same set of headaches:
- Each process keeps its own DepthCache, and they slowly drift out of sync with each other
- Cold starts eat minutes of REST snapshots before the cache is usable again
- Silent desync — top of book looks fine, deeper levels are wrong, and you only find out from a bad fill
- Orphaned price levels beyond Binance's top-1000 guarantee that quietly stay in your book forever
- Your Go service and your Python research notebook can't share one book without writing glue
UBDCC (UNICORN Binance Depth Cache Cluster) turns DepthCaches into a small self-hosted service that any language can query over REST/JSON. One source of truth, kept fresh by a cluster instead of a single process.
What you get:- Sequence validation + gap detection per stream — desyncs surface as errors, not as bad data
- Replication and load balancing across DepthCacheNodes — losing a pod doesn't lose your book
- Self-healing cluster: nodes drop in/out, work gets redistributed automatically
- Built-in rate limiting so snapshot refreshes never trip Binance
- ~3 ms internal response times for bids/asks queries
- Spot, Futures, Options across binance.com / binance.us / binance.tr / testnets
- Browser dashboard with an API builder that hands you ready-to-paste code for curl, Python, JS, Go, Rust, Java, C#, PHP
Try it locally:pip install ubdcc
ubdcc start --dcn 4
That spins up a four-node cluster on your machine. Same stack scales to Docker Compose or Kubernetes when you want to move it off your laptop.
Resources:MIT licensed, part of the broader
UNICORN Binance Suite.
Happy to hear what's missing for your workflow — feature ideas and pain points welcome.