We stream level 2 orderbook data from Binance using websockets in python. We request an orderbook snapshot using the REST API, and then stream the updates to the orderbook at a frequency of up to 100 milliseconds.
We discuss how to store orderbook data on disk and why I prefer using plain text files for this purpose. As well as how to extend this system to take it into production.
⭐ Code:
github.com/ChadThackray/level-2-orderbooks-2022
Timestamps:
00:00 - Introduction
01:45 - Documentation Walkthrough
06:29 - Streaming orderbook updates via websocket
18:55 - Requesting orderbook snapshots
25:12 - Why use plain text for storing orderbook data?
30:24 - Ideas for taking this system to production
コメント