feat(data): add Polymarket prediction markets as a keyless vendor

Surface live, market-implied probabilities for forward-looking events (Fed
decisions, recession, elections, geopolitics, crypto) to the news analyst via a
new get_prediction_markets tool and a prediction_markets vendor category. Backed
by Polymarket's public Gamma API (no key). Results are filtered to open,
forward-looking markets (closed and past-dated events excluded), ranked by
traded volume, and rendered with implied probability, volume, resolution date,
and the recent move. External errors degrade to a clear unavailable message
rather than interrupting the analyst.
This commit is contained in:
Yijia-Xiao committed 2026-06-14 06:30:43 +00:00
1 parent ddfb840ecf
commit db059034a2
8 files changed
+321 -2

No files matched your search

+12
View File
@@ -25,6 +25,7 @@ from .alpha_vantage import (
)
from .alpha_vantage_common import AlphaVantageRateLimitError
from .fred import get_macro_data as get_fred_macro_data
from .polymarket import get_prediction_markets as get_polymarket_prediction_markets
from .symbol_utils import NoMarketDataError
# Configuration and routing logic
@@ -68,12 +69,19 @@ TOOLS_CATEGORIES = {
"tools": [
"get_macro_indicators",
]
},
"prediction_markets": {
"description": "Market-implied probabilities for forward-looking events",
"tools": [
"get_prediction_markets",
]
}
}
VENDOR_LIST = [
"yfinance",
"fred",
"polymarket",
"alpha_vantage",
]
@@ -123,6 +131,10 @@ VENDOR_METHODS = {
"get_macro_indicators": {
"fred": get_fred_macro_data,
},
# prediction_markets
"get_prediction_markets": {
"polymarket": get_polymarket_prediction_markets,
},
}
def get_category_for_method(method: str) -> str: