In this video, we discuss how to subscribe to Kalshi order book updates using Python and websockets.
0:00 Intro / Overview
1:00 Orderbook watcher demo, what we’re building
1:26 TUI version with keyboard shortcuts
2:00 Super Bowl prop bet order book observations
5:09 Getting and setting up Kalshi API key
6:18 Installing python dependencies
7:12 A simple unauthenticated websocket
8:07 How to authenticate the websocket connection
10:40 Subscribing to websocket channels
12:42 The structure of the subscribe message
13:38 What happens when you subscribe
14:32 Order book snapshots vs order book deltas
17:07 OrderBook class for storing local state of order book
20:03 Streaming the raw OrderBook dictionaries
20:26 Processing and displaying the OrderBook data
23:08 What’s next, what now
Writeup / code (free with email):
https://hackingthemarkets.com/building-a-live-order-book-watcher-for-kalshi/
Download
0 formats
No download links available.
Kalshi Order Book Watcher: Websockets For Real-Time Data in Python | NatokHD