Skip to content

feat(client): add reward market discovery - #346

Merged
kartojal merged 7 commits into
mainfrom
codex/parity-reward-markets-20261007
Oct 21, 2026
Merged

kartojal merged 7 commits into
mainfrom
codex/parity-reward-markets-20261007

Conversation

@kartojal

@kartojal kartojal commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Add list_reward_markets on sync/async clients through normalized cursor pagination, retaining supported discovery filters across pages. Remove exclude_tag_slugs from every signature and request builder after clob-v2 #991 removed the wire filter on October 8. Included tags and exact min_volume_24hr/max_volume_24hr bounds remain supported.

Expose the input-only RewardMarketSort as supported string literals on all four client signatures, with runtime validation retained for dynamic inputs.

Make optional reward-market end_date default to None, so omitted, null and empty values are all accepted. Empty reward configurations remain supported.

Validation on 5e51036: Ruff lint/format, Pyright (0 errors), Sphinx, offline wheel/sdist build and 61 focused tests pass, including missing dates and filter retention across two pages in both modes. Full suite before the final sort typing fix: 3,214 passed, 181 deselected, 2 known external wallet-discovery HTTP403 failures, also reproduced on unchanged source. Fresh independent review found no remaining actionable findings after fixing and re-reviewing the Python sort vocabulary. Terminal CI succeeded. Public live reads were blocked by CONNECT tunnel HTTP403.

Companions: TypeScript #411, docs #493.


Note

Low Risk
Read-only public CLOB API with validation and tests; no auth, trading, or payment logic changes.

Overview
Adds reward market discovery via list_reward_markets on sync/async public and secure clients, calling GET /rewards/markets/multi with cursor pagination and filters (search, tags, events, sort, volume/spread/price bounds).

Introduces RewardMarket and RewardMarketSort models (including optional end_date normalized to None when omitted or empty) plus build_list_reward_markets_request / parse_reward_markets_page with input validation. Types are re-exported from the package root.

Unit and transport tests cover query param mapping, parsing edge cases, and filter retention across pages on unsigned CLOB reads.

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

@kartojal
kartojal marked this pull request as ready for review October 9, 2026 13:12

@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 5779c1d. Configure here.

Comment thread src/polymarket/models/clob/rewards.py
@kartojal
kartojal merged commit db6111f into main Oct 21, 2026
7 checks passed
@kartojal
kartojal deleted the codex/parity-reward-markets-20261007 branch October 21, 2026 13:06
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.

2 participants