Install
openclaw skills install yh-polymarket-weather-traderWeather temperature prediction market trading on Polymarket via Simmer SDK. Uses NOAA (US) and Open-Meteo ensemble (international) forecasts as signal, EV/Ke...
openclaw skills install yh-polymarket-weather-traderUse this skill when the user wants to:
weather-trader/
├── weather_trader.py # Main entry point (2732 lines)
├── ev_calculator.py # EV + Kelly Criterion + longtail bias
├── bayesian_update.py # Position probability management
├── maker_taker_arbiter.py # Dynamic Maker/Taker mode switching
├── trade_performance.py # Logging, circuit breaker, health score
├── performance_report.py # Performance reporting CLI
├── smart_money_signal.py # Whale tracking signal
├── config.json # Trading parameters
├── test_ev_calculator.py # Unit tests
├── test_noaa_calibration.py
└── trades.jsonl # Append-only trade log
cd weather-trader
python weather_trader.py # Dry run
python weather_trader.py --live # Real trades (venue from .env)
python weather_trader.py --positions # Show open positions
python weather_trader.py --config # Show current config
python weather_trader.py --set entry_threshold=0.20
python weather_trader.py --live --quiet # Silent for cron
python weather_trader.py --smart-sizing # Portfolio-based sizing
python weather_trader.py --no-safeguards # Disable safeguards (not recommended)
python weather_trader.py --resume # Clear circuit breaker
| Mode | Flag | Effect |
|---|---|---|
| Dry run | (default) | No API calls, just analysis |
| Live | --live | Real API calls to TRADING_VENUE |
| Simmer $SIM | .env: TRADING_VENUE=sim | Virtual trading, $10k starting balance |
| Polymarket USDC | .env: TRADING_VENUE=polymarket | Real USDC |
US cities (NOAA + MADIS, 16 cities): NYC, Chicago, Seattle, Atlanta, Dallas, Miami, Houston, Phoenix, Philadelphia, Boston, Denver, Las Vegas, San Francisco, Los Angeles, San Diego, Washington DC, Nashville
International cities (Open-Meteo ensemble, 20+ cities): Tel Aviv, Munich, London, Tokyo, Seoul, Ankara, Lucknow, Wellington, Taipei, Shanghai, Beijing, Hong Kong, Singapore, Sydney, Melbourne, Paris, Berlin, Madrid, Rome, Amsterdam, Toronto, Vancouver, Shenzhen, Guangzhou, Chengdu, Mumbai, Delhi, Wuhan
Use config.json or --set locations=NYC,London,Tokyo to configure.
Signal = NOAA/Open-Meteo forecast probability vs Polymarket market price
EV = p × (1-price)/price - (1-p) × 1
Trade = take if EV > 0 and price < entry_threshold
Size = Kelly Criterion (Quarter Kelly = kelly_multiplier × full Kelly)
ev_calculator.py — EV + Kelly FrameworkEV = (p × (1-price)/price) - ((1-p) × 1)
Quarter Kelly = full_Kelly × kelly_multiplier
calculate_ev(price, win_prob) → EV per dollarshould_take_trade(price, win_prob, min_ev=0.0) → bool gatekelly_fraction(price, win_prob) → full Kelly (0–1)quarter_kelly_position(price, win_prob, bankroll, max_pos) → USD amountis_longtail_contract(price, cutoff=0.20) → flag for <20¢ contractslongtail_ev_adjustment(price, raw_ev) → applies 20% penalty to longtail EVbayesian_update.py — Position Probability Managementbayesian_update(prior_prob, likelihood_ratio) → posterior probabilitycompute_likelihood_ratio(new_price, old_price) → odds ratioshould_update_probability(position_pnl_pct, threshold=-0.10) → triggers on -10% PnLshould_close_position(updated_prob, initial_prob, threshold=-0.15) → close if prob dropped >15%compute_new_kelly_size(initial_prob, updated_prob, initial_kelly_size) → rescales positionmaker_taker_arbiter.py — Strategy Mode Switching| Condition | Mode | Maker / Taker |
|---|---|---|
| spread < 50bps AND vol < 50% | MAKER_HEAVY | 65% / 35% |
| spread < 50bps XOR vol < 50% | BALANCED | 50% / 50% |
| spread ≥ 50bps AND vol ≥ 50% | TAKER_HEAVY | 30% / 70% |
config.json)| Parameter | Default | Description |
|---|---|---|
entry_threshold | 0.15 | Buy when price below this |
exit_threshold | 0.45 | Sell when price above this |
max_position_usd | 2.00 | Max USD per trade |
sizing_pct | 0.05 | Smart sizing: % of balance per trade |
max_trades_per_run | 5 | Max trades per scan cycle |
locations | NYC | Comma-separated cities |
binary_only | false | Skip range-bucket events |
slippage_max | 0.15 | Skip if slippage exceeds this |
min_liquidity | 0.0 | Skip markets below this liquidity |
use_kelly_sizing | true | Use Kelly Criterion vs fixed % |
kelly_multiplier | 0.25 | Kelly fraction (0.25 = Quarter Kelly) |
ev_min_threshold | 0.0 | Min EV to take trade |
longtail_ev_penalty | 0.20 | EV penalty for <20¢ contracts |
noaa_win_probability | 0.85 | Base NOAA forecast win rate |
circuit_breaker_threshold | 3 | Losses before pause |
circuit_breaker_cooldown | 6 | Hours before auto-resume |
use_smart_money | true | Enable whale signal integration |
smart_money_min_score | 7 | Min whale score (0-10) |
python trade_performance.py --health-score # 0-100 health score
python trade_performance.py --auto-tune # Suggest param adjustments
python trade_performance.py --changelog # View param change history
python trade_performance.py --resume # Force clear circuit breaker
trades.jsonl (JSONL, append-only)TRADING_VENUE=sim (virtual $SIM) or polymarket (real USDC)--live flag required for real API calls~/.hermes/weather-trade-log.jsonl with: city, target_date, forecast_temp, bucket, price, noaa_probability (pre-correction), bias_adjustment, MADIS bias message, and signal data. Over time this builds a per-city forecast bias statistics database.At $0.10/bucket → $0.50 minimum (OK) At $0.20/bucket → $1.00 minimum (OK) At $0.30/bucket → $1.50 minimum (blocks $1 trades) At $0.50/bucket → $2.50 minimum (blocks $1 trades)
For small budgets ($1/position): only buckets ≤ $0.20 are tradeable.
| Issue | Fix |
|---|---|
| "No live tradeable markets" | Markets off-hours or seasonal; check Polymarket directly |
| "CLOB price unavailable" | Polymarket CLOB down; script uses Simmer API fallback |
| "Circuit breaker TRIPPED" | Wait 6h or run --resume |
| "Balance shows $0" | Polymarket uses USDC.e (bridged), not native USDC |
| "Position too small for 5 shares" | Bucket price too high; lower budget or wait for cheaper buckets |
| NOAA SSL timeout | Normal; retry logic falls back to Open-Meteo |
| Discovery 429 rate limit | Expected during scan; trading continues from cached markets |