Skip to content

SDK drift: filterMarkets/filter_markets treat a market missing resolutionDate oppositely — included in TypeScript, excluded in Python #1555

Description

@realfishsam

Drift

When a resolutionDate filter criterion is supplied and the candidate market's resolutionDate/resolution_date is falsy/missing, TypeScript keeps the market in the result set (the guard short-circuits and no exclusion happens), while Python explicitly excludes it. Same filter criteria + same market data yields opposite inclusion decisions across languages. This is the same category of bug as already-filed #1524 (priceChange24h), but on a different field (resolutionDate) not mentioned by that or any other filed issue.

TypeScript SDK

sdks/typescript/pmxt/client.ts:2948-2957:

// ResolutionDate filter
if (criteria.resolutionDate && market.resolutionDate) {
    const resDate = market.resolutionDate;
    if (criteria.resolutionDate.before && resDate >= criteria.resolutionDate.before) {
        return false;
    }
    if (criteria.resolutionDate.after && resDate <= criteria.resolutionDate.after) {
        return false;
    }
}

criteria.resolutionDate && market.resolutionDate short-circuits when the market's date is missing — the market is not rejected and proceeds to the remaining checks.

Python SDK

sdks/python/pmxt/client.py:2108-2119:

# Resolution Date
if "resolution_date" in params:
    f = params["resolution_date"]
    val = market.resolution_date

    if not val:
         continue

    if "before" in f and val >= f["before"]: continue
    if "after" in f and val <= f["after"]: continue

if not val: continue explicitly excludes the market from the results.

Expected

Both languages should apply the same rule for markets missing a resolution date under a resolutionDate filter — either both should keep them (treat filter as inapplicable) or both should exclude them.

Impact

Callers filtering markets by resolution-date range get silently different result sets in TypeScript vs. Python whenever some markets lack a resolution date (e.g. still-open/perpetual markets).


Found by automated SDK cross-language drift audit

Activity

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