Prediction Markets CLI · Powered by Octagon

Trade Kalshi and Polymarket from your terminal.

An AI agent that researches every market, finds edge against the live order book, and executes trades. One CLI per venue, one research pipeline underneath. Half-Kelly sizing. Five-gate risk engine.

2 Prediction market venues
5 Risk gates before each fill
Available for
bunx kalshi-trading-bot-cli@latest
bunx polymarket-trading-bot-cli@latest
What it does

A research analyst, risk manager, and order router — on both venues.

AI agent loop

Natural-language queries trigger up to 10 tool-use iterations across the venue and Octagon. Bring your own LLM key — OpenAI, Anthropic, Google, xAI, OpenRouter, or local Ollama.

Edge detection

Octagon's model probability minus the live order book = edge. Surfaced per market, ranked across the universe, and sized with half-Kelly behind five risk gates before a dollar is risked.

Diversified baskets Kalshi

One-call basket construction with thematic-cluster caps and pairwise correlation caps. Backtest a theme, Kelly-size it, validate cluster overlap — all server-side. Available on Kalshi, where Octagon computes the clustering.

Live commands

From "I have an idea" to a filled order in four lines.

01

Discover

Server-side full-text + semantic search across the Kalshi universe.

> search "bitcoin price" --category crypto --min-volume 10000
  Ticker              Title                          Last    Volume
  KXBTC-26APR-B95000  Bitcoin above $95k by Apr 30   $0.58   12,841
  KXBTC-26APR-B100000 Bitcoin above $100k by Apr 30  $0.31    8,203
  KXETH-26APR-B2000   Ethereum above $2k by Apr 30   $0.72    5,419

  3 markets found
02

Analyze

Per-event research report with model probability, drivers, and Kelly sizing.

> analyze KXBTC-26APR-B95000
  Octagon Research Report — KXBTC-26APR-B95000
  ────────────────────────────────────────
  Model Probability   72%
  Market Price        58%
  Edge               +14.0%  (very_high confidence)

  Top Drivers
  1. Bitcoin ETF inflows accelerating       impact: high
  2. Halving cycle momentum                 impact: high
  3. Macro risk-on sentiment            impact: moderate

  Kelly Sizing: 3 contracts YES at $0.58
  Risk gates: ✓ Kelly ✓ Liquidity ✓ Corr ✓ Concentration ✓ Drawdown
03

Build a diversified basket

One call: candidate universe → cluster caps → correlation caps → Kelly sizing.

> basket build --label fed,cpi,fomc,gdp,jobs -n 5 --max-corr 0.4
  Basket built · 5 legs · max pairwise corr 0.32
  ────────────────────────────────────────
  KXFEDDECISION-MAR     YES  $0.61  Kelly $122  cluster: fed-policy
  KXCPIYOY-FEB          NO   $0.44  Kelly $98   cluster: inflation
  KXFOMC-DOTS-25Q4      YES  $0.55  Kelly $87   cluster: fed-policy
  KXU3-MAR              NO   $0.39  Kelly $76   cluster: labor
  KXGDPNOW-Q1           YES  $0.52  Kelly $64   cluster: growth

  Total exposure: $447 · expected return: +18.6%
04

Execute

Confirm with one keystroke. Limit price in cents, side defaults to YES.

> buy KXBTC-26APR-B95000 3 58
  Confirm order? [y/n] y
  ✓ Order placed: BUY 3 YES @ $0.58
  Order ID: abc-123-def

  Cash: $487.26 · Exposure: $1.74 · Open positions: 1
01

Discover

Search by keyword, category, theme, or liquidity across Polymarket.

> search crypto --min-volume 5000 --limit 3
  Market                                       Last    Volume
  will-bitcoin-hit-100k-by-march-31-2027       0.41     9,640
  will-bitcoin-hit-100k-by-june-30-2027        0.53     6,175
  will-bitcoin-hit-100k-by-december-31-2027    0.69    11,208

  3 markets found
02

Analyze

Per-market research report with model probability, drivers, and Kelly sizing.

> analyze will-bitcoin-hit-100k-by-december-31-2027
  Octagon Research Report
  — will-bitcoin-hit-100k-by-december-31-2027
  ────────────────────────────────────────
  Model Probability   81%
  Market Price        69%
  Edge               +12.0%  (very_high confidence)

  Top Drivers
  1. Bitcoin ETF inflows accelerating       impact: high
  2. Halving cycle momentum                 impact: high
  3. Macro risk-on sentiment            impact: moderate

  Kelly Sizing: 14 shares YES at $0.69
  Risk gates: ✓ Kelly ✓ Liquidity ✓ Corr ✓ Concentration ✓ Drawdown
03

Check the contract

Trader Trust scores how clearly a market is defined before you rely on its price.

> trust when-will-bitcoin-hit-100k
  Trader Trust — when-will-bitcoin-hit-100k
  ────────────────────────────────────────
  Overall              84 / 100
  Integrity   (80%)   87   resolution source named, terms unambiguous
  Trade quality (20%) 72   spread 1.0¢ · depth adequate both sides

  6 markets scored in this event
04

Execute

Confirm with one keystroke. Limit price in decimal dollars, side defaults to YES.

> buy will-bitcoin-hit-100k-by-december-31-2027 14 0.69
  Confirm order? 14 shares YES @ $0.69 = $9.66  [y/n] y
  ✓ Order placed: BUY 14 YES @ $0.69
  Order ID: 0x3f2a9c…

  Balance: $487.26 · Exposure: $9.66 · Open positions: 1
Setup in 60 seconds

No clone. No install. Just bunx.

01

Install Bun

Bun ≥ 1.1 is required — the CLI uses bun:sqlite and runs .tsx directly.

curl -fsSL https://bun.com/install | bash
02

Get a Kalshi API key

From kalshi.com — you'll need an API key plus an RSA private key. Use demo mode for paper trading.

03

Optional: Octagon key

An Octagon key unlocks AI edge analysis, semantic search, clusters, and basket construction.

04

Run the CLI

The setup wizard handles the rest — keys land in ~/.kalshi-bot/.env.

bunx kalshi-trading-bot-cli@latest
01

Install Bun

Bun ≥ 1.1 is required — the CLI uses bun:sqlite and runs .tsx directly.

curl -fsSL https://bun.com/install | bash
02

Import your wallet

Fund an account on polymarket.com, then import the key. It stays on your machine — orders are signed locally. Pass an address instead to read balances without trading.

polymarket wallet import <private-key>
03

Optional: Octagon key

An Octagon key unlocks AI edge analysis, related-market discovery, event outcome ladders, and Trader Trust scorecards.

04

Run the CLI

The setup wizard handles the rest — configuration lands in ~/.polymarket-bot/.

bunx polymarket-trading-bot-cli@latest
Command reference Click to expand · what each CLI supports
Core commands, per venue. Flags, arguments, and the per-command differences are in the docs.
Command Kalshi Polymarket
search, search edge ✓ ✓
analyze ✓ ✓
report, trust ✓ ✓
events, catalysts ✓ ✓
similar ✓ ✓
watch, backtest ✓ ✓
themes ✓ —
clusters, peers ✓ —
correlate ✓ —
basket ✓ —
series ✓ —
buy, sell ✓ ✓
wallet — ✓

Octagon computes clustering, correlation, basket construction, and series rollups for Kalshi, so clusters, peers, correlate, basket, series and the editorial themes registry that builds on them are available there. Full reference: Kalshi CLI docs · Polymarket CLI docs.

Install

Try Kalshi now — zero install

No clone, no setup. The wizard prompts you on first launch and writes everything locally to ~/.kalshi-bot/.env.

bunx kalshi-trading-bot-cli@latest
Install

Try Polymarket now — zero install

No clone, no setup. The wizard prompts you on first launch and writes everything locally to ~/.polymarket-bot/.

bunx polymarket-trading-bot-cli@latest
Build your own

Or wire the API into your own stack

Both CLIs run entirely on the public Octagon REST API — search, edge, events, reports. Bring your own runtime.