百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pmxt

> 编程语言
开源

CCXT 适用于预测市场。PMXT 是一个用于在 Polymarket、Kalshi 等平台上交易的统一 API。

2.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

CCXT 适用于预测市场。PMXT 是一个用于在 Polymarket、Kalshi 等平台上交易的统一 API。

# 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.** Hosted unified API for prediction-market data and supported hosted trading — Polymarket, Opinion, and Limitless writes today. Open-source SDKs and a self-host option for venue-native credentials included.

### Supported Exchanges

Polymarket      Polymarket US      Kalshi      Limitless           Baozi      Myriad      Opinion      Metaculus      Smarkets      Hyperliquid      Gemini Titan      SuiBets      Rain      Hunch

[Feature Support & Compliance](core/COMPLIANCE.md). ## 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. - **Hosted API.** Get a key at [pmxt.dev/dashboard](https://pmxt.dev/dashboard), construct a client, trade. PMXT handles custody, signing infrastructure, and on-chain settlement. - **Open source (MIT).** Self-host the local server for full control — your keys, your machine, no PMXT in the loop. See [Self-hosted](#self-hosted). - **Language-agnostic.** Python and TypeScript SDKs today, with HTTP access for any other language. No lock-in to a single ecosystem. - **Drop-in Dome API replacement.** Automatic codemod (`dome-to-pmxt`) for teams migrating after the Polymarket acquisition. - **Unified trading, not just data.** Hosted writes cover Polymarket, Opinion, and Limitless today; self-host for venue-native writes such as Kalshi where supported. - **[MCP-native](https://pmxt.dev/mcp).** Use pmxt directly from Claude, Cursor, and other AI agents. ## Installation Ensure that [`Node.js`](https://nodejs.org) (>= 18) is installed and the `node` command is available on your PATH. The Python SDK requires Python >= 3.8. ### Python ```bash pip install pmxt ``` ### Node.js ```bash npm install pmxtjs ``` ### CLI ```bash npm install -g @pmxt/cli pmxt polymarket markets --query Trump --limit 5 pmxt polymarket fetchMarkets --query Trump --limit 5 pmxt auth status ``` ### Running from Source ```bash git clone https://github.com/pmxt-dev/pmxt.git cd pmxt npm install npm run dev ``` ### 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 for DomeAPI's Polymarket/Kalshi workflows and also exposes PMXT's broader supported venue catalog where current capabilities exist. 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 Get your API key at [pmxt.dev/dashboard](https://pmxt.dev/dashboard). For reads, only `pmxt_api_key` and `wallet_address` are required. For trading, also pass `private_key` — the SDK auto-wraps it into an EIP-712 signer. ### Python ``` … ``` ### TypeScript > **Import style:** Use named imports such as `import { Polymarket } from "pmxtjs"` for direct classes, or `import pmxt from "pmxtjs"` for the namespaced form. ``` … ``` ### Prediction market hierarchy 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"*) ## Trading pmxt supports unified trading where venues expose writes. Hosted trading is the default for supported hosted venues; self-host when you need raw venue credentials or another venue's write API. ### Hosted trading (recommended) With a PMXT API key, you only need your wallet address and a private key to sign orders. PMXT handles custody, signer infrastructure, and on-chain settlement. ``` … ``` ### Self-hosted trading (advanced) Use this when you self-host the local server. See [Self-hosted](#self-hosted) for setup. You provide venue credentials directly — no `pmxt_api_key` required. For detailed credential setup instructions, see the exchange-specific guides: [Polymarket](core/docs/SETUP_POLYMARKET.md), [Kalshi](core/docs/SETUP_KALSHI.md), [Limitless](core/docs/SETUP_LIMITLESS.md). #### Polymarket ```python import os import pmxt 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 import os import pmxt exchange = pmxt.Kalshi( api_key=os.getenv('KALSHI_API_KEY'), private_key=os.getenv('KALSHI_PRIVATE_KEY') # RSA Private Key ) ``` #### Limitless ```python import os import pmxt exchange = pmxt.Limitless( api_key=os.getenv('LIMITLESS_API_KEY'), private_key=os.getenv('LIMITLESS_PRIVATE_KEY') # For order signing (EIP-712) ) ``` ## Self-hosted To self-host pmxt-core on your own machine: `pip install pmxt-core` (Python) or `npm install pmxt-core` (Node.js), then construct any venue client without `pmxt_api_key`. The SDK spawns a local PMXT service; you supply venue credentials directly. See the [self-hosted guide](https://pmxt.dev/docs/guides/self-hosted) for details. ## 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

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptalgotradingarbitrageccxtkalshi

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言