Skip to content

docs: update README to match current SDK API#2

Open
elliotdotsol wants to merge 1 commit into
mainfrom
cursor/update-readme-786a
Open

docs: update README to match current SDK API#2
elliotdotsol wants to merge 1 commit into
mainfrom
cursor/update-readme-786a

Conversation

@elliotdotsol

@elliotdotsol elliotdotsol commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates README.md to reflect the current SDK surface (v0.6.7).

Changes

  • Document missing REST namespaces: analytics and builders
  • Add newly shipped REST methods across markets, trader, holders, assets, series, tags, and webhooks
  • Fix incorrect examples:
    • Remove nonexistent getTraderEventPnl
    • Webhook create uses singular event (e.g. trader_first_trade)
    • Order book WS subscribe uses position_ids, not asset_ids
    • Alerts WS uses price_spike, not probability_spike
  • Refresh trade type docs (MakerRebate, Reward, Yield instead of Approval)
  • Expand WebSocket room table to all 19 rooms with current filter and event names
  • Update WS event listener examples to batch event names

Test plan

  • Verified examples against namespace implementations and generated OpenAPI/WS types
  • Documentation-only change; no code or test updates required
Open in Web Open in Cursor 

A detailed high-level summary could not be generated for this review. Here is an overview derived from the analyzed file changes:

  • README.md: ## AI-generated summary of changes

Bring REST, WebSocket, trade type, webhook, and alerts documentation
in line with v0.6.7: add analytics and builders namespaces, document
new methods, fix incorrect examples, and expand the WebSocket rooms table.

Co-authored-by: Elliot <elliotdotsol@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The README is expanded with new REST API endpoint examples across markets, traders, holders, series, tags, assets, and bonds. Webhook creation shape is updated and additional operations added. WebSocket subscription and event listener examples gain new rooms and handlers. The available alerts rooms table is rewritten, and WebSocketError is added to error imports.

Changes

README API Documentation Updates

Layer / File(s) Summary
REST API endpoint examples expansion
README.md
Adds position-scoped market endpoints (candlesticks, metrics, volume chart, top traders), trader PnL batch/analytics calls, event-holder history, and new series/search/tag/asset/bond/analytics/builders example listings.
Trade types and Webhooks section rewrite
README.md
Updates MarketTrade, OracleEvent, and TradeEventType union descriptions; rewrites webhook create request to use a single event field; adds logs retrieval, secret rotation, and update webhook operations.
WebSocket subscriptions and event listeners
README.md
Adds position_ids to order book subscribe call, adds polymarket_events_stream subscription with mode/interval/filter, adds trader batch PnL and events_stream_update listeners, removes clob_rewards_update snippet.
Alerts WebSocket rooms and error imports
README.md
Adds price_spike subscription and handler, rewrites the available rooms table with many additional rooms, filters, and event names; adds WebSocketError to error handling imports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hoppity-hop through the docs I go,
New endpoints listed in a tidy row,
Webhooks updated, WebSockets bright,
Price spikes and PnL batched just right,
The README blooms like clover in spring! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the documentation-only README update to align with the current SDK API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/update-readme-786a

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 markdownlint-cli2 (0.22.1)
README.md

markdownlint-cli2 wrapper config was not available before execution


Comment @coderabbitai help to get the list of available commands.

@elliotdotsol elliotdotsol marked this pull request as ready for review June 29, 2026 21:39

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

168-201: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Split trade vs oracle-event wording.

getOracleEvents is not a trade endpoint, so this lead-in blurs two different API families. Rephrase the section or move getOracleEvents out so readers don’t assume the trade and oracle payloads are interchangeable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 168 - 201, The README section currently groups
`getTrades`, `getTraderTrades`, and `getOracleEvents` under “Trade endpoints,”
which incorrectly suggests oracle events are trade payloads. Update the wording
in this section so `getOracleEvents` is described separately from the trade
endpoints, while keeping the `trade_type` narrowing example and the
`MarketTrade`, `OracleEvent`, and `TradeEventType` exports clearly associated
with their respective API families.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 337-358: The room table for polymarket_trader_pnl uses wildcard
event patterns instead of concrete listener names, which can mislead consumers
into using invalid ws.on strings. Update the event list in the README table to
either expand `trader_*_tick_batch` and `trader_*_resolution_batch` into the
exact event names or clearly mark them as event families, and keep the rest of
the `polymarket_trader_pnl` entry consistent with the actual emitted event
names.

---

Outside diff comments:
In `@README.md`:
- Around line 168-201: The README section currently groups `getTrades`,
`getTraderTrades`, and `getOracleEvents` under “Trade endpoints,” which
incorrectly suggests oracle events are trade payloads. Update the wording in
this section so `getOracleEvents` is described separately from the trade
endpoints, while keeping the `trade_type` narrowing example and the
`MarketTrade`, `OracleEvent`, and `TradeEventType` exports clearly associated
with their respective API families.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f8fdf9e1-b2eb-48a2-9628-cf9813a89e8e

📥 Commits

Reviewing files that changed from the base of the PR and between 6927d23 and dee8e11.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md
Comment on lines +337 to +358
| Room | Filters | Events |
|------|---------|--------|
| `polymarket_trades` | `condition_ids?`, `market_slugs?`, `event_slugs?`, `position_ids?`, `traders?`, `trade_types?`, `status?`, `subscribe_all?` | `trade_stream_update` |
| `polymarket_asset_prices` | `asset_symbols?` | `asset_price_tick`, `asset_price_window_update` |
| `polymarket_asset_window_updates` | `asset_symbols?`, `timeframes?` | `asset_window_update` |
| `polymarket_market_metrics` | `condition_ids` | `market_metrics_update` |
| `polymarket_event_metrics` | `event_slugs` | `event_metrics_update` |
| `polymarket_position_metrics` | `position_ids` | `position_metrics_update` |
| `polymarket_trader_pnl` | `traders` | `trader_global_pnl_update`, `trader_market_pnl_update`, `trader_event_pnl_update` |
| `polymarket_trader_positions` | `traders` | `trader_position_update` |
| `polymarket_accounts` | `wallets`, `include_usdce?`, `include_matic?` | `accounts_update`, `usdce_update`, `matic_update` |
| `polymarket_market_metrics` | `condition_ids`, `timeframes?` | `market_metrics_update` |
| `polymarket_event_metrics` | `event_slugs`, `timeframes?` | `event_metrics_update` |
| `polymarket_position_metrics` | `position_ids`, `timeframes?` | `position_metrics_update` |
| `polymarket_tag_metrics` | `tags`, `timeframes?` | `tag_metrics_update` |
| `polymarket_trader_pnl` | `traders`, `update_types?`, `timeframes?`, `dirty_kinds?` | `trader_global_pnl_batch`, `trader_market_pnl_batch`, `trader_category_pnl_batch`, `trader_*_tick_batch`, `trader_*_resolution_batch` |
| `polymarket_trader_positions` | `traders`, `dirty_kinds?` | `trader_position_batch`, `trader_position_price_batch`, `trader_position_resolution_batch` |
| `polymarket_trader_pnl_exits` | `traders`, `reasons?` | `trader_exit_marker_batch` |
| `polymarket_holder_metrics` | `position_ids?`, `condition_ids?`, `event_slugs?` | `holder_metrics_position_batch`, `holder_metrics_condition_batch`, `holder_metrics_event_batch` |
| `polymarket_accounts` | `wallets`, `include_usdce?`, `include_pusd?`, `include_matic?` | `accounts_update`, `usdce_update`, `pusd_update`, `matic_update` |
| `polymarket_order_book` | `condition_ids?`, `position_ids?` | `order_book_update` |
| `polymarket_clob_rewards` | `condition_ids?`, `subscribe_all?` | `clob_rewards_update` |
| `polymarket_events_stream` | `mode?`, `interval_ms?`, `filter?`, `event_slugs?`, `event_ids?` | `events_stream_update` |
| `polymarket_markets_stream` | `mode?`, `interval_ms?`, `filter?`, `condition_ids?`, `market_slugs?`, `event_slugs?` | `markets_stream_update` |
| `polymarket_oracle_events` | `condition_ids?`, `market_slugs?`, `event_slugs?`, `oracle_event_types?`, `status?`, `subscribe_all?` | `oracle_event_update` |
| `polymarket_position_liquidity` | `position_ids?` | `position_liquidity_update` |
| `polymarket_market_liquidity` | `condition_ids?` | `market_liquidity_update` |
| `polymarket_event_liquidity` | `event_slugs?` | `event_liquidity_update` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use concrete event names in the room table.

Entries like trader_*_tick_batch and trader_*_resolution_batch are patterns, not listener names. Either expand them to the exact events or label them explicitly as families; otherwise consumers will copy invalid strings into ws.on(...).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 337 - 358, The room table for polymarket_trader_pnl
uses wildcard event patterns instead of concrete listener names, which can
mislead consumers into using invalid ws.on strings. Update the event list in the
README table to either expand `trader_*_tick_batch` and
`trader_*_resolution_batch` into the exact event names or clearly mark them as
event families, and keep the rest of the `polymarket_trader_pnl` entry
consistent with the actual emitted event names.

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