Skip to content
/ pmxt Public

CCXT for prediction markets. A unified API for trading on Polymarket, Kalshi, and more.

License

Notifications You must be signed in to change notification settings

pmxt-dev/pmxt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

383 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

pmxt Tweet

The ccxt for prediction markets. A unified API for accessing prediction market data across multiple exchanges.

NOTE: pmxt is an open-source infrastructure tool. It has no native token, coin, or investment vehicle.

plot

Polymarket Β Β Β Β  Kalshi Β Β Β Β  Manifold Markets Β Β Β Β  Metaculus Β Β Β Β  PredictIt

Discord

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 Β Β Β Β  Kalshi Kalshi Β Β Β Β  Limitless Limitless Β Β Β Β  Probable Β Β Β Β  Baozi Baozi Β Β Β Β  Myriad Myriad

Feature Support & Compliance.

Installation

Ensure that Node.js is installed and the node command is available on your PATH.

Python

pip install pmxt

Node.js

npm install pmxtjs

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

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

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

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

exchange = pmxt.Kalshi(
    api_key=os.getenv('KALSHI_API_KEY'),
    private_key=os.getenv('KALSHI_PRIVATE_KEY') # RSA Private Key
)

Limitless

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)

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 for detailed documentation and more examples.

Examples

Check out the directory for more use cases:

TypeScript Python

Stargazers repo roster for @pmxt-dev/pmxt