Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Kalshi Order Book Watcher - Websockets for Real-Time Data in Python

Part Time Larry via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to build a real-time order book watcher for Kalshi prediction markets using Python websockets in this 25-minute tutorial. Start by exploring what you'll build through a live demo, including a terminal user interface (TUI) version with keyboard shortcuts and observations of Super Bowl prop bet order books. Set up your Kalshi API key and install the necessary Python dependencies before diving into websocket implementation. Begin with a simple unauthenticated websocket connection, then progress to authenticating your websocket connection and subscribing to specific channels. Understand the structure of subscribe messages and learn what happens during the subscription process. Distinguish between order book snapshots and order book deltas, then implement an OrderBook class to maintain local state of the order book data. Stream raw OrderBook dictionaries and process them for display, culminating in a fully functional real-time order book monitoring system for Kalshi markets.

Syllabus

Intro / Overview
Orderbook watcher demo, what we’re building
TUI version with keyboard shortcuts
Super Bowl prop bet order book observations
Getting and setting up Kalshi API key
Installing python dependencies
A simple unauthenticated websocket
How to authenticate the websocket connection
Subscribing to websocket channels
The structure of the subscribe message
What happens when you subscribe
Order book snapshots vs order book deltas
OrderBook class for storing local state of order book
Streaming the raw OrderBook dictionaries
Processing and displaying the OrderBook data
What’s next, what now

Taught by

Part Time Larry

Reviews

Start your review of Kalshi Order Book Watcher - Websockets for Real-Time Data in Python

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.