Polymarket
Kalshi
Opinion
Limitless
Predict.fun
dr-manhattan
Open Source

dr-manhattan

CCXT for prediction markets. Simple, scalable, and easy to extend.

Supported Exchanges

Simple, Unified Interface

Write exchange-agnostic code that works across all prediction markets

example.py
import dr_manhattan

# Initialize any exchange with the same interface
polymarket = dr_manhattan.Polymarket({'timeout': 30})
opinion = dr_manhattan.Opinion({'timeout': 30})
limitless = dr_manhattan.Limitless({'timeout': 30})

# Fetch markets from any platform
markets = polymarket.fetch_markets()

for market in markets:
    print(f"{market.question}: {market.prices}")

Built for Developers

Everything you need to build prediction market applications

Unified Interface

One API to rule them all. Write code once and deploy across Polymarket, Kalshi, Opinion, and Limitless.

WebSocket Support

Real-time market data streaming with built-in WebSocket connections for live orderbook and trade updates.

Strategy Framework

Base class for building trading strategies with order tracking, position management, and event logging.

Easily Extensible

Add new exchanges by implementing abstract methods. Clean architecture makes integration straightforward.

Type Safe

Full type hints throughout the codebase. Catch errors early and enjoy superior IDE autocomplete.

Order Management

Create, cancel, and track orders with standardized error handling across all supported exchanges.

Get Started in Seconds

Install with uv and start building

uv pip install -e git+https://github.com/guzus/dr-manhattan