Skip to content

TypeScript SDK filterMarkets() includes markets with missing resolutionDate instead of excluding them #1969

Closed as duplicate

Description

@realfishsam

Gap

When a caller filters markets by resolutionDate and a given market has no resolutionDate set, core (and the Python SDK) correctly excludes that market from the results. The TypeScript SDK's reimplementation of this filter does the opposite: it silently lets the market pass the filter.

Core

core/src/BaseExchange.ts:1434-1444 — inside the ResolutionDate filter block: if (criteria.resolutionDate) { const resDate = market.resolutionDate; if (!resDate) return false; ... }. A market with no resolutionDate is explicitly excluded whenever the caller filters on resolutionDate.

TypeScript SDK

sdks/typescript/pmxt/client.ts:3088-3096 — the condition is if (criteria.resolutionDate && market.resolutionDate) { ... }. When market.resolutionDate is falsy, the entire block is skipped, so the market is never excluded and passes the filter instead.

Python SDK

Matches core correctly: sdks/python/pmxt/client.py:2217-2227 explicitly does if not val: continue (excludes) when resolutionDate is missing.

Evidence

Direct read of core/src/BaseExchange.ts:1430-1446 vs sdks/typescript/pmxt/client.ts:3080-3100 vs sdks/python/pmxt/client.py:2217-2227 confirms the TypeScript condition (criteria.resolutionDate && market.resolutionDate) diverges from both core's and Python's (if (!resDate) return false / if not val: continue).

Impact

exchange.filterMarkets(markets, { resolutionDate: {...} }) in the TypeScript SDK silently returns markets that should have been filtered out whenever market.resolutionDate is unset — a data-correctness bug specific to the TypeScript client-side reimplementation of this filter.


Found by automated Core-to-SDK surface coverage audit

Activity

  1. realfishsam commented on Aug 10, 2026

    @realfishsam
    ContributorAuthor

    Closing as duplicate of #1555. Same underlying finding: filterMarkets/filter_markets treat a market missing resolutionDate oppositely (TypeScript includes it, Python/core exclude it). Relevant context has been copied over.


    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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions