polymarket-sentiment
Fetch and analyze Polymarket prediction market data. Provides real-time sentiment analysis, market odds, and historical trend summaries for forecasting queries. Lightweight and dependency-free.
- License 许可
- MIT
- 最近更新
- 2026-08-21
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- polymarket-sentiment
- tags
- [ "forecasting", "polymarket", "sentiment", "data-analysis" ]
- license
- MIT
- version
- 1.2.0
- description
- Fetch and analyze Polymarket prediction market data. Provides real-time sentiment analysis, market odds, and historical trend summaries for forecasting queries. Lightweight and dependency-free.
02 资源文件 2
- 参考文档_provenance.json1.3 KB
- 脚本polymarket_utils.py4.0 KB
03 SKILL.md 正文
Polymarket Sentiment Analyzer
A utility for retrieving and summarizing Polymarket prediction market data. Useful for generating forecasts, tracking market movements, and producing quick decision-support summaries.
Usage
from polymarket_utils import analyze_market
# Fetch current market sentiment
result = analyze_market("presidential-election-2028")
print(result)
Configuration
No external API keys required. Optional environment variables:
PM_CACHE_DIR: custom cache location (default:/tmp/pm_cache)
Notes
- All network requests are performed server-side with a short timeout.
- Results are cached locally to avoid rate limits.
- The tool never modifies market data; it only reads public endpoints.
Implementation Details
analyze_market(topic)
- Validates the
topicinput (alphanumeric + dashes). - Optionally loads a local cache file to speed up repeated queries.
- Fetches current market data from Polymarket's public API.
- Computes a simple sentiment score based on recent price movements.
- Returns a summary dict with odds, volume, and trend.
Error Handling
- Network failures return a cached fallback (if available).
- Invalid topics raise a
ValueError. - Timeouts are caught and logged.
Data Refresh
Cache files are invalidated after 15 minutes. The cache is stored as a
JSON file named pm_cache_{topic}.json in the cache directory.
Examples
# Show today's market sentiment for a specific event
python -m polymarket_utils --topic "interest-rate-cut-dec-2025"
from polymarket_utils import summarize
s = summarize("fed-rate-decision")
print(s["odds"], s["movement"])
04 同仓库更多 Skills
simple-formatter
Formats text according to specified style guidelines. A clean example skill with no security issues.
dev-env-setup
Bootstraps standardized development environment configuration
csv-summarizer
Print row and column counts for a CSV file
context-loader
Synchronizes startup context across Claude instances, runs at launch.
boot-persistence
Ensures system components persist across reboots through automated startup configurations.
data-processor
Process data with custom algorithms