Skip to main content

Autonomous Kalshi BTC prediction market trader — MCP server for Claude Code

Project description

sentient-trader-mcp

Autonomous Kalshi BTC prediction market trader — MCP server for Claude Code

Give Claude Code full authority to analyze Kalshi BTC options markets and place real trades on your behalf. The engine uses a Markov chain momentum signal with empirically-tuned gates (timing, vol regime, Hurst exponent, price cap) to identify high-probability entries.

Backtest (30 days, $200 start): +397% return · 82% win rate · 5% max drawdown


Install

pip install sentient-trader-mcp

Configure

Create ~/.sentient-trader/config.env:

KALSHI_API_KEY=your-kalshi-api-key-id
KALSHI_PRIVATE_KEY_PATH=~/.kalshi/private_key.pem

Or set environment variables directly.

You need a Kalshi account with API access and an RSA key pair.
Generate keys in Kalshi → Settings → API.

Register with Claude Code

claude mcp add -s user sentient-trader -- python -m sentient_trader_mcp

Use it

Open Claude Code and type /trade — Claude will:

  1. Check the active KXBTC15M market
  2. Run the full Markov signal
  3. Place a real order if all gates pass
  4. Report balance and P&L

Or ask directly:

  • "What's the current market signal?"
  • "Check my Kalshi balance"
  • "Show my open positions"

Tools

Tool Description
get_market Current active KXBTC15M market — strike, BTC price, minutes left
analyze_signal Full Markov signal — recommendation, position size, all gate results
place_trade Place a real Kalshi limit order ⚠
get_balance Account balance
get_positions Open positions + resting orders
cancel_order Cancel a resting order
kelly_size Calculate Kelly-optimal position size

The Signal

Markov chain momentum — a 9-state model of 5-min BTC price changes. Chapman-Kolmogorov propagation over T steps gives P(BTC above strike at expiry).

Gates (all must pass to trade):

  • Markov gap ≥ 11pp from 50% — model must be ≥61% confident
  • Markov persistence ≥ 82% — momentum state must be self-reinforcing
  • Garman-Klass vol ≤ 1.25× reference — skip chaotic windows
  • Hurst exponent ≥ 0.50 — trending regime only, not mean-reverting
  • Timing: 6–9 min (standard) or 3–12 min (65–73¢ golden zone)
  • Entry price ≤ 72¢ — above this the market is efficiently priced

Kelly sizing (tiered by price zone):

  • 65–73¢: 35% Kelly · 73–79¢: 12% Kelly · 79–85¢: 8% Kelly

Blocked UTC hours: 11:00 and 18:00 (empirically -40pp to -57pp margin)


Overridable Parameters

Set via environment variables:

MARKOV_MIN_GAP=0.11
MIN_PERSIST=0.82
MAX_ENTRY_PRICE=72
MAX_VOL_MULT=1.25
MIN_HURST=0.50

Disclaimer

This places real orders with real money on a regulated prediction market exchange. Use at your own risk. Nothing here is financial advice. Start with analyze_signal in read-only mode before enabling live trading.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sentient_trader_mcp-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentient_trader_mcp-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file sentient_trader_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: sentient_trader_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sentient_trader_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a00e0a2942cf58300914e6fb8e5ce5704b0bec8570d2a27a6a000834d51a5855
MD5 85c948b962974b908b1c648fbd62fcfc
BLAKE2b-256 456e4ac4cedfbe4d4d71eaaa8b6817f6224385cfc7871923f7aa90bcdd569e59

See more details on using hashes here.

File details

Details for the file sentient_trader_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sentient_trader_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d043e1a361dea94033dc5a2e9e0f8b894febd35210fa5e1675514ed88db067b0
MD5 c90eae8df52c8b5d123c76c460c7a8a0
BLAKE2b-256 26eaf51cad57745d591bcdfc16a4690e0553a90dea4e6484f9d827b325fde160

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page