Install
openclaw skills install @deloyong/yy-world-cupUse when predicting World Cup match results and generating China Sports Lottery betting strategies (胜平负/让球/半全场/总进球/比分), including injury factor analysis, weather impact assessment, market price calibration with Polymarket, and **3 differentiated strategies** with hidden odds estimation. **All times must be 北京时间** - Polymarket endDate is UTC, requires +8h conversion.
openclaw skills install @deloyong/yy-world-cup基于双模式评分模型和Elo评级系统的增强型世界杯赛事预测工具,v3.6.0 重大升级:
from predictor.utils.timezone import bjt_day_range, is_in_bjt_day, utc_to_bjt_str
# 北京时间 6/18 当天 = UTC 6/17 16:00 ~ UTC 6/18 16:00
utc_start, utc_end = bjt_day_range('2026-06-18')
from predictor.data.polymarket_client import PolymarketClient
poly = PolymarketClient()
matches = poly.get_matches_by_bjt('2026-06-18') # 北京时间6/18的所有比赛
# Returns: 葡萄牙/英格兰/加纳/乌兹别克 vs 刚果/克罗地亚/巴拿马/哥伦比亚
体彩胜平负赔率 = 1 / (Polymarket概率 × 0.92) # 8% 庄家利润
让1球胜赔率 ≈ 1 / (主胜概率 × 0.95)
让1球平赔率 ≈ 1 / (主胜概率 × 0.90)
半场胜赔率 ≈ 1 / (主胜概率 × 0.88)
When NOT to use
| 数据源 | 优势 | 限制 |
|---|---|---|
| 真实FIFA Elo | 客观、可复现、覆盖全部球队 | 不反映伤停/天气等即时因素 |
| Polymarket市场 | $24.5亿真金白银投票,反映集体智慧 | 部分比赛可能未上架 |
| 中国体彩盘口 | 中国市场真实赔率、含庄家利润 | 仅比赛前1-2天公布 |
| 版本 | 修复点 | 验证 |
|---|---|---|
| v1.0 | 基础Elo模型(用编造数据) | 失败 |
| v2.0 | 修复upset_mode bug,补全因子 | 2024欧洲杯3/3 |
| v2.1 | 引入首轮谨慎因子 | 15场66.7%准确率 |
| v3.0 | 整合Polymarket + 体彩 | 25个测试通过 |
world-cup-predictor-enhanced/
├── SKILL.md # 本文件
├── predictor/
│ ├── __init__.py
│ ├── core.py # 双模式预测引擎(v2.1)
│ ├── factors.py # 10类预测因子
│ ├── calibration.py # 🆕 市场赔率校准器(v3.0)
│ ├── enhanced_demo.py # 🆕 综合演示脚本(v3.0)
│ ├── data/ # 数据接入层
│ │ ├── models.py
│ │ ├── api_client.py # balldontlie FIFA API
│ │ ├── polymarket_client.py # 🆕 Polymarket API(v3.0)
│ │ └── cache.py
│ ├── strategy/ # 策略引擎
│ │ ├── lottery.py
│ │ ├── conservative.py
│ │ └── aggressive.py
│ └── validator/ # 验证模块
│ └── backtest.py
├── tests/ # 🆕 25个测试全部通过
│ ├── test_factors.py
│ └── test_polymarket.py # 🆕 v3.0 测试
└── data/ # 运行时数据
Elo差 ≥ 15分 → 爆冷模式(爆冷因子+客胜加权)
Elo差 < 15分 → 平衡模式(泊松分布+动态平局)
小组赛首轮 → 谨慎因子 +6%(v2.1新增)
| 因子 | 权重 | 说明 |
|---|---|---|
| 基础Elo | 35% | 1600-1950区间 |
| 伤病上场概率 | 15% | 主力+位置差异化 |
| 近期状态 | 12% | 近5场加权 |
| 天气影响 | 8% | 温度/降水/风力 |
| 小组排名 | 7% | 出线形势对战意 |
| 攻防数据 | 7% | 进球/失球差值 |
| 主场优势 | 5% | 中立25/真实70 Elo |
| 平局率 | 5% | 同阶段校正 |
| 平局偏差 | 4% | 历史对战 |
| 战术克制 | 2% | 风格相克 |
真实FIFA Elo → 基础预测概率
↓
Polymarket市场 → 校验/调整(24.5亿市场智慧)
↓
中国体彩盘口 → 中国市场赔率 + 庄家利润评估
↓
最终预测 + 套利机会报告
from predictor.enhanced_demo import enhanced_predict_6_17
enhanced_predict_6_17() # 6/17 3场完整预测+EV分析
from predictor import WorldCupPredictor
from predictor.data import Team, MatchInfo, TeamStyle
home = Team(id=1, name="France", elo=1870, style=TeamStyle.BALANCED, ...)
away = Team(id=2, name="Senegal", elo=1684, style=TeamStyle.PHYSICAL, ...)
match = MatchInfo(home_team=home, away_team=away, ..., is_neutral=True)
pred = WorldCupPredictor().predict(match)
print(f"主胜 {pred.home_win_prob*100:.1f}%")
from predictor.data import PolymarketClient
poly = PolymarketClient()
wc = poly.get_world_cup_winner()
print(f"法国: {wc['teams']['France']*100:.2f}%") # 17.65%
from predictor.calibration import MarketCalibrator
cal = MarketCalibrator()
report = cal.generate_report(
model_winner_probs={'France': 0.20, 'Spain': 0.13, ...}
)
print(MarketCalibrator.format_report(report))
# 全部25个测试
python3 -m unittest tests.test_factors tests.test_polymarket -v
# 仅Polymarket相关
python3 -m unittest tests.test_polymarket -v