Skip to content

SDK drift: Python exports named reusable filter-shape types (MinMax, DateRange, PriceFilter, VenueFilter, OutcomeType) that TypeScript only inlines anonymously #1441

Open

Description

@realfishsam

Drift

Python declares five standalone, importable type aliases/TypedDicts for filter-parameter shapes that TypeScript only ever writes as anonymous inline object/union types embedded inside other interfaces. This is the same "named vs. anonymous type" drift pattern as the already-filed TxPayload issue (#1168), but affects a distinct, larger set of types not covered by that issue.

Python SDK

sdks/python/pmxt/models.py:

  • MinMax (lines 677-680): {min: float, max: float} — used for volume_24h, volume, liquidity, open_interest, market_count, total_volume.
  • DateRange (lines 682-685): {before: datetime, after: datetime} — used for resolution_date.
  • PriceFilter (lines 687-691): {outcome: OutcomeType, min: float, max: float} — used for price/price_change_24h.
  • VenueFilter (line 845): Union[str, List[str]] — used for venues/exclude_venues (lines 859-860, 882-883).
  • OutcomeType (line 20): Literal["yes", "no", "up", "down"] — used at PriceFilter.outcome (line 689).

TypeScript SDK

No equivalents exist as named/exported types anywhere in sdks/typescript/pmxt/models.ts (confirmed via search). The identical shapes are inlined at:

  • lines 874, 877, 880, 883: { min?: number; max?: number } repeated 4x for volume24h/volume/liquidity/openInterest
  • lines 886-889: resolutionDate?: { before?: Date; after?: Date }
  • lines 898-902, 905-909: price/priceChange24h, each inlining outcome: 'yes'|'no'|'up'|'down'; min?: number; max?: number
  • lines 934, 937: marketCount/totalVolume: { min?: number; max?: number }
  • lines 1038, 1041: venues?: string | string[], excludeVenues?: string | string[]

Expected

TypeScript should export named types (MinMax, DateRange, PriceFilter, VenueFilter, OutcomeType) mirroring the Python shapes, so consumers of either language can reference the same reusable type by name.

Impact

Python consumers can import and reuse MinMax/DateRange/PriceFilter/VenueFilter/OutcomeType in their own function signatures or validation logic; TypeScript consumers have no importable equivalent and must either redefine the shape inline or reach for awkward indexed-access types (e.g. MarketFilterCriteria['volume']).


Found by automated SDK cross-language drift audit

Activity

  1. realfishsam commented on Oct 22, 2026

    @realfishsam
    ContributorAuthor

    Additional context from duplicate #2075: the OutcomeType union is inlined twice in MarketFilterCriteria in TS (sdks/typescript/pmxt/models.ts:911 and :918) vs. OutcomeType = Literal["yes","no","up","down"] at sdks/python/pmxt/models.py:20 (reused at :707). Literal values match exactly; this is purely an export-surface gap. An open PR (#2083, "export OutcomeType alias") addresses the OutcomeType part.


    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