From 938a98ee2c2efa83bdabe943ffc144b334131d6a Mon Sep 17 00:00:00 2001
From: "2569718930@qq.com" <2569718930@qq.com>
Date: Fri, 27 Feb 2026 02:01:35 +0800
Subject: [PATCH] docs: use a more professional and neutral tone for README
files
---
README.md | 154 ++++++++++++++++-----------------------------------
README_ZH.md | 154 ++++++++++++++++-----------------------------------
2 files changed, 96 insertions(+), 212 deletions(-)
diff --git a/README.md b/README.md
index a3427354..d0834c7b 100644
--- a/README.md
+++ b/README.md
@@ -1,64 +1,51 @@
-# 🌡️ PolyWeather: Quantitative Weather Trading & AI Command Center
+# 🌡️ PolyWeather: Intelligent Weather Quant Analysis Bot
-![Banner Placeholder: Futuristic Weather Trading System]
-
-PolyWeather is not just a simple weather bot. It is an **institutional-grade weather quantitative trading assistant** designed for prediction markets like **Polymarket** and other weather derivatives. By connecting directly to global aviation weather stations (METAR) without CDN caching, integrating our Dynamic Ensemble Blending (DEB) model, extracting real-time micro-climate features, and stripping away human emotion via the massive LLaMA 70B AI model, it provides you with rapid, objective, and lethal trading signals.
+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.
---
-## 🚀 Core Features Matrix
+## ✨ Core Features
-### 1. 🧠 Proprietary Moat: Dynamic Ensemble Blending (DEB)
+### 1. 🧬 Dynamic Ensemble Blending (DEB Algorithm)
-Traditional weather bots simply calculate rigid averages out of numerical models like ECMWF and GFS. PolyWeather introduces a **dynamic tracking and backtesting algorithm**:
+The system automatically tracks the historical performance of various weather models (ECMWF, GFS, ICON, GEM, JMA) in specific cities:
-- **Adaptive Weight Evolution**: By looking back at the Mean Absolute Error (MAE) of each model over the past 7-14 days at specific airports (e.g., Esenboğa Airport in Ankara), the system actively penalizes and rewards the 5 major NWP models (ECMWF, GFS, ICON, GEM, JMA) per query.
-- **High-Concurrency Thread-Safe Database**: Built on an underlying memory singleton cache and system-level file locks (`fcntl Lock`), PolyWeather guarantees 0 disk I/O bottlenecks and microsecond response times—even when bombarded by 500+ users checking the weather at the exact same millisecond.
+- **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.
-### 2. 🤖 AI Trading Veteran (Groq AI Agent)
+### 2. 🤖 AI Intelligent Analysis (Groq LLaMA 3.3)
-The system no longer outputs boring templates. We feed all **complex thermodynamic parameters** (wind direction/speed matrix, cooling inertia, rounding resistance) into LLaMA 3.3 70B via the lightning-fast Groq API:
+Integrates the LLaMA 70B model to interpret rapidly changing meteorological data:
-- **🧊 Forced Objectivity**: With strict logical constraints built into the prompt, the AI accurately evaluates scenarios like "15kt cold northerly winds at 3 PM, coupled with radiation dropping below 50W/m²" and immediately calls "Dead market: peak passed, bets frozen."
-- **🎯 Quantitative Confidence Scoring**: It outputs a 1-10 confidence score with strong guidance. High confidence means an "immediate signal to build positions," whereas low confidence warns of a chaotic market full of wind/rain uncertainties.
+- **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.
-### 3. ⏱️ Absolute Live Dominance (Zero-Cache METAR Extraction)
+### 3. ⏱️ Real-time Airport Observations (Zero-Cache METAR)
-In the meat grinder of Polymarket weather settlements, **a 1-minute delay can mean a 100% loss of your principal**.
+- **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.
-- PolyWeather forces anti-cache dynamic timestamps on every single API call, bypassing all proxy network (CDN) stagnant cache pools.
-- It doesn't just extract "how many degrees it is now." It analyzes the exact decimal point for Settlement Risk (including the deadly X.5 Wunderground roundup boundaries).
+### 4. 📈 Historical Data Collection
-### 4. 📈 High-Frequency Data Mining Foundation
-
-Built-in `fetch_history.py` native spider system.
-
-- One click to pull down hundreds of thousands of rows of hourly historical physics sandbox feature matrices (over 10 dimensions including humidity, shortwave radiation, surface pressure) for any global benchmark city across the past 3-5 years.
-- Infinite ammunition ready for our next-generation XGBoost / LightGBM Machine Learning Model Output Statistics (MOS) calibration.
+- Includes `fetch_history.py` to retrieve up to 3 years of hourly historical weather data for any city, supporting future algorithm development.
---
-## ⚡ Deployment & Operations
+## ⚡ Deployment
-### Environment Architecture
+### Requirements
-- **Core Engine**: Python 3.11+ (Strict Compliance)
-- **Dependency Stack**: `pip install -r requirements.txt`
-- **Volume Mounts**: Minimal configuration. Just register your `TELEGRAM_BOT_TOKEN` and `GROQ_API_KEY` inside `.env` to summon the AI.
+- **Python 3.11+**
+- Install dependencies: `pip install -r requirements.txt`
+- **Environment Variables**: Set `TELEGRAM_BOT_TOKEN` and `GROQ_API_KEY` in your `.env` file.
-### Recommended 1-Click VPS Production Launch
+### VPS Quick Deployment
-**Step 1: Build & Register**
-
-```bash
-git clone https://github.com/yangyuan-zhen/PolyWeather.git
-cd PolyWeather
-pip install -r requirements.txt
-cp .env.example .env # Be sure to insert your secure API keys
-```
-
-**Step 2: Daemon Updater Assembly**
-Set up an automated keep-alive script to integrate updates, conflict-resolution, and hot-swaps all in one push:
+1. Clone the repository and install dependencies.
+2. Configure your `.env` file.
+3. Use the following script for one-click updates and restarts:
```bash
cat > ~/update.sh << 'EOF'
@@ -66,89 +53,44 @@ cat > ~/update.sh << 'EOF'
cd ~/PolyWeather
git fetch origin
git reset --hard origin/main
-pkill -f run.py
pkill -f bot_listener.py
sleep 1
nohup python3 bot_listener.py > bot.log 2>&1 &
-echo "✅ PolyWeather Quant Terminal up and loaded with the latest modules!"
+echo "✅ PolyWeather Restarted!"
EOF
chmod +x ~/update.sh
```
-**Daily Operations Command (Push & Play):**
+---
-```bash
-~/update.sh
-```
+## 🕹️ Bot Commands
-> One command to wipe Git conflicts, execute warm/cold reboots, and clean logs.
+| 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. |
+
+### Supported City Examples
+
+`lon` (London), `par` (Paris), `ank` (Ankara), `nyc` (New York), `chi` (Chicago), `ba` (Buenos Aires), etc.
---
-## 🕹️ Telegram Command Center
+## 🏗️ Architecture
-| Tactical Command | Trigger Action | Module Feedback |
-| :------------------ | :------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `/city [City Code]` | **Reconnaissance** | Initiates full-dimension weather sweep. Returns DEB-weighted forecast, METAR tracking, rounding risk warnings, and AI quantitative trading conclusion. |
-| `/id` | **Identity Ping** | Maps the current comm channel (Chat ID). |
-| `/help` | **Terminal Manual** | Pulls the latest command set. |
-
-### Target Arenas
-
-From low-risk setups in the Middle East/Africa to high-latency slippage arenas in North America, PolyWeather embeds precise airport deviation models (Risk Profiles):
-`lon`(London EGLC), `par`(Paris LFPG), `ank`(Ankara LTAC), `nyc`(New York KLGA), `chi`(Chicago KORD), `ba`(Buenos Aires SAEZ)... and more.
-
-> **Fire Examples:**
-> `/city Paris`
-> `/city london`
-> `/city ba`
+- **Data Layer**: Interfaces with Open-Meteo, NOAA, MGM, and other data sources.
+- **Algorithm Layer**: DEB dynamic weighting system + concurrency caching mechanism.
+- **Decision Layer**: Real-time trading logic analysis based on Groq API.
---
-## 🏗️ System Architecture Anatomy
+## 💡 Trading Tips
-```mermaid
-graph TD
- classDef ai fill:#f9f,stroke:#333,stroke-width:2px;
- classDef core fill:#bbf,stroke:#333,stroke-width:2px;
- classDef data fill:#dfd,stroke:#333,stroke-width:1px;
-
- User[Telegram / Signal Receiver] -->|Trigger Scan| Bot[bot_listener.py Core Scheduler]:::core
-
- subgraph Heterogeneous Data Parsing
- Bot --> Collector[WeatherDataCollector]
- Collector --> OM[Open-Meteo Archive/Live]:::data
- Collector --> MM[Multi-Model Predictors]:::data
- Collector --> METAR[Air Traffic Control Raw Logs]:::data
- end
-
- subgraph Computation & Circuit Breakers
- Collector --> DEB[DEB Dynamic Weighting]:::core
- DEB --> DB[(daily_records JSON DB
Thread-Safe)]
- Collector --> Logic[Rounding Analysis / Cooldown]
- end
-
- subgraph AI Metric Generation
- DEB --> AIAnalyzer[Groq/LLaMA Cognitive Model]:::ai
- Logic --> AIAnalyzer
- METAR --> AIAnalyzer
- end
-
- AIAnalyzer -->|Generates: Spread+Logic+Confidence| Bot
- Bot -->|Assembles High-Dimensional Slice| User
-```
+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.
---
-## 🎯 Trader's Playbook
-
-As a Commander of PolyWeather, etch these rules into your DNA:
-
-1. 🧬 **Trust the DEB Baseline**: Instead of blindly believing an extreme forecast from ECMWF or GFS, stare at the `DEB Blended Forecast` on line one. It is the system's re-calibrated truth, forged after absorbing the punishing MAE beating those models took over the past 7 days.
-2. 🎯 **Respect the AI Confidence Red Line**: If the AI returns a `Confidence: ≤ 4/10`, it means the model's delay is clashing heavily with real-time airport headwinds. **Chop your gambling hands off immediately.** You are in a high-risk chaotic zone.
-3. ⚖️ **Fear the X.5 Rounding Abyss**: Polymarket weather settles on integer values (rounded via Wunderground logic). When the terminal blinks `⚖️ Settlement Boundary... crossed the rounding line`, this is where liquidity dries up and slippage becomes most predatory.
-4. 🌙 **Identify False Positives (Warm Advection radar)**: If the temperature ignores the sun and spikes during a low-radiation night, the system triggers a `🌙 Warm Advection Anomaly`. This mechanism frequently hands you the golden "LONG" signal (shattering the original forecast's ceiling) exactly when the rest of the market is betting NO.
-
----
-
-_The weather changes. Our edge remains. | Updated 2026_
+_Updated 2026_
diff --git a/README_ZH.md b/README_ZH.md
index 1455d275..71b6bdce 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -1,64 +1,51 @@
-# 🌡️ PolyWeather: 量化天气交易与 AI 控制中枢
+# 🌡️ PolyWeather: 智能天气量化分析机器人
-![Banner Placeholder: Futuristic Weather Trading System]
-
-PolyWeather 不仅仅是一个天气查询工具,它是专为 **Polymarket/天气衍生品** 等预测市场打造的**机构级气象量化交易辅助系统**。它通过直连全球航空级别气象站 (METAR),结合多模型动态权重融合 (DEB)、实时微气候特征工程,并由庞大的 LLaMA 70B AI 大模型剥离人工情绪,为您提供极速、客观、致命的交易信号。
+PolyWeather 是一款专为 **Polymarket** 等预测市场打造的天气分析工具。它通过聚合多源气象预报、实时机场 METAR 观测,并引入 AI 决策支持,帮助用户更科学地评估天气博弈风险。
---
-## 🚀 核心战力矩阵 (Core Features)
+## ✨ 核心功能
-### 1. 🧠 独家护城河:动态权重集合算法 (DEB - Dynamic Ensemble Blending)
+### 1. � 动态权重集合预报 (DEB 算法)
-传统气象机器人只会机械地计算欧洲 ECMWF 和美国 GFS 的死板平均值。PolyWeather 引入了**动态记账与回溯算法**:
+系统会自动追踪各个气象模型(ECMWF, GFS, ICON, GEM, JMA)在特定城市的历史表现:
-- **自适应权重进化**:基于过去 7-14 天内各个模型在特定机场(如 Ankara 的 Esenboğa 机场)的Mean Absolute Error (平均绝对误差 MAE) 表现,系统在每次查询时会自动对 5 大预测模型(ECMWF, GFS, ICON, GEM, JMA)进行误差惩罚。
-- **高频并发安全锁 (Thread-Safe Database)**:搭载底层内存态单例缓存机制与系统级文件并发锁 (fcntl Lock),即使在 500 人以上的超级大群遭遇瞬间峰值查询,系统依然能保证 0 I/O 拥堵和微秒级响应。
+- **误差加权**:根据过去 7 天的平均绝对误差(MAE),动态调整各模型的权重。
+- **融合预报**:给出经过历史偏差修正后的“融合最高温”建议值。
+- **并发优化**:内置单例缓存与文件锁,支持高并发查询,确保数据读写安全。
-### 2. 🤖 人工智能交易老手 (Groq AI Agent)
+### 2. 🤖 AI 智能分析 (Groq LLaMA 3.3)
-系统不再输出枯燥的数字或废话模版。我们将**所有复杂的动力学参数**(风向、风速矩阵、降温惯性、进位阻力) 投喂给 LLaMA 3.3 70B (通过极速 Groq 接口):
+集成 LLaMA 70B 大模型,对瞬息万变的气象数据进行解读:
-- **🧊 强制冷静,剥离情绪**:独创强迫逻辑约束提示词,AI 会精准判断诸如“下午3点吹 15kt 偏北冷风,且辐射跌破 50W/m²”的情况,并直接宣布“已过最热时点核心区,盘口冻结”。
-- **🎯 量化置信度 (Confidence Scoring)**:直接给出带有强指导意义的 1-10 满分制置信度。置信度极高意味着“立刻建仓”,置信度极低则警告系统遇到了风向或降雨的不确定性博弈。
+- **逻辑推演**:综合考虑风速、风向、云量、太阳辐射等动力因子,判断温度走势。
+- **置信度评分**:针对当前盘口给出 1-10 分的置信度参考。
+- **自动冷却判定**:当观测到气温明显回落或已过预报峰值时,AI 会给出明确的死盘结论。
-### 3. ⏱️ 绝对实况统治力 (Zero-Cache METAR Extraction)
+### 3. ⏱️ 实时机场观测 (Zero-Cache METAR)
-在 Polymarket 结算的绞肉机里,**1 分钟的延迟可能意味着 100% 的本金亏损**。
+- **实时穿透**:通过动态请求头绕过 CDN 缓存,获取机场第一手 METAR 报文。
+- **结算预警**:自动计算 Wunderground 结算边界(X.5 进位线),提醒潜在波动。
-- PolyWeather 设计为每次调用均动态附加一次性戳环,强制穿透所有代理网络(CDN)的静态缓存池。
-- 提取出的不仅是“当下几度”,而是精确到小数点的结算分析(包括 Wunderground X.5 四舍五入进制边界的死亡预警)。
+### 4. 📈 历史数据采集
-### 4. 📈 历史大数据挖掘基建 (Data Mining Foundation)
-
-内置 `fetch_history.py` 原生爬虫系统。
-
-- 一键下拉全球任意城市基准点过去 3-5 年的小时级历史物理沙盒数据特征矩阵(包含湿度、长短波辐射、地表气压等 10 余个维度),最高达数十万行量级。
-- 随时为下一代 XGBoost / LightGBM 的机器学习偏差校正(MOS)提供无限火力弹药。
+- 提供 `fetch_history.py` 脚本,可一键获取各城市过去 3 年的小时级历史气象数据,为后续算法开发提供支持。
---
-## ⚡ 部署指南 (Deployment & Operations)
+## ⚡ 部署说明
-### 环境架构要求
+### 环境要求
-- **内核驱动**: Python 3.11+ (严格遵守)
-- **依赖栈**: `pip install -r requirements.txt`
-- **系统挂载**: 极简配置,仅需 `.env` 文件注册您的 `TELEGRAM_BOT_TOKEN` 及 `GROQ_API_KEY` 即可召唤 AI。
+- **Python 3.11+**
+- 依赖安装: `pip install -r requirements.txt`
+- **环境变量**: 在 `.env` 中设置 `TELEGRAM_BOT_TOKEN` 和 `GROQ_API_KEY`。
-### VPS 推荐一键上线 (Production)
+### VPS 快捷部署
-**步骤一:构建与注册**
-
-```bash
-git clone https://github.com/yangyuan-zhen/PolyWeather.git
-cd PolyWeather
-pip install -r requirements.txt
-cp .env.example .env # 务必填入您的加密 API 密钥
-```
-
-**步骤二:守护进程一键装配 (Daemon Updater)**
-建立自动化保活脚本,将更新、防冲突、重载集成在一条指令内:
+1. 克隆仓库并安装依赖。
+2. 配置 `.env` 文件。
+3. 使用以下脚本实现一键更新与重启:
```bash
cat > ~/update.sh << 'EOF'
@@ -66,89 +53,44 @@ cat > ~/update.sh << 'EOF'
cd ~/PolyWeather
git fetch origin
git reset --hard origin/main
-pkill -f run.py
pkill -f bot_listener.py
sleep 1
nohup python3 bot_listener.py > bot.log 2>&1 &
-echo "✅ PolyWeather 量化终端已成功重启并搭载最新模块!"
+echo "✅ PolyWeather 已重启!"
EOF
chmod +x ~/update.sh
```
-**日常战争指令 (Push & Play):**
+---
-```bash
-~/update.sh
-```
+## 🕹️ 机器人指令
-> 一键抹平 Git 冲突、热冷重启及日志切割。
+| 指令 | 说明 |
+| :--------------- | :----------------------------------------- |
+| `/city [城市名]` | 获取深度气象分析、实测追踪及 AI 决策建议。 |
+| `/id` | 查看当前对话的 Chat ID。 |
+| `/help` | 显示说明信息。 |
+
+### 支持城市示例
+
+`lon`(伦敦)、`par`(巴黎)、`ank`(安卡拉)、`nyc`(纽约)、`chi`(芝加哥)、`ba`(布宜诺斯艾利斯) 等。
---
-## 🕹️ Telegram 指控终端 (Command Center)
+## 🏗️ 系统架构
-| 战术指令 | 触发动作 | 模块反馈 |
-| :----------------- | :----------- | :-------------------------------------------------------------------------------------- |
-| `/city [城市代码]` | **火力侦察** | 发起全维度气象扫描,返回 DEB 加权预报、实测跟踪、进位结算风险预警,及 AI 量化看盘结论。 |
-| `/id` | **身份确认** | 映射当前交战信道(Chat ID)。 |
-| `/help` | **终端手册** | 拉取最新指令集。 |
-
-### 支持的主力猎场 (Target Arenas)
-
-从低风险高容错的中东非靶场,到高风险巨大滑点的北美绞肉机,PolyWeather 均提供了不同的机场偏误(Risk Profile)补偿模板:
-`lon`(伦敦 EGLC)、`par`(巴黎 LFPG)、`ank`(安卡拉 LTAC)、`nyc`(纽约 KLGA)、`chi`(芝加哥 KORD)、`ba`(布宜诺斯艾利斯 SAEZ)... 以及更多。
-
-> **示例射击:**
-> `/city 巴黎`
-> `/city london`
-> `/city ba`
+- **数据层**: 对接 Open-Meteo, NOAA, MGM 等多方数据源。
+- **算法层**: DEB 动态权重系统 + 并发缓存机制。
+- **决策层**: 基于 Groq API 的实时交易逻辑分析。
---
-## 🏗️ 引擎架构剖析 (System Architecture)
+## 💡 交易提示
-```mermaid
-graph TD
- classDef ai fill:#f9f,stroke:#333,stroke-width:2px;
- classDef core fill:#bbf,stroke:#333,stroke-width:2px;
- classDef data fill:#dfd,stroke:#333,stroke-width:1px;
-
- User[Telegram / 信号接收方] -->|触发扫描指令| Bot[bot_listener.py 核心调度器]:::core
-
- subgraph 异构数据获取层
- Bot --> Collector[WeatherDataCollector]
- Collector --> OM[Open-Meteo 归档/实时]:::data
- Collector --> MM[多模型预测集 (ECMWF...)]:::data
- Collector --> METAR[机场真实塔台日志]:::data
- end
-
- subgraph 模型计算与熔断层
- Collector --> DEB[DEB 动态融合加权算法]:::core
- DEB --> DB[(daily_records JSON 数据库
并发安全保护)]
- Collector --> Logic[结算进位判定 / 冷却判定]
- end
-
- subgraph AI 量度生成层
- DEB --> AIAnalyzer[Groq/LLaMA 深度认知模型]:::ai
- Logic --> AIAnalyzer
- METAR --> AIAnalyzer
- end
-
- AIAnalyzer -->|生成: 盘口+逻辑+置信度| Bot
- Bot -->|组合高维信息切片| User
-```
+1. **参考 DEB 融合值**:当多模型分歧较大时,DEB 的修正值通常比单一预报更具参考意义。
+2. **观察 AI 置信度**:置信度低于 5 分时,说明当前气象环境处于高度不确定状态。
+3. **注意结算边界**:实测最高温接近 X.5 时,需警惕 Wunderground 结算时的进位跳动。
---
-## 🎯 实战交易纲领 (Trader's Playbook)
-
-作为 PolyWeather 的指挥官,请将以下准则刻入 DNA 之中:
-
-1. 🧬 **信仰 DEB 基准线**:比起单方面相信 ECMWF 或 GFS 的某个极端值,请紧盯开头那一行 `DEB 融合预测`。因为那是系统吸收了最近几天这两个模型挨过的毒打之后,为您重新调整过的公论。
-2. 🎯 **严守 AI 置信度红线**:一旦 AI 反馈 `置信度 ≤ 4/10`,代表模型数据严重滞后于实况机场风速带来的博弈冲突,立即**切断**盲目押注的手,这属于高风险混沌区。
-3. ⚖️ **敬畏 X.5 结界**:Polymarket 天气盘底层以 Wunderground 取整数结算为准。当你看到终端闪烁 `⚖️ 结算边界... 刚刚越过进位线` 时,这往往是盘面上流动性抽干、盘口滑点最凶残的地方。
-4. 🌙 **识破假阳性 (暖平流侦测)**:若气温在辐射低谷的夜间和清晨依然狂飙,此时系统必然触发 `🌙 暖平流动力异常`。这一机制经常会在绝大多数赌客看跌时,为您指出真正做多打穿预报上限的信号。
-
----
-
-_The weather changes. Our edge remains. | 更新于 2026_
+_更新于 2026_