- name
- polymarket-weather
- description
- Pull live Polymarket weather-market data (all city temperature events worldwide) plus the daily weather-leaderboard winners and biggest-wins feed, then compile everything into a polished, formatted .xlsx daily report. New in v3: a full trading bot that finds +EV opportunities across three forecast models. Use this skill whenever the user asks for Polymarket weather picks, weather-market odds across cities, prediction-market temperature data, the daily Polymarket weather report, top weather traders or leaderboard, biggest weather wins, or any combination of "Polymarket" and "weather" — even if they don't explicitly mention a spreadsheet. Also use when the user wants to refresh, regenerate, or rerun an existing weather report, or wants to run the weather trading bot.
# Polymarket Weather Daily Report + Trading Bot
This skill produces two deliverables:
1. **A multi-sheet .xlsx report** with today's Polymarket weather-market state plus the leaderboard of who's making (and losing) money on those markets.
2. **A trading bot** (`trade_executor.py`) that finds +EV opportunities using three-model consensus (ICON + ECMWF + GFS) with strict price filters and 3-bin coverage.
## What the report contains
The output workbook contains nine sheets:
1. **🎯 Top Picks** — actionable edges only (not near-resolved, edge > 3%, sorted by tier + edge)
2. **📊 Summary** — one row per event; crowd vs combined model consensus
3. **📈 All Markets** — every bucket of every active daily temperature event with Yes-price (implied probability), bucket label, market type, city, resolution date, and per-bucket volume
4. **🌤 Forecasts** — deterministic + ensemble summary per city
5. **💰 Smart Money** — tracked top-wallet open positions in weather markets
6. **🏆 Top Winners Today** — daily weather leaderboard
7. **🏆 Top Winners Week** — weekly weather leaderboard
8. **🥇 Biggest Wins** — individual largest single-market wins of the day with trader, market, and payout
9. **📖 Method & Caveats** — what the numbers mean, what they don't, and the systematic edges
## Trading Bot
The bot implements a strategy iterated over three versions that went from losing $63 to making $43 in 3 days (+45.9% ROI on $130 bankroll).
**Core edge:** combines calibrated forecasts from three Open-Meteo models (ICON-D2, ECMWF IFS 0.25°, GFS seamless) with `bias_correction=true`, strict price filters, and 3-bin coverage to guarantee positive expected value on every trade placed.
**Key design decisions:**
- **Entry timing:** only trades 18–30 hours before resolution (markets lag model updates there)
- **Three-bin coverage:** buys center bin ±1 neighbor instead of single bin, raising win rate from 18% → 30%
- **Price filter:** sum of three bin YES prices ≤ 95¢, each bin ∈ [1¢, 45¢]
- **Model spread filter:** skips events where models diverge > 3°C; requires at least two models within 1°C for high-confidence trades
- **Correct coordinates:** hard-coded station-level lat/lng matching Polymarket resolution stations
### Running the bot
```bash
# Paper trade (logs hypothetical trades, no real money)
python scripts/trade_executor.py --mode paper --once
# Paper trade with continuous scanning (every 10 minutes)
python scripts/trade_executor.py --mode paper --interval 600
# Live trading (requires Polymarket CLOB API credentials)
python scripts/trade_executor.py --mode live --api-key <key> --api-secret <secret> --passphrase <phrase>
```
### Trading config
Edit `scripts/config_trading.json` to adjust:
- `bankroll` — total capital ($130 default)
- `max_stake_per_bin` — per-bin wager ($2 default)
- `entry_window_min_hours` / `entry_window_max_hours` — 18/30 default
- `max_combined_price` — 0.95 (guarantees math edge)
- `max_bin_price` — 0.45 (avoids overpriced bins)
- `trade_cities` — whitelist of cities to trade
- `city_bias_celsius` — manual per-city adjustments (e.g., Hong Kong +1°C)
- `mode` — "paper" or "live"
### Dependencies
```bash
pip install requests websockets web3 scipy numpy schedule python-dotenv py-clob-client openpyxl
```
## When to run
Run the report whenever the user asks for:
- "Polymarket weather picks / report / data / odds / forecast"
- "Best weather markets today"
- "Who's winning the weather markets"
- "Refresh / regenerate / update the weather spreadsheet"
- Anything combining Polymarket + temperature + a city or "today"
Run the trading bot whenever the user wants to find +EV weather trades or monitor the market.
Don't run for non-weather Polymarket questions (politics, sports, crypto markets, etc.) — this skill is weather-only.
## How to run the report
One command from the skill directory:
```bash
python scripts/build_report.py --output /mnt/user-data/outputs/polymarket_weather_<YYYY-MM-DD>.xlsx
```
The script does everything end-to-end: fetches markets, fetches leaderboard, builds the workbook, recalculates formulas. Use the current date for the filename so older runs are kept.
If the user wants partial output (just markets, just leaderboard), the individual fetchers can be run alone — see "Component scripts" below.
## Component scripts
- `scripts/fetch_markets.py` — calls the Polymarket Gamma API with `tag_slug=weather`, filters for daily-temperature events, emits normalized JSON records
- `scripts/fetch_leaderboard.py` — fetches today's weather leaderboard (top traders + biggest wins)
- `scripts/build_report.py` — orchestrator; calls both fetchers + edge analysis, builds the 9-sheet workbook
- `scripts/fetch_forecasts.py` — fetches THREE model ensembles (ICON + ECMWF + GFS) from Open-Meteo with `bias_correction=true`
- `scripts/fetch_deterministic.py` — fetches NWS + Weather Underground point forecasts
- `scripts/analyze_edges.py` — combines all forecast sources into weighted per-bucket probabilities, computes edge vs crowd price
- `scripts/fetch_wallet_positions.py` — tracks smart-money wallet positions in weather markets
- `scripts/bucket_parser.py` — parses Polymarket temperature bucket labels into numeric ranges
- `scripts/trade_executor.py` — the full trading bot (new in v3)
## Formatting standards (report)
- **Font**: Arial 10 throughout
- **Headers**: bold white text on dark-blue fill (RGB 31,73,125), centered, frozen top row
- **Numbers**: percentages as `0.0%`, dollars as `$#,##0`, volume as `$#,##0`. Negative dollars in parentheses
- **Column widths**: auto-fit based on max content, hard min 12 and max 40
- **Zebra striping**: alternate row fill `F2F2F2`
- **Conditional formatting** on Summary: green-to-red 3-color scale for consensus confidence
- **Top Winners**: gold/silver/bronze fill for ranks 1/2/3
- **Method sheet**: no table, titled prose blocks, bold headings, plain body text
## Edge cases & gotchas
- **Stale events**: filter to `endDate` within `[today, today+2 days]` UTC
- **Multi-day report runs**: group by `(city, market_type, resolution_date)`
- **City name normalization**: split on " on " from the right, not "in" from the left
- **Bucket parse**: keep labels as strings — boundary buckets are inequalities
- **Leaderboard handle vs. address**: display first 8 chars + ellipsis for unnamed traders
- **Rate limits**: cache market data 5 min, leaderboard 15 min, forecasts 30 min
- **Model coordinates**: `city_metadata.json` uses station-level lat/lng (NOT city centers). If Polymarket changes a resolution station, update this file immediately.
- **Fahrenheit bin gaps**: markets sometimes skip temperatures (e.g., 56-57°F then 58-59°F). The bot snaps forecasts to the nearest listed bin midpoint.
## Known limitations
- **Hong Kong**: still underperforms during rapid spring warming. The config includes a +1°C manual bias, but this may be seasonal.
- **Tokyo/Korea**: station codes verified but model accuracy varies; monitor closely.
- **Paid ensembles** (Visual Crossing, Tomorrow.io, ECMWF ADS) may add 5-10% ROI at $1000+ bankrolls but are not yet integrated.
## After producing the file
Use `present_files` with the output path. Give a one-paragraph summary of what's in it (cities covered, top consensus pick, top trader) and stop. No long postamble — the user opens the spreadsheet.
View on GitHub