2026-03-03 15:32:53 -06:00
# 🌤 Weather Trading Bot — Polymarket
2026-03-10 13:41:05 -05:00
Automated weather market trading bot for Polymarket. Finds mispriced temperature outcomes using real station data from NWS.
2026-03-03 15:32:53 -06:00
2026-03-04 00:40:52 -06:00
No SDK. No black box. Pure Python.
---
## Versions
2026-03-10 13:41:05 -05:00
### `bot_v1.py` — Base Bot (current)
2026-03-09 02:26:29 -05:00
2026-03-10 13:41:05 -05:00
The foundation. Scans 6 US cities, fetches forecasts from NWS using airport station coordinates, finds matching temperature buckets on Polymarket, and enters trades when the market price is below the entry threshold.
2026-03-04 00:40:52 -06:00
No math, no complexity. Just the core logic — good for understanding how the system works.
2026-03-10 13:41:05 -05:00
### `bot_v2.py` — Kelly + EV Edition (coming soon)
2026-03-09 02:26:29 -05:00
2026-03-04 00:40:52 -06:00
Everything in v1, plus:
2026-03-09 02:26:29 -05:00
2026-03-04 00:40:52 -06:00
- **Expected Value** — skips trades where the math doesn't work
- **Kelly Criterion** — sizes positions based on edge strength, not a flat %
- **Auto-exit** — closes positions when price hits the exit threshold
2026-03-09 02:26:29 -05:00
- **Live dashboard** — updates `simulation.json` so the dashboard stays current
2026-03-04 00:40:52 -06:00
2026-03-03 15:32:53 -06:00
---
## How It Works
2026-03-09 02:26:29 -05:00
Polymarket runs markets like "Will the highest temperature in Chicago be between 46– 47°F on March 7?" These markets are often mispriced — the forecast says 78% likely but the market is trading at 8 cents.
2026-03-03 15:32:53 -06:00
The bot:
2026-03-09 02:26:29 -05:00
2026-03-10 13:41:05 -05:00
1. Fetches forecasts from NWS using airport coordinates
2026-03-09 02:26:29 -05:00
2. Combines real station observations with hourly forecast to get the true daily maximum
3. Finds the matching temperature bucket on Polymarket
2026-03-10 13:41:05 -05:00
4. Enters the trade if market price is below the entry threshold
5. Runs a full $1,000 simulation against real market prices before you risk anything
2026-03-09 02:26:29 -05:00
---
## Why Airport Coordinates Matter
Most bots use city center coordinates. That's wrong.
Every Polymarket weather market resolves on a specific airport station. NYC resolves on LaGuardia (KLGA), Dallas on Love Field (KDAL) — not DFW. The difference between city center and airport can be 3– 8°F. On markets with 1– 2°F buckets, that's the difference between the right trade and a guaranteed loss.
| City | Station | Airport |
|------|---------|---------|
| NYC | KLGA | LaGuardia |
| Chicago | KORD | O'Hare |
| Miami | KMIA | Miami Intl |
| Dallas | KDAL | Love Field |
| Seattle | KSEA | Sea-Tac |
| Atlanta | KATL | Hartsfield |
2026-03-03 15:32:53 -06:00
---
## Installation
```bash
git clone https://github.com/alteregoeth-ai/weatherbot
cd weatherbot
2026-03-10 13:41:05 -05:00
pip install requests
2026-03-03 15:32:53 -06:00
```
2026-03-10 13:41:05 -05:00
Create `config.json` in the project folder:
2026-03-04 00:40:52 -06:00
2026-03-03 15:32:53 -06:00
```json
{
"entry_threshold" : 0.15 ,
"exit_threshold" : 0.45 ,
2026-03-04 00:40:52 -06:00
"max_trades_per_run" : 5 ,
2026-03-10 13:41:05 -05:00
"min_hours_to_resolution" : 2 ,
"locations" : "nyc,chicago,miami,dallas,seattle,atlanta"
2026-03-03 15:32:53 -06:00
}
```
---
## Usage
2026-03-04 00:40:52 -06:00
```bash
2026-03-09 02:26:29 -05:00
python bot_v1.py # paper mode — shows signals, no trades
python bot_v1.py --live # simulates trades with $1,000 balance
python bot_v1.py --reset # reset balance back to $1,000
2026-03-10 13:41:05 -05:00
python bot_v1.py --positions # show open positions and PnL
2026-03-04 00:40:52 -06:00
```
2026-03-03 15:32:53 -06:00
---
## Configuration
| Parameter | Default | Description |
2026-03-04 00:40:52 -06:00
|-----------|---------|-------------|
2026-03-03 15:32:53 -06:00
| `entry_threshold` | `0.15` | Buy below this price |
| `exit_threshold` | `0.45` | Sell above this price |
2026-03-09 02:26:29 -05:00
| `max_trades_per_run` | `5` | Max new trades per scan |
2026-03-03 15:32:53 -06:00
| `min_hours_to_resolution` | `2` | Skip if resolves too soon |
2026-03-10 13:41:05 -05:00
| `locations` | `nyc,...` | Cities to scan (comma separated) |
2026-03-03 15:32:53 -06:00
---
2026-03-09 02:26:29 -05:00
## APIs Used
| API | Auth | Purpose |
|-----|------|---------|
| NWS (api.weather.gov) | None | US city forecasts + station observations |
| Polymarket Gamma | None | Market data |
| Polymarket CLOB | Wallet key | Live trading (optional) |
---
2026-03-03 15:32:53 -06:00
## Live Trading
The bot runs in simulation mode by default. To execute real trades, add Polymarket CLOB integration:
```bash
pip install py-clob-client
```
2026-03-10 13:41:05 -05:00
Then replace the paper mode block in `bot_v1.py` with your CLOB buy function. Full guide in the article linked below.
2026-03-03 15:32:53 -06:00
---
## Disclaimer
This is not financial advice. Prediction markets carry real risk. Run the simulation thoroughly before committing real capital.