Skip to content

Spec drift: polymarket — GET /data/trades response changed to paginated wrapper; maker param renamed to maker_address #892

@realfishsam

Description

@realfishsam

Exchange

polymarket

Drift Type

changed_response / changed_params

Severity

HIGH — callApi('getTrades', ...) in fetcher.ts will receive a paginated object instead of an array; all trade fetching is silently broken

Their Docs

The live Data API for GET /trades now returns a paginated envelope:

{ "limit": 100, "next_cursor": "...", "count": 42, "data": [...] }

Previously it returned a bare array. Additionally, the filter parameter was renamed from maker (optional) to maker_address (required). A new next_cursor pagination parameter was also added.

Source: https://data-api.polymarket.com docs (confirmed via Polymarket docs site)

Our Cached Spec

core/specs/polymarket/Polymarket_Data_API.yamlGET /trades response schema is type: array with no pagination wrapper. The query parameter is named maker (optional), not maker_address (required).

File: core/specs/polymarket/Polymarket_Data_API.yaml
File: core/src/exchanges/polymarket/api-data.ts

callApi() References at Risk

  • callApi('getTrades', queryParams) at fetcher.ts:281 (fetchRawTrades)
  • callApi('getTrades', queryParams) at fetcher.ts:295 (fetchRawMyTrades)
  • callApi('getTrades', { user: address, limit: 20 }) at index.ts:789 (fetchWatchedAddressActivity)

All three call sites receive the paginated wrapper object instead of an array, causing downstream code to fail silently (treating { limit, next_cursor, count, data } as an empty trade list).

Note: existing issue #792 covers the same pattern for GET /data/orders — this is the same problem on GET /data/trades.

Hardcoded URL Bypasses

None for this endpoint

Impact

fetchRawTrades, fetchRawMyTrades, and fetchWatchedAddressActivity all return empty or malformed results. The makermaker_address rename also means trade filtering by maker address no longer works.

Fix: Update the Data API spec to wrap the /trades response in a paginated envelope schema; rename the maker param to maker_address; update fetcher.ts to extract .data from the paginated response.


Found by automated spec drift audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions