https://github.com/pmxt-dev/pmxt
CCXT for prediction markets. PMXT is a unified API for trading on Polymarket, Kalshi, and more.
https://github.com/pmxt-dev/pmxt
algotrading arbitrage ccxt kalshi market-data polymarket prediction-markets unified-api
Last synced: 10 days ago
JSON representation
CCXT for prediction markets. PMXT is a unified API for trading on Polymarket, Kalshi, and more.
- Host: GitHub
- URL: https://github.com/pmxt-dev/pmxt
- Owner: pmxt-dev
- License: mit
- Created: 2026-01-08T20:24:39.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-04-26T19:31:33.000Z (about 1 month ago)
- Last Synced: 2026-04-26T21:28:46.443Z (about 1 month ago)
- Topics: algotrading, arbitrage, ccxt, kalshi, market-data, polymarket, prediction-markets, unified-api
- Language: TypeScript
- Homepage: https://pmxt.dev
- Size: 4.9 MB
- Stars: 1,612
- Watchers: 17
- Forks: 181
- Open Issues: 11
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: docs/security.mdx
- Roadmap: ROADMAP.md
Awesome Lists containing this project
- awesome-openclaw-money-maker - **pmxt** - Unified API for trading across prediction markets (Polymarket, Kalshi, etc.). (Prediction Markets / Polymarket Tools)
- awesome-systematic-trading - pmxt - A JavaScript / Python prediction markets trading API with support for major exchanges. (The ccxt for prediction markets) (Broker APIs / Crypto)
- awesome-quant - pmxt - The CCXT for prediction markets. A unified API for trading on Polymarket, Kalshi, and more. (Python / Numerical Libraries & Data Structures)
README
# pmxt [](https://twitter.com/intent/tweet?text=The%20ccxt%20for%20prediction%20markets.&url=https://github.com/pmxt-dev/pmxt&hashtags=predictionmarkets,trading) [](https://doi.org/10.5281/zenodo.19111315)
**The [ccxt](https://github.com/ccxt/ccxt) for prediction markets.** A unified API for accessing prediction market data across multiple exchanges.

## Why pmxt?
Different prediction market platforms have different APIs, data formats, and conventions. pmxt provides a single, consistent interface to work with all of them.
### Supported Exchanges
Polymarket
Polymarket US 🇺🇸
Kalshi
Limitless
Myriad
Opinion
Metaculus
Smarkets
[Feature Support & Compliance](core/COMPLIANCE.md).
## Installation
Ensure that [`Node.js`](https://nodejs.org) is installed and the `node` command is available on your PATH.
### Python
```bash
pip install pmxt
```
### Node.js
```bash
npm install pmxtjs
```
### MCP (for AI agents)
```bash
npx -y @pmxt/mcp
```
See [@pmxt/mcp](https://github.com/pmxt-dev/pmxt-mcp) for setup with Claude, Cursor, and other MCP-compatible clients.
## Migrating from Dome API
If you're currently using **Dome API**, pmxt is a drop-in replacement with a unified interface for Polymarket and Kalshi.
Check out [pmxt as a Dome API alternative](https://pmxt.dev/dome-api-alternative) for a detailed migration guide, API comparison, and automatic codemod tool (`dome-to-pmxt`) to help you transition your code.
```bash
# Automatically migrate your codebase
npx dome-to-pmxt ./src
```
## Quickstart
Prediction markets are structured in a hierarchy to group related information.
* **Event**: The broad topic (e.g., *"Who will Trump nominate as Fed Chair?"*)
* **Market**: A specific tradeable question (e.g., *"Will Trump nominate Kevin Warsh as the next Fed Chair?"*)
* **Outcome**: The actual share you buy (e.g., *"Yes"* or *"No"*)
### Python
```python
import pmxt
api = pmxt.Exchange()
# 1. Search for the broad Event
events = api.fetch_events(query='Who will Trump nominate as Fed Chair?')
fed_event = events[0]
# 2. Find the specific Market within that event
warsh = fed_event.markets.match('Kevin Warsh')
print(f"Price: {warsh.yes.price}")
```
### TypeScript
```typescript
import pmxt from 'pmxtjs';
const api = new pmxt.Exchange();
// 1. Search for the broad Event
const events = await api.fetchEvents({ query: 'Who will Trump nominate as Fed Chair?' });
const fedEvent = events[0];
// 2. Find the specific Market within that event
const warsh = fedEvent.markets.match('Kevin Warsh');
console.log(`Price: ${warsh.yes?.price}`);
```
## Trading
pmxt supports unified trading across exchanges.
### Setup
To trade, you must provide your private credentials during initialization.
#### Polymarket
```python
exchange = pmxt.Polymarket(
private_key=os.getenv('POLYMARKET_PRIVATE_KEY'),
proxy_address=os.getenv('POLYMARKET_PROXY_ADDRESS'), # Optional: For proxy trading
signature_type='gnosis-safe' # Default
)
```
#### Kalshi
```python
exchange = pmxt.Kalshi(
api_key=os.getenv('KALSHI_API_KEY'),
private_key=os.getenv('KALSHI_PRIVATE_KEY') # RSA Private Key
)
```
#### Limitless
```python
exchange = pmxt.Limitless(
api_key=os.getenv('LIMITLESS_API_KEY'),
private_key=os.getenv('LIMITLESS_PRIVATE_KEY') # For order signing (EIP-712)
)
```
### Trading Example (Python)
```python
import pmxt
import os
# Initialize with credentials (e.g., Polymarket)
exchange = pmxt.Polymarket(
private_key=os.getenv('POLYMARKET_PRIVATE_KEY'),
proxy_address=os.getenv('POLYMARKET_PROXY_ADDRESS')
)
# 1. Check Balance
balance = exchange.fetch_balance()
print(f"Available balance: {balance[0].available}")
# 2. Fetch markets
markets = exchange.fetch_markets(query='Trump')
# 3. Place an Order (using outcome shorthand)
order = exchange.create_order(
outcome=markets[0].yes,
side='buy',
type='limit',
price=0.33,
amount=100
)
print(f"Order Status: {order.status}")
```
## Documentation
See the [API Reference](https://www.pmxt.dev/docs) for detailed documentation and more examples.
## Examples
Check out the directory for more use cases:
[TypeScript](https://github.com/pmxt-dev/pmxt/tree/main/sdks/typescript/examples) [Python](https://github.com/pmxt-dev/pmxt/tree/main/sdks/python/examples)
## Sponsors
[](https://github.com/pmxt-dev/pmxt/stargazers)