weather-agent
by @mohamedj2020
Trade Polymarket US temperature markets using NOAA forecasts with dynamic confidence, quality filtering, and smart trade sizing for improved accuracy and ris...
clawhub install weather-traderπ About This Skill
name: weather-enhanced displayName: Weather Trading (Enhanced) description: Trade Polymarket weather markets using NOAA forecasts with dynamic confidence modeling and quality filtering. Use when user wants to trade temperature markets with advanced safeguards. metadata: {"clawdbot":{"emoji":"π‘οΈ","requires":{"env":["SIMMER_API_KEY"]},"cron":"0 */6 * * *","autostart":false}} authors: - Enhanced by Claude attribution: "Based on Simmer weather skill, enhanced with dynamic confidence and quality scoring" version: "2.0.0"
Weather Trading (Enhanced)
CRITICAL: Autonomous Trading Skill
This skill places REAL TRADES with REAL MONEY when enabled.
Key information:
autostart:false - Will NOT run automaticallyInstallation & Security
Credentials
Required:
SIMMER_API_KEY - Trading API key from simmer.markets/dashboardOptional (non-secret configuration):
SIMMER_WEATHER_* environment variables for trading parameters (see Configuration)No other credentials needed (no wallet keys, RPC endpoints, or cloud credentials).
Optional dependency: If you install tradejournal, it will log trade details. Not installed by default. Inspect source code before installing.
Installation Method
~/.openclaw/skills/weather-enhanced/.env file with API keyDependencies
python-dotenv>=1.0.0 # Optional
Clean dependency list:
urllib (no requests library)tradejournal for trade logging (commented out in requirements.txt)Network Endpoints
This skill connects to 3 endpoints:
1. api.weather.gov (NOAA)
- Purpose: Fetch temperature forecasts
- Data sent: Latitude/longitude (public coordinates)
- Data received: Weather forecasts (public data)
- Authentication: None
- Code location: weather_trader_enhanced.py line ~250-280
2. nominatim.openstreetmap.org (Geocoding)
- Purpose: Convert city names to coordinates
- Data sent: City name string (e.g., "Chicago")
- Data received: Lat/lon coordinates
- Authentication: None
- Code location: weather_trader_enhanced.py line ~200-230
3. api.simmer.markets (Trading)
- Purpose: Execute trades, read portfolio
- Data sent: SIMMER_API_KEY (bearer token), trade orders
- Data received: Trade confirmations, positions, balance
- Authentication: Bearer token
- Code location: weather_trader_enhanced.py line ~300-350
Note: If you install the optional tradejournal dependency, it may add endpoints.
Security Guarantees
API Key Permissions
Your SIMMER_API_KEY should have:
Create least-privilege key:
1. Visit simmer.markets/dashboard β SDK tab
2. Create new API key
3. Select "Trading Only" if available
4. Never grant withdrawal rights
5. Store in .env file (git-ignored)
6. Rotate key after testing
Configuration Storage
.env file: Contains SIMMER_API_KEY (never committed)config.json: Trading parameters only (no secrets)Note: Legacy variables WALLET_PRIVATE_KEY and POLYGON_RPC_URL in .env are unused (web3 removed).
Safety Features
Before Enabling
DO NOT SKIP THESE STEPS
1. Review Source Code
# Inspect main trading logic
cat weather_trader_enhanced.py | lessVerify network endpoints (should only find 3)
grep -n "urlopen\|Request\|http" weather_trader_enhanced.pyCheck API key usage (should only send to simmer.markets)
grep -n "api_key\|SIMMER_API_KEY" weather_trader_enhanced.pyCheck optional tradejournal usage
grep -n "tradejournal\|log_trade" weather_trader_enhanced.py
2. Understand Platform Behavior
OpenClaw metadata controls:
autostart:false = Skill will NOT run on startup (safe default)cron:"0 */6 * * *" = Schedule (executes only when autostart enabled)autostart:false to autostart:trueWhen enabled: Runs every 6 hours (12am, 6am, 12pm, 6pm) When disabled: 100% inactive
3. Verify API Key Permissions
Check your Simmer API key:
If your key has withdrawal permissions, create a new trading-only key.
4. Test Live Trading
# Check balance first
python scripts/status.pyExecute live trades (start with small balance)
python weather_trader_enhanced.py --live --smart-sizing
5. Enable Autonomous Trading (Optional)
Only after successful manual testing.
OpenClaw uses metadata-based activation:
autostart field in SKILL.mdSteps:
1. Edit SKILL.md line 5 (the metadata line)
2. Change "autostart":false to "autostart":true
3. Save file
4. Restart: openclaw restart
5. Check logs to verify scheduled runs
Manual runs only (alternative):
python weather_trader_enhanced.py --live --smart-sizing
This gives full control over trade timing.Quick Start
# Check balance
python scripts/status.pyExecute live trades
python weather_trader_enhanced.py --live --smart-sizingOptional: Dry run for testing
python weather_trader_enhanced.py --dry-run
Requirements
SIMMER_API_KEY from simmer.markets/dashboard β SDK tabConfiguration
Configure via environment variables or config.json:
| Variable | Default | Description |
|----------|---------|-------------|
| SIMMER_WEATHER_ENTRY | 0.15 | Buy below this price |
| SIMMER_WEATHER_EXIT | 0.45 | Sell above this price |
| SIMMER_WEATHER_MAX_POSITION | 5.00 | Max USD per trade |
| SIMMER_WEATHER_MAX_TRADES | 5 | Max trades per run |
| SIMMER_WEATHER_LOCATIONS | "ALL" | Cities to target |
| SIMMER_WEATHER_MIN_QUALITY | 0.6 | Min market quality |
Features
Commands
# Live trading
python weather_trader_enhanced.py --live --smart-sizingCheck positions
python weather_trader_enhanced.py --positionsView config
python weather_trader_enhanced.py --configSet config
python weather_trader_enhanced.py --set entry_threshold=0.20Optional: Dry run for testing
python weather_trader_enhanced.py --dry-run
How It Works
1. Fetches NOAA forecasts for target locations 2. Discovers weather markets via Simmer API 3. Calculates edge using dynamic confidence model (adjusts 60-90% based on forecast timing) 4. Filters markets by quality score (liquidity, volume, time) 5. Executes trades when price < entry threshold 6. Auto-exits when price > exit threshold
Dynamic confidence adjusts based on lead time:
Market quality scoring weights:
Only trades markets with score β₯ 60%.
Troubleshooting
"SIMMER_API_KEY not set" Set env var or add to .env file
"No weather markets found" Normal if no active markets on Polymarket
"Position size too small"
Increase max_position_usd or use --smart-sizing
"Quality score too low" Market filtered for low liquidity/volume
Security Checklist
Before installing, verify:
Code Review
weather_trader_enhanced.py sourceDependencies
requirements.txt has only python-dotenv>=1.0.0urllib for HTTPtradejournal, inspected source firstConfiguration
autostart:false in SKILL.md line 5API Key Setup
.env file (local, never committed)Testing
python scripts/status.py successfully--live--dry-run firstRisk Understanding
Platform Behavior
autostart:falseIf any checkbox is unchecked, DO NOT enable this skill.
Emergency Stop
To stop immediately:
# Option 1: Disable in OpenClaw UIOption 2: Edit SKILL.md
Change line 5: "autostart":false
Then: openclaw restart
Option 3: Stop OpenClaw entirely
openclaw stopClose positions manually on simmer.markets/dashboard
Support
Source code is visible in weather_trader_enhanced.py
All network calls documented in this file
No hidden functionality or obfuscation
Use at your own risk. This skill places real trades with real money. Understand prediction markets and trading risks before use.
π‘ Examples
# Check balance
python scripts/status.pyExecute live trades
python weather_trader_enhanced.py --live --smart-sizingOptional: Dry run for testing
python weather_trader_enhanced.py --dry-run
βοΈ Configuration
Configure via environment variables or config.json:
| Variable | Default | Description |
|----------|---------|-------------|
| SIMMER_WEATHER_ENTRY | 0.15 | Buy below this price |
| SIMMER_WEATHER_EXIT | 0.45 | Sell above this price |
| SIMMER_WEATHER_MAX_POSITION | 5.00 | Max USD per trade |
| SIMMER_WEATHER_MAX_TRADES | 5 | Max trades per run |
| SIMMER_WEATHER_LOCATIONS | "ALL" | Cities to target |
| SIMMER_WEATHER_MIN_QUALITY | 0.6 | Min market quality |
π Tips & Best Practices
"SIMMER_API_KEY not set" Set env var or add to .env file
"No weather markets found" Normal if no active markets on Polymarket
"Position size too small"
Increase max_position_usd or use --smart-sizing
"Quality score too low" Market filtered for low liquidity/volume