Skip to content

Commit 1499944

Browse files
committed
release: 2.50.14 — fix Router silently dropping exchange filter (types + Router.fetchMarketsImpl)
1 parent 0638530 commit 1499944

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.50.14] - 2026-06-18
6+
7+
### Fixed
8+
9+
- **`core/src/BaseExchange.ts` + `core/src/router/Router.ts` — Router silently dropped the venue filter.** Discovered while verifying the Bug #6 fix on hosted-pmxt: `router.fetch_markets(query="...", exchange="polymarket")` was returning Myriad rows (or anything else, depending on what the catalog ranked first by volume). Root cause: `MarketFilterParams` (and `EventFetchParams`) did not declare `sourceExchange` / `exchange` fields at all. So when a caller passed `exchange="polymarket"` as a kwarg, the value reached `Router.fetchMarketsImpl` but was dropped — `searchMarkets` / `searchEvents` accept `sourceExchange` as a query param, but `fetchMarketsImpl` only forwarded `query`, `category`, `limit`, `offset`, `closed`. The filter was effectively a no-op.
10+
- Added `sourceExchange?: string` and `exchange?: string` (alias) to both `MarketFilterParams` (which `MarketFetchParams` extends) and `EventFetchParams`.
11+
- Updated `Router.fetchMarketsImpl` and `Router.fetchEventsImpl` to forward `params?.sourceExchange ?? params?.exchange` to the underlying `searchMarkets` / `searchEvents` calls.
12+
- hosted-pmxt's `/v0/markets` and `/v0/events` raw REST routes only accepted `?sourceExchange=`; updated on branch `fix/v0-emit-catalog-uuid-as-outcomeid` to also accept `?exchange=` as an alias. Same Cloud Build trigger that deployed the Bug #6 fix will redeploy with this change.
13+
- Per `RouterMarketSearchParams` / `RouterEventSearchParams` (types.ts:152-168), the search client interface already declared `sourceExchange` — the wiring was just missing in the Router layer.
14+
- The bug was masked until 2.50.13 + hosted-pmxt Bug #6 fix: before the catalog-UUID emission fix, every Polymarket-shaped wire response *looked* Polymarket-shaped, so a missing filter just returned irrelevant Polymarket-ish rows. After the fix, the wire surfaces the true `sourceExchange`, and the filter being broken became visible (Polymarket-filter query returned Myriad rows tagged as such).
15+
516
## [2.50.13] - 2026-06-18
617

718
A second live-verification round + brain-reading session caught 11 more issues across SDK and docs. The brain-reading reframed Bug #6 (catalog UUID emission) and corrected the docs' settlement story — Opinion is NOT uniformly dual-signature; BUY is single sig + oracle DvP, SELL is dual-signed parallel.

core/src/BaseExchange.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ export interface MarketFilterParams {
8888
eventId?: string; // Find markets belonging to an event
8989
page?: number; // For pagination (used by Limitless)
9090
similarityThreshold?: number; // For semantic search (used by Limitless)
91+
/** Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias. */
92+
sourceExchange?: string;
93+
/** Alias for `sourceExchange`. */
94+
exchange?: string;
9195
}
9296

9397
export interface MarketFetchParams extends MarketFilterParams {
@@ -122,6 +126,10 @@ export interface EventFetchParams {
122126
category?: string;
123127
/** Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a "Politics" event might carry tags ["Politics", "Geopolitics", "Middle East", "Iran"]. Common tags include "Crypto", "Elections", "Fed Rates", "FIFA World Cup", "Trump". */
124128
tags?: string[];
129+
/** Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias. */
130+
sourceExchange?: string;
131+
/** Alias for `sourceExchange`. */
132+
exchange?: string;
125133
}
126134

127135
/**

core/src/router/Router.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export class Router extends PredictionMarketExchange {
166166
limit: params?.limit,
167167
offset: params?.offset,
168168
closed: params?.status === 'closed' || params?.status === 'inactive',
169+
sourceExchange: params?.sourceExchange ?? params?.exchange,
169170
});
170171
if (!Array.isArray(response)) {
171172
throw new Error(
@@ -196,6 +197,7 @@ export class Router extends PredictionMarketExchange {
196197
category: params?.category,
197198
limit: params?.limit,
198199
offset: params?.offset,
200+
sourceExchange: params?.sourceExchange ?? params?.exchange,
199201
});
200202
if (!Array.isArray(response)) {
201203
throw new Error(

0 commit comments

Comments
 (0)