Skip to content

Latest commit

 

History

History
65 lines (54 loc) · 3.28 KB

File metadata and controls

65 lines (54 loc) · 3.28 KB

Changelog

2026-03-12 — US Markets, NWS API, Early Exits

New Features

1. Slug-based market lookup (scanner.py)

  • Added fetch_markets_by_slug(city, date) — constructs Polymarket event slug like highest-temperature-in-chicago-on-march-13-2026 and fetches directly
  • Replaces the old tag-based search that returned 35K+ markets
  • Covers 28 cities with slug mappings in SLUG_CITIES dict
  • Falls back to tag search if slug lookup returns nothing
  • Result: 216 markets found in seconds vs paginating through thousands

2. NWS API as third forecast source (scanner.py)

  • Added fetch_nws_observations() and fetch_nws_forecast() for US stations
  • NWS hourly gridpoint forecasts provide the PRIMARY data that Wunderground resolves from
  • 6 US stations configured with NWS grid coordinates:
    • KLGA (NYC), KORD (Chicago), KMIA (Miami), KDAL (Dallas), KSEA (Seattle), KATL (Atlanta)
  • NWS forecast max temp added as 3x-weighted ensemble member (authority weighting)
  • User-Agent: weatherbot/1.0 as required by NWS API

3. US Fahrenheit market support (scanner.py, paper_trade.py)

  • Parser now handles both °C and °F formats:
    • "48°F or higher" → gte bucket
    • "40°F or below" → lte bucket
    • "between 44-45°F" → range bucket (new type)
  • Ensemble forecasts (always °C) are converted to °F for probability calculation
  • Station alias resolver maps Wunderground city names to ICAO codes:
    • "atlanta" → KATL, "chicago" → KORD, "miami" → KMIA, etc.
  • Unit tracked per market group (°C or °F) through entire pipeline

4. Early exit strategy (paper_trade.py)

  • New check_early_exits() function — checks active positions against current market prices
  • If market price reaches 45¢+ (configurable EARLY_EXIT_PRICE), marks position for sell
  • Calculates exit P&L based on shares bought vs current price
  • Early exits tracked separately in stats (EARLY_EXIT outcome)
  • Run with: python3 paper_trade.py exits

5. US station calibration (calibrate.py)

  • Added 6 US stations to calibration system
  • Calibration results (30-day, 2026-03-12):
Station Bias MAE Bucket% ±1°C% Status
KMIA (Miami) -0.02°C 0.60°C 53% 90% ✅ Best US station
KSEA (Seattle) -0.40°C 0.77°C 43% 90%
KATL (Atlanta) +0.38°C 0.90°C 33% 80%
KORD (Chicago) +1.08°C 1.18°C 20% 77% ✅ warm bias
KDAL (Dallas) +1.05°C 1.19°C 20% 73% ✅ warm bias
KLGA (NYC) +1.77°C 2.05°C 7% 43% ⛔ DO NOT TRADE
  • paper_trade.py STATION_CONFIG updated with calibrated bias adjustments and kelly multipliers
  • KLGA marked non-tradeable due to high MAE

Files Modified

  • scripts/scanner.py — slug lookup, NWS API, °F parsing, station aliases
  • scripts/paper_trade.py — early exits, US stations, °F support, range buckets
  • scripts/calibrate.py — added 6 US stations
  • scripts/metar.py — added 6 US stations with timezone offsets

Scanner Output (first run)

  • 214 temperature bucket markets parsed via slug lookup
  • 24 city-date groups across US, Europe, and Asia-Pacific
  • 80+ opportunities identified (24 BUY, 52 SELL signals)
  • US markets producing edges: Atlanta 64-65°F (+25%), Chicago 42-43°F (+22%), Dallas 74-75°F (+12%)