Skip to content

Conversation

@SatoshiZKMO
Copy link

@SatoshiZKMO SatoshiZKMO commented Feb 2, 2026

Overview

This PR improves the clarity and usability of the early Polymarket market intelligence MVP, with a focus on making market and order data fetching easier to understand and extend.

Description

What changed

  • Clarified and stabilized market fetching logic in fetch_markets.py.
  • Added and finalized basic order fetching via get_orders.py to expose orderbook and liquidity-related data.
  • Updated README.md to better describe:
    • What data is currently fetched
    • What is intentionally out of scope
    • How contributors can experiment with or extend the MVP
  • Minor cleanup and consistency improvements across scripts.

All changes are non-breaking and focused on developer experience and faster iteration.

Testing instructions

Run the scripts locally:

python fetch_markets.py
python get_orders.py

Expected behavior

  • Markets are fetched successfully from the Polymarket CLOB API.
  • Order data is returned without errors.
  • Documentation reflects the current state of the MVP.

Types of changes

  • Refactor/enhancement
  • Bug fix/behavior correction
  • New feature
  • Breaking change
  • Other, additional

Notes

  • This is an early-stage and experimental MVP.
  • The code intentionally avoids heavy abstractions for faster iteration.
  • Feedback and suggestions for useful signals or next steps are welcome.

Status

  • Prefix PR title with [WIP] if necessary
  • Add tests to cover changes as needed
  • Update documentation/changelog as needed
  • Verify all tests run correctly in CI and pass
  • Ready for review/merge

Note

Low Risk
Low risk: documentation and example-script updates only; no library/runtime behavior changes beyond how sample code is invoked.

Overview
Adds a new Examples section to README.md that points users to minimal Python scripts for fetching markets, orderbooks, and open orders.

Introduces examples/fetch_markets.py (cursor-based market listing) and tightens existing example scripts with clearer docstrings and proper if __name__ == "__main__": entrypoints for get_orderbook.py, get_orderbooks.py, and get_orders.py.

Written by Cursor Bugbot for commit fdfc70b. This will update automatically on new commits. Configure here.

@SatoshiZKMO SatoshiZKMO requested a review from a team as a code owner February 2, 2026 14:20
@SatoshiZKMO
Copy link
Author

Fixed
Updated fetch_markets example to match current py_clob_client API.

Copy link

@cursor cursor bot left a comment

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 and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

next_cursor = None

while True:
response = client.get_markets(next_cursor=next_cursor)
Copy link

Choose a reason for hiding this comment

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

Passing None as cursor creates invalid API URL

Medium Severity

The pagination loop initializes next_cursor to None and passes it explicitly to client.get_markets(next_cursor=next_cursor). Since get_markets doesn't guard against None like other methods do, None gets string-interpolated into the URL as the literal "None", creating an invalid request like ?next_cursor=None. The first iteration will fail or return unexpected results. The fix is to either omit next_cursor on the first call or initialize it to "MA==".

Fix in Cursor Fix in Web

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