Back to feed

bestpracticaI/kalshi-ai-trading-bot

bestpracticaI/kalshi-ai-trading-bot
221
+44/day
286
TypeScriptAI/ML

Kalshi prediction markets trading bot algorithmic automated trading TypeScript Node.js Kalshi REST API RSA signing OpenRouter LLM CLI npm quant fintech event contracts market making exchange API bot Kalshi SDK

From the README

Kalshi AI Trading Bot

Build and automate workflows around Kalshi prediction markets using TypeScript and Node.js — with a ready-made CLI, a signed Kalshi REST client, and helpers for calling models through OpenRouter.

GitHub: github.com/bestpracticaI/kalshi-ai-trading-bot · keywords: Kalshi, prediction markets, trading bot, algorithmic trading, automated trading, TypeScript, Node.js, Kalshi API, REST, OpenRouter, quant, fintech, CLI, npm

What you get · Requirements · Install & first run · CLI reference · Configuration · Troubleshooting

Important disclaimer

Trading involves risk. Nothing in this repository promises profit, and prediction markets can be illiquid or fast-moving. Treat this project as starter code: read it, adapt it, and only trade with money you can afford to lose. The authors are not responsible for losses.

Table of contents

  1. What you get
  2. Requirements
  3. Install & first run
  4. Kalshi API keys & private key
  5. Day-to-day commands
  6. CLI reference
  7. Configuration
  8. Project layout
  9. Extending the bot
  10. Troubleshooting
  11. Links
  12. Contributing

What you get

| Feature | Status | |--------|--------| | Kalshi REST client | RSA-PSS signing, retries on rate limits / server errors, balance, positions, markets, orderbook, orders | | CLI | health, status, history, close-all, run (stub), placeholders for dashboard/scores/backtest | | OpenRouter client | Thin wrapper so you can plug in LLMs using one API key | | Typed settings | Central config in TypeScript + overrides from .env | | Trade history view | Reads trading_system.db with sql.js if you already have that database file |

Note: health expects trading_system.db to exist today; without it, other checks may pass while the database line fails (see Troubleshooting).

The run command is currently a stub: it wires up the bot shell but does not ship a full end-to-end strategy (market scan → model → execute) out of the box. That is intentional so you can add your own logic under src/ without fighting a huge opinionated engine.

Requirements

Before you start, check these boxes:

  • Node.js version 18.18 or newer (Node 20 LTS is a good choice). Check with node -v.
  • npm (bundled with Node). Check with npm -v.
  • A Kalshi account with API access enabled.
  • (Optional but typical) An OpenRouter account if you plan to call LLMs from code you add yourself.

You do not need Python or a separate SQLite installation for this repo; the CLI uses embedded sql.js when it reads the o