You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript SDK's filterMarkets misreads resolutionDate filter — markets with no resolutionDate are included instead of excluded #2369
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){constresDate=market.resolutionDate;if(!resDate)returnfalse;// <-- exclude when missingif(criteria.resolutionDate.before&&resDate>=criteria.resolutionDate.before)returnfalse;if(criteria.resolutionDate.after&&resDate<=criteria.resolutionDate.after)returnfalse;}
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
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).
Activity
realfishsam commentedon Sep 16, 2026
Closing as duplicate of #1555. Same underlying finding: TypeScript's
filterMarkets/filter_marketsresolutionDate filter includes markets with a missingresolutionDatewhile Python (and core) excludes them — this issue re-identifies the samecriteria.resolutionDate && market.resolutionDateguard bug inclient.tsthat #1555 already documents in more detail (including the Python-side comparison).Generated by Claude Code
filterMarkets/filter_marketstreat a market missingresolutionDateoppositely — included in TypeScript, excluded in Python #1555