alteregoeth-ai/weatherbot: Automated Polymarket Weather Trading in Python↗ Bright Coding Blog
Prediction markets like Polymarket create genuine opportunities for traders who can process real-world data faster and more accurately than the crowd. Weather markets — where participants bet on temperature outcomes for specific cities — are particularly interesting because they resolve against objective, verifiable meteorological data. The challenge is execution: fetching forecasts from multiple sources, matching them to the right market buckets, sizing positions correctly, and managing risk without overcomplicating the stack.
alteregoeth-ai/weatherbot solves this directly. It's a pure-Python, MIT-licensed trading bot with 364 GitHub stars and 129 forks that automates weather market trading on Polymarket using real forecast data from ECMWF, HRRR/GFS, and METAR sources across 20 global cities. No SDK dependencies, no black-box logic — just transparent Python that you can audit, modify, and run yourself.
What is alteregoeth-ai/weatherbot?
alteregoeth-ai/weatherbot is an automated trading system purpose-built for Polymarket's weather prediction markets. Developed by alteregoeth-ai and last updated on March 22, 2026, it represents a specific niche in the broader algorithmic trading and prediction market tooling space: event-driven automated trading with direct data-source integration.
The project ships in two forms. bot_v1.py provides the foundational logic — scanning 6 US cities, fetching National Weather Service forecasts via airport station coordinates, finding matching temperature buckets on Polymarket, and entering trades when market prices fall below a configurable threshold. This stripped-back version exists explicitly for understanding and education.
weatherbet.py is the production system. It expands coverage to 20 cities across 4 continents, integrates three distinct forecast sources (ECMWF for global coverage, HRRR/GFS for high-resolution US hourly forecasts, and METAR for real-time station observations), and adds mathematical rigor through Expected Value filtering and Kelly Criterion position sizing. The bot also implements stop-loss and trailing stop mechanics, slippage filtering, self-calibration based on historical forecast accuracy per city, and comprehensive JSON-based data storage for every forecast snapshot, trade, and resolution.
The repository's 364 stars and 129 forks suggest genuine interest from developers exploring prediction market automation, quantitative trading strategies, or alternative data applications. Its MIT license permits commercial use and modification without restriction.
Key Features
Multi-source forecast integration. The bot pulls from Open-Meteo (ECMWF and HRRR/GFS, no API key required), Aviation Weather (METAR observations, also keyless), and uses Visual Crossing (free tier) for post-resolution temperature verification. This layered approach reduces single-source dependency and catches discrepancies that might indicate forecast uncertainty.
Mathematical position sizing. Rather than fixed bet sizes, alteregoeth-ai/weatherbot uses fractional Kelly Criterion (default 0.25x) to scale positions proportionally to perceived edge. Combined with Expected Value filtering (minimum 0.05 EV by default), this prevents negative-expectation trades — a common failure mode in naive automation.
Risk management infrastructure. A 20% stop-loss with automatic breakeven trailing at +20% provides downside protection. The slippage filter skips markets where bid-ask spread exceeds $0.03, avoiding execution on illiquid contracts where entry price uncertainty undermines edge calculation.
Self-calibration system. The bot stores every forecast and outcome in data/markets/, then learns per-city forecast accuracy over time. This matters because meteorological models perform differently by geography — ECMWF may systematically underpredict Tokyo summer highs while overpredicting London winter lows. The calibration minimum is 30 observations per city before adjustments apply.
Airport-coordinate precision. This is architecturally significant. Polymarket weather markets resolve on specific airport weather stations, not city centers. NYC resolves on LaGuardia (KLGA), Dallas on Love Field (KDAL), Chicago on O'Hare (KORD). City-center coordinates can diverge 3–8°F from airport readings — catastrophic on 1–2°F bucket markets. The bot hardcodes correct station mappings.
Use Cases
Quantitative prediction market trading. For developers with statistical or finance backgrounds, alteregoeth-ai/weatherbot provides a complete, auditable framework for systematic weather market participation. The Kelly + EV architecture aligns with established quantitative methods, while the pure-Python implementation allows strategy modifications without navigating opaque SDKs.
Alternative data strategy development. Weather derivatives and energy trading firms often maintain proprietary forecast-evaluation systems. This open-source implementation offers a transparent reference architecture for similar pattern-matching approaches in other event-driven markets — political, economic, or sports outcomes with resolvable real-world data.
Educational quantitative finance. The dual-version structure (bot_v1.py and weatherbet.py) makes this repository unusually pedagogical. Instructors or self-directed learners can trace how a simple scanner evolves into a production system with risk management, multi-source validation, and performance tracking.
Forecast accuracy benchmarking. The JSON data archive enables retrospective analysis of meteorological model performance. Researchers or hobbyists can compare ECMWF vs. HRRR/GFS accuracy by city, season, and lead time — independent of trading applications.
Prediction market infrastructure research. For developers building adjacent tools — market makers, arbitrage systems, or portfolio trackers — alteregoeth-ai/weatherbot demonstrates direct Polymarket API interaction without official SDK dependencies, useful for understanding the underlying data structures.
Installation & Setup
The installation is intentionally minimal. Clone the repository and install the single dependency:
git clone https://github.com/alteregoeth-ai/weatherbot
cd weatherbot
pip install requests
Create config.json in the project folder with your parameters:
{
"balance": 10000.0,
"max_bet": 20.0,
"min_ev": 0.05,
"max_price": 0.45,
"min_volume": 2000,
"min_hours": 2.0,
"max_hours": 72.0,
"kelly_fraction": 0.25,
"max_slippage": 0.03,
"scan_interval": 3600,
"calibration_min": 30,
"vc_key": "YOUR_VISUAL_CROSSING_KEY"
}
Configuration breakdown:
balance: Starting capital for position sizing calculationsmax_bet: Hard ceiling per-position, overriding Kelly-derived sizemin_ev: Minimum expected value threshold — trades below this are skippedmax_price: Maximum market price to enter (avoids expensive low-upside positions)min_volume: Minimum market volume filter for liquiditymin_hours/max_hours: Time window — markets too close or too far from resolution are excludedkelly_fraction: Fractional Kelly multiplier (0.25 = quarter-Kelly for conservative sizing)max_slippage: Bid-ask spread tolerance in dollarsscan_interval: Seconds between full market scans (3600 = hourly)calibration_min: Observations required before city-specific calibration appliesvc_key: Visual Crossing API key for resolution verification
Get a free Visual Crossing API key at visualcrossing.com. Open-Meteo and Aviation Weather require no authentication.
Real Code Examples
The README provides three usage patterns. Start the bot for continuous operation:
python weatherbet.py # start the bot — scans every hour
This launches the full scanning loop. The bot fetches forecasts, evaluates active markets, enters qualifying positions, monitors stops every 10 minutes, and performs complete scans hourly. The comment in the README — scans every hour — corresponds to the scan_interval: 3600 default.
Check current status without disrupting operation:
python weatherbet.py status # balance and open positions
Useful for headless deployments or cron-based health checks. Returns aggregated balance and open position summary without triggering new scans.
Generate performance analytics:
python weatherbet.py report # full breakdown of all resolved markets
This queries the JSON data archive in data/markets/ to produce PnL breakdowns. The README notes this data persists every forecast snapshot, trade, and resolution outcome — enabling both this reporting and the self-calibration system.
The bot_v1.py entry point exists for educational inspection but lacks the mathematical and risk features. Run it similarly:
python bot_v1.py
No subcommands — it executes the basic scan-and-trade loop for the original 6-city US coverage.
Advanced Usage & Best Practices
Simulation-first deployment. The README explicitly warns: "Run the simulation thoroughly before committing real capital." While no dedicated simulation flag is documented, the max_bet parameter and balance configuration allow paper-trading equivalent by setting negligible position sizes or monitoring output without API credentials.
Calibration patience. The default calibration_min: 30 means new cities or initial deployment operate without accuracy-adjusted sizing for approximately 30 trades. Consider this in backtesting expectations — early trades use unadjusted model probabilities.
Forecast source weighting. The README documents three sources but doesn't specify combination logic. In practice, ECMWF provides baseline global coverage, HRRR/GFS adds US hourly granularity, and METAR grounds near-resolution predictions in observations. Users modifying the source weighting should understand each model's typical error characteristics for their target cities.
Station coordinate verification. The hardcoded airport mappings are critical correctness infrastructure. If Polymarket changes resolution stations (uncommon but possible), the bot requires manual update. The README's station table should be treated as authoritative reference, not merely documentation.
Data archive utilization. The data/markets/ JSON files enable strategy research beyond the built-in calibration. Consider periodic export to [INTERNAL_LINK: data-analysis-tools] for visualization or alternative model development.
Comparison with Alternatives
| Tool | Approach | Key Difference | Trade-off |
|---|---|---|---|
| alteregoeth-ai/weatherbot | Pure Python, multi-source forecasts, Kelly sizing | Full transparency, no SDK dependencies | Self-hosted, manual configuration |
| Polymarket official tools | Web UI, manual trading | Zero setup, human judgment | No automation, slower execution |
| Generic crypto trading bots (Hummingbot, etc.) | Multi-exchange, strategy templates | Broader exchange support | No weather data integration, Polymarket support often limited |
alteregoeth-ai/weatherbot occupies a narrow but defensible niche: automated prediction market trading with direct meteorological data integration. Generic bots lack the forecast-source architecture; manual trading lacks the systematic edge-calculation and execution speed. The trade-off is operational complexity — you maintain the infrastructure, data pipelines, and risk parameters yourself.
FAQ
Is alteregoeth-ai/weatherbot free to use? Yes, MIT licensed. No usage restrictions.
What Python version is required?
The README doesn't specify; requests is the only dependency, suggesting broad compatibility.
Does it require a Polymarket account? Yes, implied by trading functionality though not explicitly stated in the README.
Can I run this without real money?
The README recommends simulation but doesn't document a simulation mode. Set minimal max_bet for observation.
Which cities are supported? 20 across 4 continents: US, Europe, Asia, South America, Oceania. Six US cities in v1.
How often does it trade? Full scan every hour; stop monitoring every 10 minutes.
Is this financial advice? No. The README explicitly states: "This is not financial advice. Prediction markets carry real risk."
Conclusion
alteregoeth-ai/weatherbot delivers exactly what its README promises: a transparent, mathematically grounded, pure-Python system for automated weather market trading on Polymarket. The 364 stars and active maintenance through March 2026 suggest sustained relevance. It's best suited for developers comfortable with quantitative methods, self-hosted infrastructure, and prediction market mechanics — not for traders seeking turnkey solutions or those unwilling to audit and configure their own risk parameters.
The airport-coordinate precision, multi-source forecast integration, and Kelly-based position sizing demonstrate genuine engineering care. The dual-version structure respects both production users and learners. If you're exploring algorithmic prediction market participation, weather-derived alternative data strategies, or simply want to study a well-architected Python trading system, start here.
Explore the repository: https://github.com/alteregoeth-ai/weatherbot