Skip to content

Python SDK fetch_market_matches dispatches to core's deprecated fetchMatches instead of fetchMarketMatches — no GET route, no OpenAPI entry #2202

Description

@realfishsam

Gap

The Python SDK's primary matching method posts to core's deprecated fetchMatches operation, while the TypeScript SDK correctly uses fetchMarketMatches. The two SDKs' identically-named public methods therefore hit two different core entry points. fetchMatches is not registered in method-verbs.json, so it has no GET route and no entry in the published OpenAPI spec, and every Python match call emits a server-side deprecation warning. It only works at all because the sidecar's POST route dispatches by reflection rather than a registered operation.

Core

core/src/router/Router.ts:502-506:

/** @deprecated Use {@link fetchMarketMatches} instead. */
async fetchMatches(params: FetchMatchesParams): Promise<MatchResult[]> {
    logger.warn('fetchMatches is deprecated, use fetchMarketMatches instead');

core/src/server/method-verbs.json has an entry for fetchMarketMatches (verb get) but no fetchMatches key. docs/api-reference/openapi.json exposes /api/router/fetchMarketMatches and /api/router/fetchEventMatches but no /api/router/fetchMatches. The deprecated method only resolves via reflection at core/src/server/app.ts:453 (if (typeof exchange[methodName] !== "function")).

TypeScript SDK

Correct — sdks/typescript/pmxt/router.ts:276: await this.sidecarReadRequest('fetchMarketMatches', query, [query]).

Python SDK

sdks/python/pmxt/router.py:207: raw = self._call_method("fetchMatches", params) — inside fetch_market_matches (line 153), meaning the non-deprecated Python method name is permanently wired to core's deprecated method. The already-deprecated fetch_matches (line 232) also delegates to the same code path. _call_method builds POST {host}/api/{exchange}/{method} at client.py:1205.

Evidence

Core marks fetchMatches @deprecated and logs a warning on every call (Router.ts:502-506); it has no registered verb in method-verbs.json and no OpenAPI operation, unlike fetchMarketMatches. Python's router.py:207 calls self._call_method("fetchMatches", params) from inside its supposedly-current fetch_market_matches.

Impact

Python's non-deprecated call path is permanently pinned to a deprecated core method: no GET/idempotent-read route exists for it, it has no OpenAPI operation (so any gateway or proxy that allowlists documented operations rejects it), it logs a spurious deprecation warning on every legitimate call, and it will break outright when core eventually removes fetchMatches. Not covered by #1818 (surfacing deprecation to users) or #1331 (typed overloads) — this is a wrong dispatch target, not a missing type or missing warning surface.


Found by automated Core-to-SDK surface coverage audit

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