Skip to content

docs: migrate Polymarket skill docs to CLOB V2 - #1

Open
wtfsayo wants to merge 2 commits into
Polymarket:mainfrom
wtfsayo:chore/polymarket-v2-migration-docs
Open

docs: migrate Polymarket skill docs to CLOB V2#1
wtfsayo wants to merge 2 commits into
Polymarket:mainfrom
wtfsayo:chore/polymarket-v2-migration-docs

Conversation

@wtfsayo

@wtfsayo wtfsayo commented Apr 18, 2026

Copy link
Copy Markdown

What this changes

This PR updates the Polymarket skill docs from V1-era guidance to CLOB V2.

It focuses only on migration-relevant documentation and aligns the skill with the current Polymarket docs index and migration guide.

Included updates

CLOB V2 client + order model

  • replace V1 SDK references with:
    • @polymarket/clob-client-v2
    • py-clob-client-v2
  • update TypeScript examples to the V2 constructor shape
  • document V2 order-field changes:
    • removed: nonce, feeRateBps, taker
    • added / emphasized: timestamp, metadata, builder, builderCode
  • clarify that fees are protocol-determined in V2 and point to getClobMarketInfo() for fee parameters
  • clarify the documented V2 userUSDCBalance helper field as legacy naming for available pUSD collateral input

Contracts + collateral

  • replace legacy exchange addresses with V2 exchange contracts
  • update collateral guidance from USDC.e as trading collateral to pUSD as trading collateral
  • keep USDC.e only where still relevant for wrapping / bridge / onramp flows
  • add/update pUSD-related contract references

Builder + relayer flows

  • remove V1 builder-attribution guidance based on POLY_BUILDER_* headers for normal CLOB trading
  • document V2 builder attribution via builderCode
  • update gasless / relayer guidance toward the current Relayer API Key flow while noting raw relayer API auth details where relevant

Market data guidance

  • add V2-relevant getClobMarketInfo() usage
  • update Gamma pagination guidance to include the documented keyset endpoints:
    • /events/keyset
    • /markets/keyset
  • fix V2 snippet consistency issues such as getLastTradePrices() naming and missing enum imports in examples

Documentation shape preservation

  • preserve the original skill-doc progressive-disclosure structure instead of flattening reference files into shorter summaries
  • keep the richer reference-manual patterns in authentication.md, market-data.md, and order-patterns.md while updating them to current V2 guidance

Files updated

  • SKILL.md
  • README.md
  • authentication.md
  • market-data.md
  • ctf-operations.md
  • bridge.md
  • order-patterns.md
  • gasless.md

Validation

Checked against:

Scope / non-goals

  • only documentation changes related to the V2 migration
  • no unrelated restructuring or feature additions
  • no websocket doc changes in this PR unless directly required by migration docs

Note

Low Risk
Low risk: documentation-only updates, but they change critical integration guidance (auth, collateral, contracts), so inaccuracies could mislead integrators.

Overview
Updates all skill docs to CLOB V2 guidance: switches SDK references to @polymarket/clob-client-v2 / py-clob-client-v2, updates client constructor examples, and documents V2 order signing changes (fees no longer embedded; new signed-order fields; builderCode attribution instead of POLY_BUILDER_* headers).

Refreshes operational docs for V2 reality: trading collateral moves to pUSD, exchange/bridge/CTF/relayer contract addresses are updated to V2, relayer docs pivot to Relayer API Keys, and market data guidance adds getClobMarketInfo() plus Gamma keyset pagination endpoints.

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

Copilot AI review requested due to automatic review settings April 18, 2026 06:36

Copilot AI 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.

Pull request overview

Updates the Polymarket integration skill documentation to reflect CLOB V2 semantics, SDKs, and collateral/contracts so agents and developers follow the post-migration integration path.

Changes:

  • Migrates trading/auth examples to @polymarket/clob-client-v2 / py-clob-client-v2, and updates order semantics (fees, builder attribution, signing fields).
  • Updates collateral and onchain references from USDC.e → pUSD, including exchange/CTF/relayer/bridge contract addresses.
  • Refreshes market data guidance (keyset pagination, V2 market info/fees) and relayer (gasless) authentication guidance.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
order-patterns.md Updates order types/examples and V2-specific signing/builder/collateral notes.
market-data.md Updates data source overview, keyset pagination guidance, and V2 CLOB read patterns (incl. market info/fees).
gasless.md Updates relayer auth/client setup and contract references for pUSD + V2 flows.
ctf-operations.md Updates split/merge/redeem explanations and addresses for pUSD-collateralized positions.
bridge.md Updates bridge narrative/examples to align with pUSD as trading collateral.
authentication.md Clarifies V2 auth stability and replaces builder-header attribution with builderCode guidance; documents raw signing deltas.
SKILL.md Updates skill entrypoint quick-reference for V2 endpoints/contracts and migration notes.
README.md Updates repo-level overview and quick start to V2 packages, options-object constructors, and pUSD/builderCode concepts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread market-data.md Outdated
Comment thread order-patterns.md
Comment thread SKILL.md Outdated
Comment thread authentication.md
Comment thread market-data.md
The V2 docs update was directionally correct, but it flattened some of the
original skill-manual structure and left a few migration-guide mismatches in
place. This commit restores the progressive-disclosure/reference style while
keeping the content aligned to Polymarket's V2 documentation.

It also fixes snippet-level issues called out by review and by source
validation: the `getLastTradePrices()` batch method name, missing snippet
imports, and clarification that `userUSDCBalance` remains the documented SDK
field name even though V2 trading collateral is pUSD.

Constraint: Scope limited to documentation updates on the existing V2 migration branch
Rejected: Revert to pre-migration docs structure wholesale | would reintroduce V1 guidance
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep the original skill-doc reference density unless a source-backed change requires simplification
Tested: Source validation against docs.polymarket.com/v2-migration.md and docs.polymarket.com/llms.txt; manual diff review
Not-tested: Runtime execution of SDK snippets against installed Polymarket client packages
Related: Polymarket#1
@matthew-ng-2011

Copy link
Copy Markdown

Hi, any update on this PR? I'm looking forward to the V2 documentation updates. Thanks

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.

3 participants