fix(polymarket): correct sports/tech/finance categorization + widen 90d window
CI/CD / build-and-push (push) Successful in 2m31s
CI/CD / build-and-push (push) Successful in 2m31s
- 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 <noreply@anthropic.com>
This commit is contained in:
+12
-3
@@ -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).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user