Skip to content

fix(streams): deliver automatic redemption user events - #378

Open
kartojal wants to merge 2 commits into
mainfrom
fix/user-auto-redeem-events
Open

kartojal wants to merge 2 commits into
mainfrom
fix/user-auto-redeem-events

Conversation

@kartojal

@kartojal kartojal commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

User subscriptions now deliver auto_redeem and combo_auto_redeem events alongside orders and trades. The returned models expose wallet, transaction hash, condition, amount, timestamp, and combination-specific token details. Market filters match the event's condition consistently across event kinds.

Validation: 68 focused user-stream tests passed; Pyright, Ruff lint, and format checks passed. The regression mixes both redemption kinds, valid order/trade neighbors, unknown frames, and malformed payloads.


Note

Medium Risk
Changes user-stream filtering and adds new parsed event shapes; wrong matcher logic could hide redemptions or leak events across markets, but scope is limited to stream models and tests.

Overview
Extends the CLOB user WebSocket event union with auto_redeem and combo_auto_redeem, including typed payloads (wallet, txn hash, amount, timestamp, and combo-specific position_id / outcome_index / legs). Those types are re-exported from polymarket.streams.

Market filtering in matcher_for now keys off condition_id for all delivered events (not market), with combo redemptions matched via normalized combo condition IDs from subscribed market strings. Unknown wire frames and bad redemption amounts still drop during batch parse.

Unit and integration tests cover parsing, discriminated-union metadata, matcher behavior, and end-to-end delivery through UserSpec subscriptions.

Reviewed by Cursor Bugbot for commit 7f75aa9. Bugbot is set up for automated code reviews on this repo. Configure here.

@kartojal
kartojal marked this pull request as ready for review October 26, 2026 13:16

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7f977c5. Configure here.

Comment thread src/polymarket/_internal/streams/clob/user_protocol.py

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant