Polymarket Gamma & Activity Feed Resolver
mlb odds, baseball volume, and trade history fallbacks
Published: 2026-06-26 | Project: Software as Glass Monorepo | Discipline: Web3 Primitives & Cryptographic Routing
Author: Nicholas Alexander MacAskill — Founder & CTO, Flocano Labs | Canonical: https://www.nicholasmacaskill.com/dossier/memoirs-polymarket-feed
MLB Odds Pipeline
Upcoming markets are fetched from the Gamma events endpoint filtered by series_id=3. Each event scans child markets, keeps only moneyline slates (excluding yes/no props and run totals), sorts by gameStartTime, and caps output at five future games.
Production Wallet Fallback
Vercel production lacked wallet env vars, so PolymarketApi resolves the profile address from POLY_PROXY_ADDRESS, a public proxy constant, or the authenticated wallet. Trade history tries CLOB first, then falls back to the public activity API:
const clobTrades = await Promise.race([
Promise.all([
this.getTradesForAddress(proxy, maxPages),
this.getTradesForAddress(eoa, maxPages),
]).then(([proxyTrades, eoaTrades]) => dedupe([...proxyTrades, ...eoaTrades])),
new Promise<any[]>((resolve) => setTimeout(() => resolve([]), 8_000)),
]);
if (clobTrades.length > 0) return clobTrades;
return this.getTradesFromActivity(address, maxPages);Baseball Volume Filter
Season baseball volume sums usdcSize from activity rows where slug or title matches mlb, kbo, or baseball keywords — giving a baseball-only notional figure separate from hockey/NBA/crypto trades.