Skip to content

TypeScript SDK's filterMarkets misreads resolutionDate filter — markets with no resolutionDate are included instead of excluded #2369

Closed as duplicate

Description

@realfishsam

Gap

Core's filterMarkets explicitly excludes a market from resolutionDate filtering when the market has no resolutionDate set. The TypeScript SDK's reimplementation does the opposite: it silently includes such markets, because its guard condition requires market.resolutionDate to be truthy before applying (or skipping) the filter.

Core

core/src/BaseExchange.ts:1435-1444:

if (criteria.resolutionDate) {
    const resDate = market.resolutionDate;
    if (!resDate) return false;   // <-- exclude when missing
    if (criteria.resolutionDate.before && resDate >= criteria.resolutionDate.before) return false;
    if (criteria.resolutionDate.after && resDate <= criteria.resolutionDate.after) return false;
}

TypeScript SDK

sdks/typescript/pmxt/client.ts:3089 — the equivalent block is gated as if (criteria.resolutionDate && market.resolutionDate), so when market.resolutionDate is falsy the whole block is skipped and the market passes the filter (included) instead of being excluded.

Python SDK

Not checked in this pass — flag for a follow-up spot check since the Python filter_markets implementation was otherwise found to match core.

Evidence

Read core/src/BaseExchange.ts:1435-1444 and sdks/typescript/pmxt/client.ts:3089 side by side; the divergent null-handling was confirmed directly in both files.

Impact

exchange.filterMarkets(markets, { resolutionDate: { before: X } }) returns a different result set in the TypeScript SDK than the equivalent call against core for any market missing a resolutionDate — the SDK silently includes markets that core would exclude.


Found by automated Core-to-SDK surface coverage audit

Activity

  1. realfishsam commented on Sep 16, 2026

    @realfishsam
    ContributorAuthor

    Closing as duplicate of #1555. Same underlying finding: TypeScript's filterMarkets/filter_markets resolutionDate filter includes markets with a missing resolutionDate while Python (and core) excludes them — this issue re-identifies the same criteria.resolutionDate && market.resolutionDate guard bug in client.ts that #1555 already documents in more detail (including the Python-side comparison).


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-sdk-gapCore engine capabilities not exposed in SDKs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions