Skip to content

TypeScript SDK Router.fetchMarketMatches missing minDifference and sort parameters #1149

Description

@realfishsam

Gap

The core FetchMarketMatchesParams type (in core/src/router/types.ts) defines two browse-mode parameters — minDifference and sort — that are absent from the TypeScript SDK's Router.fetchMarketMatches method signature. These parameters allow callers to filter matches by minimum price spread and to sort results by confidence, volume, or price difference. The Python SDK issue for the same missing parameters is tracked in #858; this issue covers the TypeScript SDK.

Core

File: core/src/router/types.ts

interface FetchMarketMatchesParams {
  query?: string;
  category?: string;
  market?: UnifiedMarket;
  marketId?: string;
  slug?: string;
  url?: string;
  relation?: MatchRelation;
  minConfidence?: number;
  limit?: number;
  includePrices?: boolean;
  minDifference?: number;   // ← Browse mode: minimum price difference between venues
  sort?: 'confidence' | 'volume' | 'priceDifference';  // ← Browse mode: sort order
}

minDifference filters out matches where the absolute price spread between venues falls below the threshold. sort controls result ordering in browse mode (when no marketId/slug/url anchor is provided).

TypeScript SDK

File: sdks/typescript/pmxt/router.ts, lines 232–283

The fetchMarketMatches overloads accept:

fetchMarketMatches(market: UnifiedMarket): Promise<MatchResult[]>
fetchMarketMatches(params: {
    market?: UnifiedMarket;
    marketId?: string;
    slug?: string;
    url?: string;
    query?: string;
    category?: string;
    relation?: MatchRelation;
    minConfidence?: number;
    limit?: number;
    includePrices?: boolean;
    // minDifference and sort are absent
}): Promise<MatchResult[]>

minDifference and sort do not appear in either overload or in the models.ts file.

Python SDK

File: sdks/python/pmxt/router.py, lines 147–160

fetch_market_matches exposes: market, market_id, slug, url, query, category, relation, min_confidence, limit, include_prices — also missing min_difference and sort (tracked in #858).

Evidence

grep -n "minDifference\|sort" sdks/typescript/pmxt/router.ts returns no matches for minDifference; sort appears only in fetchMatchedMarketClusters / fetchMatchedEventClusters, not in fetchMarketMatches. core/src/router/types.ts explicitly defines both fields on FetchMarketMatchesParams. The Python gap is confirmed by #858.

Impact

TypeScript users cannot use Router.fetchMarketMatches in browse mode with price-spread filtering or custom sort order. This means the TypeScript SDK cannot reproduce the "show me all markets with a price difference ≥ N%" workflow that the core router supports. Users who need this must implement their own client-side post-filtering, which requires fetching all matches first (more network traffic, more latency) and still cannot replicate server-side sort.


Found by automated Core-to-SDK surface coverage audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions