2026-02-27 02:01:35 +08:00
# 🌡️ PolyWeather: Intelligent Weather Quant Analysis Bot
2026-02-05 19:52:02 +08:00
2026-02-27 02:01:35 +08:00
PolyWeather is a weather analysis tool specifically designed for prediction markets like **Polymarket** . It aggregates multi-source forecasts, real-time airport METAR observations, and incorporates AI-driven decision support to help users evaluate weather-related risks more scientifically.
2026-02-07 01:21:55 +08:00
2026-02-27 01:58:29 +08:00
---
2026-02-27 02:01:35 +08:00
## ✨ Core Features
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
### 1. 🧬 Dynamic Ensemble Blending (DEB Algorithm)
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
The system automatically tracks the historical performance of various weather models (ECMWF, GFS, ICON, GEM, JMA) in specific cities:
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
- **Error-Based Weighting**: Dynamically adjusts weights for each model based on their Mean Absolute Error (MAE) over the past 7 days.
- **Blended Forecast**: Provides a "Blended High Temperature" recommendation corrected for historical biases.
- **Concurrency Optimization**: Built-in singleton cache and file locking mechanism to support high-concurrency queries and ensure data safety.
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
### 2. 🤖 AI Intelligent Analysis (Groq LLaMA 3.3)
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
Integrates the LLaMA 70B model to interpret rapidly changing meteorological data:
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
- **Logical Deduction**: Considers dynamic factors such as wind speed, wind direction, cloud cover, and solar radiation to judge temperature trends.
- **Confidence Scoring**: Provides a confidence score from 1-10 for the current market conditions.
- **Automatic Cooldown Determination**: When temperature drop is observed or the forecast peak has passed, the AI provides a definitive market conclusion.
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
### 3. ⏱️ Real-time Airport Observations (Zero-Cache METAR)
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
- **Live Passthrough**: Bypasses CDN caching via dynamic headers to obtain first-hand METAR reports from airports.
- **Settlement Warning**: Automatically calculates the Wunderground settlement boundary (X.5 rounding line) to warn of potential volatility.
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
### 4. 📈 Historical Data Collection
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
- Includes `fetch_history.py` to retrieve up to 3 years of hourly historical weather data for any city, supporting future algorithm development.
2026-02-27 01:58:29 +08:00
---
2026-02-07 01:21:55 +08:00
2026-02-27 02:01:35 +08:00
## ⚡ Deployment
2026-02-18 09:49:40 +08:00
2026-02-27 02:01:35 +08:00
### Requirements
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
- **Python 3.11+**
- Install dependencies: `pip install -r requirements.txt`
- **Environment Variables**: Set `TELEGRAM_BOT_TOKEN` and `GROQ_API_KEY` in your `.env` file.
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
### VPS Quick Deployment
2026-02-07 01:21:55 +08:00
2026-02-27 02:01:35 +08:00
1. Clone the repository and install dependencies.
2. Configure your `.env` file.
3. Use the following script for one-click updates and restarts:
2026-02-18 09:49:40 +08:00
```bash
cat > ~/update.sh << 'EOF'
#!/bin/bash
cd ~/PolyWeather
git fetch origin
git reset --hard origin/main
pkill -f bot_listener.py
sleep 1
2026-02-27 01:58:29 +08:00
nohup python3 bot_listener.py > bot.log 2>&1 &
2026-02-27 02:01:35 +08:00
echo "✅ PolyWeather Restarted!"
2026-02-18 09:49:40 +08:00
EOF
chmod +x ~/update.sh
2026-02-07 01:21:55 +08:00
```
2026-02-05 19:52:02 +08:00
---
2026-02-27 02:01:35 +08:00
## 🕹️ Bot Commands
2026-02-06 20:16:45 +08:00
2026-02-27 02:01:35 +08:00
| Command | Description |
| :------------------ | :-------------------------------------------------------------------- |
| `/city [city_name]` | Get in-depth weather analysis, live tracking, and AI-driven insights. |
| `/id` | View the Chat ID of the current conversation. |
| `/help` | Display help information. |
2026-02-22 10:01:32 +08:00
2026-02-27 02:01:35 +08:00
### Supported City Examples
2026-02-22 10:01:32 +08:00
2026-02-27 02:01:35 +08:00
`lon` (London), `par` (Paris), `ank` (Ankara), `nyc` (New York), `chi` (Chicago), `ba` (Buenos Aires), etc.
2026-02-23 21:23:52 +08:00
2026-02-27 01:58:29 +08:00
---
2026-02-05 19:52:02 +08:00
2026-02-27 02:01:35 +08:00
## 🏗️ Architecture
2026-02-08 02:55:09 +08:00
2026-02-27 02:04:00 +08:00
```mermaid
graph TD
User[User / Signal Receiver] -->|Query Command| Bot[bot_listener.py Core Scheduler]
subgraph Data Acquisition
Bot --> Collector[WeatherDataCollector]
Collector --> OM[Open-Meteo Live/Forecast]
Collector --> MM[Multi-Model Predictors ECMWF/GFS etc.]
Collector --> METAR[Live Airport Observations]
end
subgraph Logic Processing
Collector --> DEB[DEB Dynamic Weighting]
DEB --> DB[(daily_records JSON Database)]
Collector --> Logic[Settlement Analysis / Trend Detection]
end
subgraph AI Decision Layer
DEB --> AIAnalyzer[Groq/LLaMA 3.3 AI Model]
Logic --> AIAnalyzer
METAR --> AIAnalyzer
end
AIAnalyzer -->|Generates: Spread+Logic+Confidence| Bot
Bot -->|Returns Analysis Snapshot| User
```
2026-02-05 19:52:02 +08:00
2026-02-27 02:01:35 +08:00
---
2026-02-27 01:58:29 +08:00
2026-02-27 02:01:35 +08:00
## 💡 Trading Tips
2026-02-06 20:16:45 +08:00
2026-02-27 02:01:35 +08:00
1. **Reference DEB Blended Value** : When models diverge, the DEB corrected value is usually more reliable than a single forecast.
2. **Observe AI Confidence** : A confidence score below 5 indicates high uncertainty in the current meteorological environment.
3. **Watch Settlement Boundaries** : When the observed high is near X.5, be wary of rounding jumps during Wunderground settlements.
2026-02-18 09:49:40 +08:00
---
2026-02-27 02:01:35 +08:00
_Updated 2026_