Kalshi-Claw  by Kirubel125

LLM-powered prediction market trading and hedging

Created 3 days ago

New!

563 stars

Top 57.1% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a sophisticated command-line tool, Kalshi-Claw, for interacting with Kalshi prediction markets. It enables users to browse markets, execute trades with RSA-signed limit orders, track positions with live P&L, and discover hedging opportunities using LLM-powered analysis. The tool is designed for technically savvy users interested in advanced prediction market strategies and risk management.

How It Works

Kalshi-Claw employs a hybrid architecture combining Rust for performance-critical operations and TypeScript for higher-level logic. The Rust core, compiled into a native Node.js addon via napi-rs, handles RSA-2048 signing, orderbook parsing, contract count computation, and Kelly criterion-based position sizing. The TypeScript layer manages asynchronous API clients for Kalshi and OpenRouter (for LLM integration), local position storage, and the command-line interface with ANSI terminal UI elements. Hedge discovery uniquely uses LLM-powered contrapositive logic to identify logically necessary covering portfolios, assigning coverage tiers (T1-T3) based on confidence.

Quick Start & Requirements

Installation is macOS-only via a single command that downloads and executes an installer script. The installer automatically checks for and installs prerequisites: Xcode Command Line Tools, Homebrew, Rust toolchain, and Node.js 20+. Users must configure environment variables, including KALSHI_API_KEY, KALSHI_PRIVATE_KEY (RSA PEM format), and optionally OPENROUTER_API_KEY for hedge scanning. API keys can be obtained from Kalshi and OpenRouter.

Highlighted Details

  • LLM-powered hedge discovery utilizing contrapositive logic for robust hedging strategies.
  • Kelly criterion implementation for calculating optimal contract counts and sizing trades.
  • Secure, RSA-signed limit orders submitted via the Kalshi REST API.
  • Real-time position tracking with P&L displayed in the terminal.
  • Comprehensive market browsing, searching, and detailed orderbook views.

Maintenance & Community

No specific details regarding maintainers, community channels (like Discord or Slack), or project roadmap are provided in the README.

Licensing & Compatibility

The project is licensed under the MIT license, permitting broad use and modification. It is explicitly designed for macOS.

Limitations & Caveats

The installation process is limited to macOS. The software is provided "as-is" for educational and experimental purposes and is not financial advice; trading involves risk. Users must ensure their RSA private key is in the correct PKCS#1 PEM format. Hedge scan effectiveness may depend on the chosen LLM model and query specificity.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
682 stars in the last 3 days

Explore Similar Projects

Feedback? Help us improve.