Skip to content

fix: move account trades to CLOB unified endpoint#90

Merged
cesarenaldi merged 6 commits into
mainfrom
feature/dev-175-account-trades-timestamps
Jun 4, 2026
Merged

fix: move account trades to CLOB unified endpoint#90
cesarenaldi merged 6 commits into
mainfrom
feature/dev-175-account-trades-timestamps

Conversation

@cesarenaldi
Copy link
Copy Markdown
Collaborator

@cesarenaldi cesarenaldi commented Jun 4, 2026

Summary

  • move listAccountTrades() from legacy /data/trades to unified /v1/account/trades
  • map SDK request fields to unified query params: market -> market_id, tokenId -> token_id, and SDK cursors to unified offset
  • update account trade bindings for unified response fields, including nested maker-order token_id and has_more pagination
  • add focused binding coverage for the unified account trade response shape
  • add a patch changeset for @polymarket/client and @polymarket/bindings

Fixes #76
Linear: DEV-175

Verification

  • pnpm test:bindings
  • pnpm lint
  • pnpm typecheck
  • pnpm --filter @polymarket/types build && pnpm --filter @polymarket/bindings build && pnpm test:client && pnpm typecheck

Note

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/trades instead of legacy /data/trades. SDK filters map to unified query params (marketmarket_id, tokenIdtoken_id), and pagination uses offset under the hood (default page size 50) while still exposing the existing cursor-based paginate API.

Bindings in @polymarket/bindings were aligned with the unified payload: trades and nested maker orders use token_id / market_id, the trades page uses has_more (not next_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 focused ClobTradeSchema test documents the unified response shape.

Patch changesets cover @polymarket/client and @polymarket/bindings.

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

@cesarenaldi cesarenaldi changed the title Fix account trade timestamp parsing Move account trades to unified endpoint Jun 4, 2026
Comment thread packages/bindings/src/clob/account.ts
Copy link
Copy Markdown

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

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ 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.

Comment thread packages/client/src/actions/account.ts
@cesarenaldi cesarenaldi changed the title Move account trades to unified endpoint fix: move account trades to CLOB unified endpoint Jun 4, 2026
@cesarenaldi cesarenaldi merged commit 1faf815 into main Jun 4, 2026
8 checks passed
@cesarenaldi cesarenaldi deleted the feature/dev-175-account-trades-timestamps branch June 4, 2026 14:41
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.

bindings: ClobTradeSchema match_time and last_update use EpochMilliseconds but /data/trades REST API sends epoch-seconds strings

1 participant