← 返回 Skills 市场
bobthemom987

Kalshi Trader

作者 bobthemom987 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
122
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install kalshi-trader
功能描述
Automated Kalshi prediction market trading bot. Sets up a fully automated trading system that scans markets every 15 minutes, researches opportunities using...
使用说明 (SKILL.md)

Kalshi Trader

Automated prediction market trading on Kalshi. Scans every 15 minutes, researches before every trade, reports daily via Telegram.

Setup (run once)

1. Install dependencies

pip install cryptography requests --break-system-packages

2. Store Kalshi credentials

mkdir -p ~/.kalshi && chmod 700 ~/.kalshi
nano ~/.kalshi/private_key.pem   # paste -----BEGIN RSA PRIVATE KEY----- block
chmod 600 ~/.kalshi/private_key.pem
echo "YOUR-API-KEY-ID-HERE" > ~/.kalshi/key_id.txt
chmod 600 ~/.kalshi/key_id.txt

Get your API key at: kalshi.com → Settings → API → Create Key

3. Deploy the bot

cp scripts/kalshi_bot.py ~/kalshi_bot.py
chmod 600 ~/kalshi_bot.py

4. Test connection

python3 ~/kalshi_bot.py test

5. Set up cron jobs (via OpenClaw cron tool)

15-minute scan (silent unless trade placed or exited):

  • Schedule: */15 * * * *
  • Message: see references/cron-prompt.md

Daily summary (9am your timezone):

  • Schedule: 0 9 * * * with your timezone
  • Message: "Run python3 ~/kalshi_bot.py summary and send daily trading report with balance, open positions, recent trades, P&L, and fees paid."

Trading Rules

Entry criteria

Only place a trade if EV IRR ≥ 50% (post-fee):

edge = fair_value - (market_price + entry_fee)
EV IRR = (edge / (market_price + entry_fee)) × (365 / days_to_close)

Minimum: EV IRR ≥ 0.50 (50%)

Position sizing — Half Kelly

kelly_fraction = (edge / market_price) × 0.5
max_position = min(kelly_fraction × balance, 0.20 × balance)
contracts = floor(max_position / market_price)

Exit rule

Exit ONLY if current bid ≥ fair value estimate (net of exit fee).

  • Never use price-based stop losses — prediction markets resolve on facts, not on what other traders think
  • If price drops, research whether the underlying facts changed
  • Only exit early if: (a) price reached fair value, or (b) new evidence shows the outcome is unlikely

Research approach

Use web_fetch as primary research tool (no quota limits). Known data sources:

  • Gas prices: https://gasprices.aaa.com/
  • Trump actions: https://www.whitehouse.gov/presidential-actions/
  • Treasury yields: https://home.treasury.gov/resource-center/data-chart-center/interest-rates/
  • Bitcoin/crypto: https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
  • Weather: https://wttr.in/CityName?format=3
  • Congress bills: https://www.congress.gov

Only use web_search for open-ended research where the URL isn't known upfront.

Bot Commands

python3 ~/kalshi_bot.py          # scan for opportunities
python3 ~/kalshi_bot.py summary  # print P&L summary  
python3 ~/kalshi_bot.py test     # verify API connection

Reporting format (include in every update)

  • 💰 Cash balance
  • 📦 Total position cost
  • 📈 Current market value of positions
  • 💹 Unrealized P&L
  • 💸 Total Kalshi fees paid
  • 🏦 Total portfolio value

API reference

See references/api.md for Kalshi authentication and endpoints.

Trade research workflow

See references/trade-research.md for finding and evaluating opportunities.

安全使用建议
This package contains a plausible Kalshi client and sensible trading rules, but it does NOT implement the full automated behavior described in the docs (no auto-research, no automatic order execution loop, no Telegram reporting). Before installing or running: 1) Treat the RSA private key you create as highly sensitive — store it with strict permissions and do not run the bot as root. 2) Inspect the script yourself (it’s small) and test with the 'test' command to confirm API connectivity. 3) If you expect fully automated trading or Telegram notifications, implement and review those features first — the current code will only scan and print candidates. 4) Fix the path inconsistency (/root/.kalshi vs ~/.kalshi) in docs to avoid misplacing keys. 5) Remove or explain the pip --break-system-packages flag if you are not using a constrained environment. 6) Run initial scans in a limited/test account or sandbox and monitor activity (cron jobs should be configured only after you trust the behavior). If you want, ask for a follow-up review after the author supplies a version that actually performs autonomous trading and reporting so I can re-evaluate.
功能分析
Type: OpenClaw Skill Name: kalshi-trader Version: 1.0.0 The skill is a legitimate automated trading bot for the Kalshi prediction market. It implements the official Kalshi API authentication (RSA-PSS signing) in `scripts/kalshi_bot.py` and provides clear instructions in `SKILL.md` and `references/cron-prompt.md` for the agent to perform market research and execute trades based on financial metrics like EV IRR and the Kelly Criterion. The setup process includes security best practices such as restrictive file permissions for API keys, and the data sources used for research are reputable public websites (e.g., treasury.gov, whitehouse.gov).
能力评估
Purpose & Capability
The name and description promise a fully automated Kalshi trading bot that researches, places trades, monitors positions, and sends Telegram summaries. The code (scripts/kalshi_bot.py) supports authenticated API calls and has helper functions to place orders and log trades, which is consistent with a trading tool, but the main CLI only scans markets, prints candidates, and provides a summary — it does not perform automatic research, autonomous trade placement, position monitoring, or Telegram notifications as claimed. Storing an RSA private key and key id is appropriate for signing Kalshi requests, so those credential requirements are proportionate to a trading bot, but the overall capability is overstated compared to the implementation.
Instruction Scope
SKILL.md instructs installation, creating ~/.kalshi private key files, setting up cron jobs that run every 15 minutes and daily summaries, and directs the agent to use web_fetch/web_search for research. The instructions also describe strict entry/exit rules and research workflows not enforced by the code. The cron prompt and docs reference automated behavior and notification-only-on-trade semantics, but the shipped script will not autonomously execute trades or send Telegram messages. Also, references/api.md shows reading keys from /root/.kalshi while the code uses the user's home (~/.kalshi) — a path inconsistency. The install step suggests using pip with --break-system-packages which is an unusual flag to include in a generic README and may confuse less experienced users.
Install Mechanism
There is no packaged install spec; SKILL.md instructs the user to run pip install cryptography requests. That is reasonable for a Python script, but the explicit use of the pip flag --break-system-packages is atypical and should be reconsidered or explained. Because this is instruction-only with a small script, there is no archive download or opaque install URL — lower installation risk overall.
Credentials
The skill does not request environment variables or unrelated credentials. It explicitly asks the user to store an RSA private key and a key id in ~/.kalshi which matches the Kalshi API auth mechanism shown in references/api.md. The only proportionality concern is the inconsistent example path in references/api.md (/root/.kalshi) versus the script and SKILL.md (~/.kalshi). The skill writes a local log (~/kalshi_trades.json) which is expected for trading history but may contain sensitive trade data.
Persistence & Privilege
always is false; the skill does not request elevated or persistent platform-wide privileges. It only reads ~/.kalshi files and writes a local log file. It does not modify other skills or system-wide configurations. Autonomous invocation (disable-model-invocation=false) is normal but not combined with other high-risk flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kalshi-trader
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kalshi-trader 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of Kalshi Trader: automated Kalshi prediction market trading bot. - Scans Kalshi markets every 15 minutes and researches opportunities using direct web fetches. - Places trades based on strict EV IRR (≥50%) and half Kelly criteria. - Manages positions and exits only if price meets fair value or if new information arises. - Sends daily trading summaries—including cash balance, open positions, P&L, and fees—via Telegram. - Comprehensive setup and usage instructions provided.
元数据
Slug kalshi-trader
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Kalshi Trader 是什么?

Automated Kalshi prediction market trading bot. Sets up a fully automated trading system that scans markets every 15 minutes, researches opportunities using... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 122 次。

如何安装 Kalshi Trader?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kalshi-trader」即可一键安装,无需额外配置。

Kalshi Trader 是免费的吗?

是的,Kalshi Trader 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Kalshi Trader 支持哪些平台?

Kalshi Trader 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Kalshi Trader?

由 bobthemom987(@bobthemom987)开发并维护,当前版本 v1.0.0。

💬 留言讨论