PMXT is a unified prediction market SDK that aggregates data and trading across 15+ venues (Polymarket, Kalshi, Limitless, etc.) into a single, consistent interface. The system provides a core TypeScript library with a local sidecar server (Express), plus TypeScript, Python, and CLI SDKs that support both self-hosted and hosted (trade.pmxt.dev) modes. It offers market data (events, order books, trades, OHLCV), WebSocket streaming, order management (create, cancel, fetch), account balance and positions, cross-venue router for event matching and arbitrage, and data feeds (Binance, Chainlink). The architecture is a monorepo with workspaces core, sdks/typescript, sdks/python, sdks/cli, and tools. Each exchange follows a clean fetcher → normalizer → error mapper pattern, and the SDK surfaces are partially generated from the core's method signatures. While primarily an application SDK, the project includes significant data normalization, cross-venue data aggregation, and a router for analytical queries, giving it a hybrid character.
This repository implements a comprehensive backtesting and live-trading framework for prediction markets (specifically Polymarket and Kalshi), built on a heavily customized NautilusTrader engine. It provides historical replay of L2 order book data from multiple vendors (Telonex, PMXT, Polymarket native), realistic execution modeling (fill models, fee models with maker rebate inference), and a library of trading strategies (e.g., EMA crossover, microprice imbalance, late favorite hold). The framework supports parameter search optimization (random grid, TPE via optuna), joint-portfolio multi-market backtests, and generates detailed HTML/CSV/JSON reports with equity curves, drawdown, and Brier advantage analysis. A Rust native extension accelerates data conversion (book diffing, payload sorting), and a CLI TUI (main.py) discovers and runs backtest entrypoints. While primarily an application framework, it also includes numerous one-off research scripts and Jupyter notebooks (e.g., BTC snapshot model walkforward), giving it a hybrid character: a production-quality backtesting infrastructure with a heavy research emphasis. The codebase is well-tested (50+ test files), documented, and follows clean engineering practices (config validation, structured event logging, concurrency patterns). However, it is tightly coupled to NautilusTrader internals, relies on several environment variables, and contains large monolithic loader classes (e.g., Telonex loader at ~3600 lines) that limit reusability outside its specific domain. Maintenance appears active (last commit 2026-05-16) with low technical drift, though the heavy dependency on NautilusTrader and optional Rust build are potential friction points.
This repository implements an automated trading bot for Kalshi prediction markets, leveraging AI models (primarily via OpenRouter) to make directional trading decisions. The system is built as an async Python application with a CLI entry point (`cli.py`), a Streamlit dashboard, and a paper trading mode. It supports multiple strategies: an AI-driven directional strategy using a multi-agent debate pipeline (bull/bear researchers, risk manager, trader), a conservative NO-side safe compounder, market making, and a unified trading system that dynamically allocates capital. The core data flow involves ingesting market data from the Kalshi REST and WebSocket APIs, persisting to SQLite, running AI inference through OpenRouter with fallback chains and cost tracking, executing trades via Kalshi's signed REST API, and monitoring positions with stop-loss/take-profit logic. Risk management is enforced through Kelly criterion position sizing, edge filtering, category scoring, portfolio enforcer, and cash reserves. The codebase also includes performance analysis jobs, a paper trading signal tracker with static HTML dashboard, and a comprehensive test suite. External dependencies include Kalshi API, OpenRouter (with optional xAI and Grok models), SQLite, Streamlit, and various async libraries (httpx, aiohttp, websockets).