Prediction Stack Setup — One-Command System Activation
Overview
This skill wires the 10-skill OpenClaw Prediction Market Trading Stack into a connected, proactive system. Without setup, skills work individually when you ask for them. After setup, the runtime skills run autonomously — scanning markets, detecting edges, monitoring positions, and delivering intelligence to your phone on a schedule.
What it does:
- 1. Detects which stack skills are installed
- Configures API keys and credentials
- Validates all APIs before creating jobs (prevents silent failures)
- Creates scheduled jobs (cron) for each skill
- Enables heartbeat for ambient awareness
- Sets up iMessage delivery
- Tests the full pipeline end-to-end
Time to complete: Under 5 minutes
When to Use This Skill
- - You just installed the Prediction Market Trading Stack (all 8 skills or any subset)
- You just installed the Prediction Market Trading Stack (all 10 skills or any subset)
- You want to activate automated scanning and alerts
- You need to change your delivery target (new phone, new email handle)
- You want to adjust scan schedules or alert thresholds
- You're migrating from a previous setup or starting fresh
- Something broke and you want to rewire from scratch
Prerequisites
Required
- - OpenClaw installed and running (gateway active)
- At least one stack skill installed (any of the 10)
- Kalshi account with API credentials (free at kalshi.com)
- Anthropic API key (for Claude Sonnet estimation in Kalshalyst)
Optional (Enhances the Stack)
- - Polygon.io API key (free tier — adds news context to Kalshalyst)
- Ollama + Qwen installed locally (free — adds offline fallback + Xpulse materiality gate)
- BlueBubbles running on your Mac (required for iMessage delivery)
Setup Procedure
Phase 1: Skill Detection
First, check which stack skills are installed. Run this command:
CODEBLOCK0
The 10 stack skills:
| Skill | Role | Required For |
|---|
| Kalshalyst | Edge detection engine | Edge alerts, Morning Brief edges section |
| Kalshi Command Center |
Trade execution | Executing on Kalshalyst recommendations |
| Polymarket Command Center | Market data | Arbiter comparisons, Morning Brief Polymarket section |
| Prediction Market Arbiter | Cross-platform divergences | Arbitrage alerts, Morning Brief divergences section |
| Xpulse | Social signal scanner | Signal alerts, Morning Brief X signals section |
| Portfolio Drift Monitor | Position monitoring | Drift alerts between briefs |
| Market Morning Brief | Daily digest | Consolidated morning/evening intelligence |
| Personality Engine | Agent behavior | Consistent voice across all output |
| Prediction Stack Orchestrator | Premium/experimental pipeline manager | Validation and execution routing |
| Prediction Stack Setup | Setup wizard | Validation, scheduling, delivery wiring |
Minimum viable stack: Kalshalyst + Kalshi Command Center + Market Morning Brief. These three give you edge detection, execution, and daily digest. Everything else enriches the system.
Full stack: All 10 skills. Morning Brief pulls from every cache and the orchestrator adds a premium/experimental automation path on top.
Install missing skills:
CODEBLOCK1
Phase 2: API Key Configuration
Create or update ~/.openclaw/config.yaml:
CODEBLOCK2
Kalshi key setup (if you don't have one yet):
- 1. Log in at https://kalshi.com
- Go to Settings → API Keys
- Generate a new key pair
- Save the private key:
CODEBLOCK3
Phase 2.5: Validate API Keys
Before creating cron jobs, verify that all configured APIs are working. This prevents hours of silent failures where the stack runs but can't reach its data sources.
Run the validation script:
CODEBLOCK4
Output Example:
CODEBLOCK5
What each validation tests:
| Service | Required | Test | Failure Handling |
|---|
| Kalshi | Yes | INLINECODE1 call | Blocks setup if auth fails |
| Claude |
Yes | Simple completion call | Blocks setup if key invalid |
|
Polygon.io | No | Public market status endpoint | Kalshalyst works without it |
|
Ollama/Qwen | No | Model availability + inference | Kalshalyst uses Claude fallback |
|
Polymarket | No | Public API endpoint access | Arbiter works without it |
If validation fails on REQUIRED services:
- 1. Kalshi fails — Check error message:
- "Authentication failed": Verify key ID and private key file are correct at https://kalshi.com/settings/api
- "Network error": Verify internet connectivity, check Kalshi status at status.kalshi.com
- "File not found": Verify
private_key_file path in config.yaml exists and is readable
- 2. Claude fails — Check error message:
- "Invalid or expired API key": Generate a new key at https://console.anthropic.com/account/keys
- "Network error": Verify internet connectivity
- "Rate limited": Wait 60 seconds and retry
- 3. Optional services fail — This is OK. The stack will work but with reduced functionality:
- Polygon.io missing: Kalshalyst estimates will lack news context
- Ollama missing: Kalshalyst will use Claude for all estimates (higher cost)
- Polymarket missing: Arbiter won't find cross-platform divergences
To validate only specific services:
CODEBLOCK6
Phase 3: iMessage Delivery Setup
The stack delivers alerts via iMessage through BlueBubbles. This requires:
- 1. BlueBubbles running on your Mac (https://bluebubbles.app)
- BlueBubbles password set in OpenClaw config
- Your iMessage email handle (the email registered with your Apple ID for iMessage)
Configure BlueBubbles:
CODEBLOCK7
Test delivery:
CODEBLOCK8
If the message arrives on your phone, delivery is working. If not:
Troubleshooting:
- - Verify BlueBubbles is running (check the app on your Mac)
- Verify Full Disk Access is granted to Terminal (System Settings → Privacy & Security → Full Disk Access)
- On macOS Tahoe+: use email handles, not phone numbers, for proactive sends
- Check gateway logs: INLINECODE3
- Run diagnostics: INLINECODE4
Phase 4: Create Scheduled Jobs
Important: Complete Phase 2.5 (API validation) before running these commands. Cron jobs will fail silently if APIs are misconfigured.
These cron jobs are the nervous system of the stack — they trigger skills on a schedule and deliver results to your phone. Replace YOURIMESSAGEEMAIL in every command below.
CODEBLOCK9
Verify all jobs:
CODEBLOCK10
You should see 6 jobs: morning-brief, evening-brief, edge-scan, xpulse-scan, drift-monitor, arbiter-scan.
Quick reference — what fires when:
| Time | Job | What Happens |
|---|
| 8:00 AM | morning-brief + edge-scan | Full digest + first edge scan of the day |
| 9:00 AM |
drift-monitor + arbiter-scan | Position check + first arbitrage scan |
| 9:30 AM | xpulse-scan | Social signal check |
| 10:00 AM | edge-scan + drift-monitor + xpulse-scan | Edge + drift + signals |
| ... | (continues hourly/half-hourly) | |
| 5:00 PM | arbiter-scan | Last arbitrage scan |
| 6:00 PM | evening-brief | Evening summary |
| 8:00 PM | edge-scan + drift-monitor | Last edge scan + drift check |
| 10:00 PM | xpulse-scan | Last signal scan (then quiet until 8 AM) |
Phase 5: Enable Heartbeat
Heartbeat gives your agent ambient awareness between scheduled jobs. Every 30 minutes during active hours, the agent checks if anything needs attention.
CODEBLOCK11
Optional — configure HEARTBEAT.md for proactive checks between scans:
Edit ~/.openclaw/workspace/HEARTBEAT.md:
CODEBLOCK12
Phase 6: Verify Everything
CODEBLOCK13
If the manual edge scan delivers results to your phone (or runs silently because nothing met threshold), the stack is fully operational.
Post-Setup: What to Expect
First 24 Hours
- - Immediately: Xpulse fires every 30 min. Most runs will be silent (nothing passes materiality gate). This is correct — silence means the filter is working.
- Next morning at 8 AM: First Morning Brief arrives. If other skill caches are empty (first run), sections will show "unavailable" — they'll populate after the first scan cycle.
- By end of day 1: All caches populated. Evening Brief will have a full picture.
Ongoing
- - Most alerts are silence. This is by design. The stack is built to prevent notification fatigue. You'll get 2-5 actionable alerts per day, not 50.
- Morning Brief is your daily touchpoint. 30-second scan of everything that matters.
- Edge alerts are the money. When Kalshalyst fires with >= 6% edge, that's your signal to look at the trade.
Tuning
After a week of operation, you may want to adjust:
Alert thresholds (in cron job messages or config.yaml):
- - Raise
alert_edge_pct from 6% to 8% if too many low-quality alerts - Lower to 4% if you're not seeing enough opportunities
- Adjust drift threshold from 5% to 3% (more sensitive) or 10% (less noise)
Schedule frequency:
- - Reduce edge-scan to 3x daily if API costs are a concern
- Increase xpulse to every 15 min if you trade breaking news heavily
- Add weekend scanning by changing cron expressions
Xpulse topics (in config.yaml):
- - Add topics matching your active positions
- Remove topics you're no longer trading
To update a cron job:
CODEBLOCK14
Reconfiguration
Change Delivery Target
CODEBLOCK15
Change Timezone
CODEBLOCK16
Disable a Job Temporarily
CODEBLOCK17
Full Reset
CODEBLOCK18
How the Skills Connect (System Architecture)
CODEBLOCK19
Data flow: Skills write JSON cache files. Morning Brief reads them. Cron jobs trigger everything. BlueBubbles delivers to iMessage. No direct dependencies between skills — install any subset and each works standalone.
Cost Summary
| Component | Cost | Notes |
|---|
| Kalshi API | Free | Unlimited reads |
| Polymarket API |
Free | Public, no auth |
| Polygon.io | Free | Free tier sufficient |
| DuckDuckGo | Free | Via Xpulse |
| Ollama/Qwen | Free | Local inference |
| Claude Sonnet | Variable | Depends on model, prompt size, and scan frequency |
| BlueBubbles | Free | Self-hosted on Mac |
|
Total |
Variable | Claude is the only paid dependency in the public reference path |
Troubleshooting
No messages arriving
- 1. Test send: INLINECODE7
- Check BB is running (BlueBubbles app on Mac)
- Check FDA: System Settings → Privacy & Security → Full Disk Access → Terminal
- Check gateway: INLINECODE8
- On macOS Tahoe+: use email handles, not phone numbers
Cron jobs not firing
- 1. Verify gateway is running: INLINECODE9
- List jobs:
openclaw cron list (check "Next" column) - Manual trigger: INLINECODE11
- Check logs: INLINECODE12
Skills not finding data
- 1. First, run the validation script to catch API issues early:
python ~/skills/prediction-stack-setup/scripts/validate_setup.py --verbose
This will identify which API is misconfigured.
- 2. Check API keys: verify
~/.openclaw/config.yaml has valid credentials - Test Kalshi: INLINECODE14
- Check Ollama (for Xpulse):
ollama list should show qwen3:latest
Morning Brief shows "unavailable" sections
This is normal on first run — caches haven't been populated yet. After one full scan cycle (edge-scan + arbiter-scan + xpulse-scan), all caches will exist and Morning Brief will show full data.
Stack Skills Reference
For detailed documentation on each skill, read its SKILL.md:
- - Kalshalyst — Contrarian edge detection. The intelligence engine.
- Kalshi Command Center — Portfolio, scanning, trade execution, risk management.
- Polymarket Command Center — Trending markets, odds, search, watchlists.
- Prediction Market Arbiter — Cross-platform divergence scanner.
- Xpulse — X/Twitter social signal scanner with materiality gate.
- Portfolio Drift Monitor — Position drift alerts.
- Market Morning Brief — Daily morning/evening intelligence digest.
- Personality Engine — 6-system behavior framework for consistent agent voice.
Feedback & Issues
Found a bug? Have a feature request? Want to share results?
Part of the OpenClaw Prediction Stack — the first prediction market skill suite on ClawHub.
预测堆栈设置 — 一键系统激活
概述
本技能将10技能OpenClaw预测市场交易堆栈连接成一个连贯的主动系统。未设置时,技能仅在您主动调用时单独工作。设置完成后,运行时技能将自主运行——扫描市场、检测套利机会、监控持仓,并按计划向您的手机发送情报。
功能:
- 1. 检测已安装的堆栈技能
- 配置API密钥和凭证
- 在创建任务前验证所有API(防止静默失败)
- 为每个技能创建定时任务(cron)
- 启用心跳以实现环境感知
- 设置iMessage投递
- 端到端测试完整管道
完成时间: 5分钟以内
何时使用本技能
- - 您刚刚安装了预测市场交易堆栈(全部8个技能或任意子集)
- 您刚刚安装了预测市场交易堆栈(全部10个技能或任意子集)
- 您想要激活自动扫描和警报
- 您需要更改投递目标(新手机号、新邮箱地址)
- 您想要调整扫描计划或警报阈值
- 您正在从之前的设置迁移或全新开始
- 某些功能出现故障,您想要从头重新配置
前提条件
必需
- - OpenClaw 已安装并运行(网关活跃)
- 至少一个堆栈技能 已安装(10个中的任意一个)
- Kalshi账户 并拥有API凭证(在kalshi.com免费注册)
- Anthropic API密钥(用于Kalshalyst中的Claude Sonnet评估)
可选(增强堆栈功能)
- - Polygon.io API密钥(免费层级——为Kalshalyst添加新闻上下文)
- Ollama + Qwen 本地安装(免费——提供离线备用 + Xpulse重要性门控)
- BlueBubbles 在您的Mac上运行(iMessage投递必需)
设置流程
第一阶段:技能检测
首先,检查已安装的堆栈技能。运行以下命令:
bash
openclaw skills list | grep -E kalshalyst|kalshi-command|polymarket-command|prediction-market-arbiter|xpulse|portfolio-drift|market-morning-brief|personality-engine
10个堆栈技能:
| 技能 | 角色 | 必需用于 |
|---|
| Kalshalyst | 套利机会检测引擎 | 套利警报、晨间简报套利部分 |
| Kalshi指挥中心 |
交易执行 | 执行Kalshalyst建议 |
| Polymarket指挥中心 | 市场数据 | Arbiter比较、晨间简报Polymarket部分 |
| 预测市场仲裁器 | 跨平台价差 | 套利警报、晨间简报价差部分 |
| Xpulse | 社交信号扫描器 | 信号警报、晨间简报X信号部分 |
| 持仓漂移监控器 | 持仓监控 | 简报间的漂移警报 |
| 市场晨间简报 | 每日摘要 | 整合的晨间/晚间情报 |
| 个性引擎 | 智能体行为 | 所有输出的一致语气 |
| 预测堆栈编排器 | 高级/实验性管道管理器 | 验证和执行路由 |
| 预测堆栈设置 | 设置向导 | 验证、调度、投递配置 |
最小可行堆栈: Kalshalyst + Kalshi指挥中心 + 市场晨间简报。这三个提供套利检测、执行和每日摘要。其他技能丰富系统功能。
完整堆栈: 全部10个技能。晨间简报从每个缓存读取数据,编排器在此基础上增加高级/实验性自动化路径。
安装缺失技能:
bash
clawhub install <技能名称>
第二阶段:API密钥配置
创建或更新 ~/.openclaw/config.yaml:
yaml
=== 必需 ===
kalshi:
enabled: true
apikeyid: 您的KALSHI密钥ID
privatekeyfile: ~/.openclaw/keys/kalshi-secret.pem
=== KALSHALYST必需 ===
设置为环境变量或在配置中:
export ANTHROPICAPIKEY=sk-ant-...
=== 可选 — 增强套利质量 ===
polygon:
api_key: 您的POLYGON密钥 # 在polygon.io免费注册
ollama:
enabled: true # 用于Xpulse重要性门控 + Kalshalyst备用
model: qwen3:latest
timeout_seconds: 60
=== 技能特定调优(显示合理默认值) ===
kalshalyst:
enabled: true
checkintervalminutes: 60
min_volume: 50
mindaysto_close: 7
maxdaysto_close: 365
maxmarketsto_analyze: 50
minedgepct: 3.0
alertedgepct: 6.0
xpulse:
enabled: true
checkintervalminutes: 30
topics:
- 特朗普关税
- 乌克兰
- 通胀CPI
- 美联储利率决策
min_confidence: 0.7
materiality_gate: true
position_gate: true
portfolio_drift:
threshold_pct: 5.0
checkintervalminutes: 60
Kalshi密钥设置(如果您还没有):
- 1. 登录 https://kalshi.com
- 前往 设置 → API密钥
- 生成新的密钥对
- 保存私钥:
bash
mkdir -p ~/.openclaw/keys
将您的私钥粘贴到此文件中:
nano ~/.openclaw/keys/kalshi-secret.pem
chmod 600 ~/.openclaw/keys/kalshi-secret.pem
第二阶段.5:验证API密钥
在创建cron任务之前,验证所有配置的API是否正常工作。 这可以防止数小时的静默失败——堆栈看似运行但无法访问数据源。
运行验证脚本:
bash
python ~/skills/prediction-stack-setup/scripts/validate_setup.py
输出示例:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
预测堆栈API验证
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
必需服务(堆栈运行必须通过)
──────────────────────────────────────────────────────────────────────
✅ 通过 Kalshi API (必需) (245ms)
✅ 通过 Anthropic (Claude) (必需) (1320ms)
可选服务(增强套利检测和弹性)
──────────────────────────────────────────────────────────────────────
✅ 通过 Polygon.io API (可选) (180ms)
❌ 失败 Ollama (Qwen) (可选) (15ms)
错误:Ollama未在localhost:11434运行
✅ 通过 Polymarket API (可选) (95ms)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
必需:2/2 通过
可选:2/3 通过
✅ 所有必需服务已验证。堆栈已准备就绪,可以启动。
每个验证测试的内容:
| 服务 | 必需 | 测试 | 失败处理 |
|---|
| Kalshi | 是 | get_balance() 调用 | 认证失败则阻止设置 |
| Claude |
是 | 简单补全调用 | 密钥无效则阻止设置 |
|
Polygon.io | 否 | 公开市场状态端点 | Kalshalyst无此功能仍可工作 |
|
Ollama/Qwen | 否 | 模型可用性 + 推理 | Kalshalyst使用Claude备用 |
|
Polymarket | 否 | 公开API端点访问 | Arbiter无此功能仍可工作 |
如果必需服务验证失败:
- 1. Kalshi失败 — 检查错误信息:
- 认证失败:在 https://kalshi.com/settings/api 验证密钥ID和私钥文件是否正确
- 网络错误:验证互联网连接,在 status.kalshi.com 检查Kalshi状态
- 文件未找到:验证config.yaml中的private
keyfile路径存在且可读
- 2. Claude失败 — 检查错误信息:
- API密钥无效或已过期:在 https://console.anthropic.com/