whatisgithub

What is kalshi-trading-bot?

sachmalan/kalshi-trading-bot — explained in plain English

Analysis updated 2026-05-18

78TypeScriptAudience · developerComplexity · 4/5Setup · hard

In one sentence

A Kalshi prediction market bot that runs five AI models in a debate-style ensemble, sizes trades with the Kelly Criterion, and defaults to paper trading.

Mindmap

mindmap
  root((repo))
    What it does
      Five agent debate ensemble
      Kelly sized positions
      Paper trading default
    Tech stack
      TypeScript
      Node.js
      OpenRouter
    Use cases
      Trade prediction markets
      Test strategies safely
      Track category performance
    Audience
      Developers
      Prediction market traders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Trade Kalshi prediction markets automatically using a multi-model AI ensemble.

USE CASE 2

Test trading strategies risk-free using the built-in paper trading mode.

USE CASE 3

Track which market categories the bot performs best in over time.

What is it built with?

TypeScriptNode.jsOpenRouterSQLite

How does it compare?

sachmalan/kalshi-trading-botadrienckr/notslopalchemz/solana-pumpfun-token-bundler
Stars787878
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyhardeasyhard
Complexity4/52/54/5
Audiencedeveloperwriterdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a Kalshi API key with an RSA private key and an OpenRouter API key covering five LLMs.

So what is it?

This is a TypeScript-based automated trading bot for Kalshi, a regulated U.S. prediction market platform where you bet real money on the outcomes of events like elections, economic indicators, and sports results. What distinguishes this bot from simpler trading bots is its multi-AI-agent architecture. Instead of a single AI making a buy/sell decision, it runs five specialized AI agents in parallel through OpenRouter (a service that routes requests to multiple AI providers with one API key): a forecaster, a news analyst, a bull researcher arguing for a position, a bear researcher arguing against it, and a risk manager. The bull and bear agents debate the trade, and the bot only proceeds if disagreement is below a threshold. The five agents' probability estimates are combined using confidence-weighted consensus, a voting-like approach where models with better historical calibration have more influence. Position sizing uses the Kelly Criterion, a mathematical formula that bets a fraction proportional to your estimated edge to maximize long-run growth without risking ruin. Safety features include hard position size limits, a daily dollar loss cap, a built-in daily AI cost cap (default ten USD) that physically prevents LLM calls when the budget runs out, and paper trading mode (simulated trading with fake money) that is enabled by default so you must explicitly flip a flag to use real money. Trade history, model performance, and category scores are stored in SQLite. Built on Node.js 22.5 or newer, TypeScript, and Vitest for testing.

Copy-paste prompts

Prompt 1
Explain how the bull and bear researcher agents in this bot debate before a trade decision.
Prompt 2
Help me configure the daily AI cost limit and Kelly sizing settings for this bot.
Prompt 3
Walk me through the difference between paper trading and live trading modes in this bot.

Frequently asked questions

What is kalshi-trading-bot?

A Kalshi prediction market bot that runs five AI models in a debate-style ensemble, sizes trades with the Kelly Criterion, and defaults to paper trading.

What language is kalshi-trading-bot written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, OpenRouter.

How hard is kalshi-trading-bot to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is kalshi-trading-bot for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.