feat(data-api-v2): Integrate Data API v2 to SDK - #316
Merged
Conversation
…nt-envelope-errors-429-retry-auth-ready feat(data-api): sdk core client envelope errors 429 retry auth ready
…ature/dev-610-sdk-cursor-pagination-engine-walker-pinning-no-offset
…gination-engine-walker-pinning-no-offset feat(data-api-v2): Cursor implementation with /v2/trades replacement - DEV-610
Review follow-up (Cesare): the v2 wire serves JSON numbers, and the SDK surface normalizes every money, size, price, and PnL value through DecimalishSchema to DecimalString so v2 methods read like the v1 SDK. Values stringify losslessly at their 6-decimal wire grain. endDate becomes a typed IsoCalendarDateString with the corresponding field schema. Also absorbs the DENG-599 combos wire flip (gross_entry_cost_usdc, entry_fees_usdc, leg_current_price serve as numbers; Decimalish accepts both encodings, so the SDK is transition-proof), and ComboPositionStatus gains Redeemable: tolerated on rows, sole-value-only as a filter (the multi-status arm rejects it with a typed message, matching the service). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cursor finding on 2f648a9: the multi-status refine rejected the type-valid `status: [ComboPositionStatus.Redeemable]`, which serializes to the same `status=REDEEMABLE` query as the scalar form. REDEEMABLE is now rejected only when it rides with other statuses. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…oints-trades-activity-positions-combos-pair feat: integrate positions & activity with combos for data-api /v2 path
feat(data): add user pnl and volume
…tion fix(data): normalize resolution response fields
feat(data): migrate trader boards to v2
feat(data): migrate price history to v2
feat(data): migrate holders to v2
ExoMonk
marked this pull request as ready for review
September 3, 2026 17:34
kartojal
approved these changes
Sep 9, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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 6b16313. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Note
High Risk
Large breaking changes across portfolio, feeds, pagination, and identifiers; secure
listPositionsalways binds the authenticated wallet, so integrators must update call sites and paging logic.Overview
Migrates
@polymarket/bindingsand@polymarket/clientonto the Data API/v2surface with shareddataPageSchema/dataEnvelopeSchemaparsing, server-minted cursor pagination (replacing offset probing), andwithRateLimitRetryon data calls. Feed and portfolio reads (listTrades,listActivity,listPositions, combo activity/positions, holders, leaderboards, open interest, live volume, price history, portfolio value**) keep familiar names but break callers:conditionId(≤20 ids, client-validated) instead ofmarket, unifiedwindowtime selection, stricter normalized rows (DecimalString, epoch ms, sentinels →undefined), andOrderSideinstead ofSide.Removals / replacements:
listClosedPositionsandlistMarketPositions→listPositionswithstatus;listOpenInterest→fetchOpenInterest; CLOBfetchPriceHistory→ datalistPriceHistory;fetchTradedMarketCount→fetchUserStats().tradedMarketCount. AddsfetchResolutions,fetchUserPnl,fetchUserVolume,fetchTraderLeaderboardStanding,listBiggestWinners,MIGRATION/TIPactivity types, combo leg display metadata, protocol v2 condition ID canonicalization, and a builder analytics example. SDK direction doc now standardizes publicassetId(with deprecatedtokenIdalias).Reviewed by Cursor Bugbot for commit a641918. Bugbot is set up for automated code reviews on this repo. Configure here.