Repository navigation
Conversation
kartojal
marked this pull request as ready for review
October 26, 2026 13:24
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
PolymarketPriceSpec(asset_ids=[...])to async public and secure client subscriptions, following the public websocket contract. Typed events expose best bid/ask quotes, populated or empty initial snapshots, and live changes. Public subscriptions use an unauthenticated connection pool; existing market websocket subscriptions retain their transport.Validation: 282 focused realtime tests and the full unit suite (3,521 passed, 190 integration tests deselected) passed. Ruff lint, formatting, and Pyright passed. A local websocket peer covers request encoding, dispatch by asset, malformed-frame neighbors, shared-listener replay, reconnect/resubscription, and cleanup.
Note
Medium Risk
New websocket parsing and subscription routing in shared realtime infrastructure; mistakes could mis-attribute snapshots or break existing price streams, though polymarket BBO uses a separate client manager and optional auth path.
Overview
Adds
PolymarketPriceSpec(asset_ids=[...])so public and secure clients can subscribe to realtime best bid/ask quotes on theprice.polymarketwebsocket channel, with typedPolymarketPriceEventsnapshots and updates.The realtime stack now keys subscriptions by
asset_id, encodesprice.polymarketwire filters, and parses frames viaparse_polymarket_price_event(including empty cold snapshots correlated to filters through subscribe ack order).PriceConnectiontreats API credentials as optional and skips auth for these public feeds; public clients use a dedicated unauthenticatedRealtimeStreamManager, while secure clients keep a separate pool from authenticated crypto/equity price streams.Exports, subscribe overloads, and session snapshot/replay behavior are extended for polymarket BBO; unit tests cover encoding, malformed frames, shared-listener replay, reconnect, and asset-id validation.
Reviewed by Cursor Bugbot for commit 50cfc79. Bugbot is set up for automated code reviews on this repo. Configure here.