fix: move account trades to CLOB unified endpoint#90
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d39b5f2. 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.

Summary
listAccountTrades()from legacy/data/tradesto unified/v1/account/tradesmarket -> market_id,tokenId -> token_id, and SDK cursors to unifiedoffsettoken_idandhas_morepagination@polymarket/clientand@polymarket/bindingsFixes #76
Linear: DEV-175
Verification
pnpm test:bindingspnpm lintpnpm typecheckpnpm --filter @polymarket/types build && pnpm --filter @polymarket/bindings build && pnpm test:client && pnpm typecheckNote
Medium Risk
Switches a core account data path and pagination semantics; wrong offset/hasMore handling could drop or duplicate trades for integrators.
Overview
Account trade listing now calls the unified CLOB route
/v1/account/tradesinstead of legacy/data/trades. SDK filters map to unified query params (market→market_id,tokenId→token_id), and pagination uses offset under the hood (default page size 50) while still exposing the existing cursor-basedpaginateAPI.Bindings in
@polymarket/bindingswere aligned with the unified payload: trades and nested maker orders usetoken_id/market_id, the trades page useshas_more(notnext_cursor), and a few fields are optional (fee_rate_bps,transaction_hash). Normalized client fields (market,tokenId, timestamps, etc.) are unchanged after Zod transforms. A focusedClobTradeSchematest documents the unified response shape.Patch changesets cover
@polymarket/clientand@polymarket/bindings.Reviewed by Cursor Bugbot for commit 2315dc1. Bugbot is set up for automated code reviews on this repo. Configure here.