$ show pmxt-dev/pmxt
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.
The LLM identified 5 files worth highlighting for reuse:
Defines the ErrorMapper base class that is extended by each exchange to translate venue-specific errors into a unified set of error types. This pattern is isolated, extensible, and can be reused in any multi-API project to provide consistent error handling.
Implements a token bucket rate limiter with configurable capacity, fill rate, and queue depth control. It is self-contained, dependency-free, and can be extracted into any project needing API rate limiting or resource throttling.
Contains a BorshReader class for deserializing Solana on-chain account data into JavaScript objects. This is a non-obvious, self-contained utility for parsing Borsh-encoded binary data, reusable across any Solana program integration.
Provides a simple seeded pseudo-random number generator for creating deterministic mock data. Although small, the pattern is clean and reusable for any project that needs reproducible random data in tests or simulations.
Implements the Router class that aggregates multiple exchanges, merges order books, and provides market matching, price comparison, arbitrage detection, and hedging. The mergeOrderBooks and mergeLevels utilities are self-contained functions that can be reused in any project needing to combine order book data from multiple sources.