From a0cbdc0256554590c18a842154db6cc0cdf20cda Mon Sep 17 00:00:00 2001 From: chemavx Date: Thu, 16 Apr 2026 14:30:34 +0000 Subject: [PATCH] fix(polymarket): correct sports/tech/finance categorization + widen 90d window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add European football leagues (La Liga, Premier League, Bundesliga, etc.) to _SPORTS_EXCLUSIONS so those markets are filtered before category detection - Reorder _detect_category: check tech before crypto/finance so company-specific markets (OpenAI IPO, NVIDIA, Apple) resolve to "tech" instead of "crypto/finance" - Widen resolution horizon default from 60 to 90 days to surface more markets in the 0.08–0.92 uncertainty zone Co-Authored-By: Claude Sonnet 4.6 --- bot/data/polymarket.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bot/data/polymarket.py b/bot/data/polymarket.py index 8eb957b..7b1b773 100644 --- a/bot/data/polymarket.py +++ b/bot/data/polymarket.py @@ -94,6 +94,12 @@ class PolymarketClient: "playoffs", "playoff", "tournament", "tennis", " golf ", " ufc ", "boxing", "wrestler", "wrestling", "slam dunk", "home run", "touchdown", + # European / international football leagues + "la liga", "premier league", "bundesliga", "serie a", "ligue 1", + "champions league", "europa league", "conference league", + "copa del rey", "fa cup", "dfb pokal", + "relegation", "golden boot", "top scorer", + " liga ", "eredivisie", "primeira liga", ] @classmethod @@ -126,12 +132,15 @@ class PolymarketClient: """Return the category label for a market question, or '' if unsupported.""" if cls._is_sports(question): return "" # exclude sports regardless of other keyword matches - if cls._is_crypto_finance(question): - return "crypto/finance" if cls._is_politics(question): return "politics" + # Tech checked before crypto/finance: company-specific markets (OpenAI IPO, + # NVIDIA earnings, Apple antitrust) should be "tech" even when they contain + # generic finance keywords like "ipo" or "sec". if cls._is_tech(question): return "tech" + if cls._is_crypto_finance(question): + return "crypto/finance" if cls._is_events(question): return "events" return "" @@ -141,7 +150,7 @@ class PolymarketClient: min_volume: float = 500, pages: int = 3, page_size: int = 200, - max_days_to_resolution: int = 60, + max_days_to_resolution: int = 90, ) -> list[Market]: """Fetch active markets from Gamma API (no auth needed).