4.8 KiB
🌡️ PolyWeather: Real-time Weather Query & Analysis Bot
An intelligent weather information bot designed to provide ultra-fast, live meteorological data, high-fidelity forecasts, and smart trend analysis. Built for speed and accuracy, it bypasses network caching to deliver the most up-to-date reports from global weather stations.
🚀 Quick Start
Requirements
- Python 3.11+
- Dependencies:
pip install -r requirements.txt
Running Locally (Windows/Linux)
# Windows
py -3.11 run.py
# Linux/VPS
python3 run.py
Note: The system is currently in Weather Query Mode. Legacy active market monitoring and automated trading modules are suspended.
🤖 Telegram Bot Commands
| Command | Description | Usage |
|---|---|---|
/city [name] |
Query City Weather | Get detailed forecasts, METAR & trend analysis |
/id |
Get Chat ID | Retrieve your current Telegram Chat ID |
/help |
Help | Display all available commands |
✨ Key Features
1. 🏛️ Multi-Source Data Fusion (High-Fidelity)
The bot aggregates data from multiple authoritative sources, layered by reliability:
| Source | Role | Coverage | Strength |
|---|---|---|---|
| Open-Meteo | Base Forecast | Global | Provides detailed 72-hour temperature curves for all cities. |
| Meteoblue (MB) | Precision Consensus | London Only | Traders' choice. Aggregates multiple models; excellent for microclimates. |
| METAR | Settlement Standard | Global Airports | The absolute truth for Polymarket settlement; real-time station data. |
| NWS | Official (US) | US Only | High-fidelity forecasts for US cities, critical for extreme weather events. |
| MGM | Official (Turkey) | Ankara | Direct access to Turkish State Meteorological Service for local official accuracy. |
2. ⚡ Ultra-Fresh Data (Cache-Busting)
To counter second-by-second variations in weather betting, we implemented Zero-Cache Technology:
- Micro-timestamp Tokens: Every request includes a dynamic token to force servers to bypass CDN caches.
- MGM Real-time Sync: Specialized header camouflaging to bypass local Turkish API anti-crawling for Ankara.
3. ⏱️ Automated Trend Analysis
The bot doesn't just fetch data; it interprets it:
- Peak Window Prediction: Automatically identifies the timeframe when today's record is most likely to be hit.
- Risk Profiling: Assigns risk levels based on geographic traits (e.g., Ankara high-altitude swings, London coastal microclimates).
- Source Attribution: Every data point is clearly labeled ([MGM], [METAR], [MB]) to help you weigh the data.
4. 📊 Smart Max-Temp Tracking
Optimized for Polymarket settlement logic:
- Local Day Filtering: Uses city UTC offsets to strictly count observations after 00:00 local time.
- Multi-dimension Monitoring: Includes "Feels Like" temperatures and 24h precipitation to assist in nuanced trade decisions.
🏗️ System Architecture
PolyWeather uses a Lightweight, Plugin-based architecture for millisecond responses.
graph TD
User[/Telegram User/] --> Bot[bot_listener.py]
Bot --> Collector[WeatherDataCollector]
subgraph "Data Engine"
Collector --> OM[Open-Meteo API]
Collector --> MB[Meteoblue Scraper]
Collector --> NOAA[METAR Data Center]
Collector --> MGM[Turkish MGM API]
Collector --> NWS[US NWS API]
end
Collector --> Processing[Smart Analysis & Formatting]
Processing --> Bot
Bot --> Reponse[/Compact Betting Snapshot/]
- Logic Decoupling:
weather_sources.pyhandles parsing;bot_listener.pyhandles rendering. - Legacy Modules:
main.pycontains the old automated trading engine. Focus has shifted to "assisted manual decision-making."
🎯 Betting Strategy Tips
- Check Consensus: Compare Open-Meteo and Meteoblue (MB). Consensus usually implies higher probability.
- Watch the Peak: Use
/cityfrequently during predicted peak windows to catch momentum. - Weighting Hierarchy: Settlement is METAR; high-accuracy trend is MB (London); Official (NWS/MGM) is the "anchor."
- Geographic Risk: Pay close attention to cities where "Bias will significantly amplify."