// GLOSSARY
WebSocket feed
A persistent connection over which the venue pushes live updates — book changes, trades, fills — as they happen. The right way to consume market data: lower latency than polling REST and no rate-limit burn per update.
A WebSocket inverts the REST relationship: instead of asking "anything new?" on a loop, you open one long-lived connection, subscribe to channels, and the venue pushes events to you. Both Kalshi and Polymarket offer WebSocket streams for market data; channel names and message schemas are venue-specific — read the current docs.
What you subscribe to
Typical channels: order book updates (often a snapshot followed by deltas), public trades, and — authenticated — your own order status and fills. The delta pattern matters: you must apply updates to a local book copy in sequence, and detect gaps.
Engineering realities
- Reconnection is the job. Connections drop; on reconnect you must re-subscribe and re-snapshot, and your book is untrustworthy until you do.
- Sequence checking: a missed message means a silently wrong book — detect it and resync rather than trade on it.
- Heartbeats distinguish "quiet market" from "dead connection."
A polling bot is always one rate limit and one round trip behind a streaming one. Implementation patterns are in the Python bot guide.