pmxt
v0.1.0
Published
A unified API for prediction market exchanges
Maintainers
Readme
PMXT - Prediction Market Exchange Trading Library
A unified API for prediction market exchanges, similar to CCXT.
Features
- Unified API across multiple prediction market exchanges
- TypeScript support with full type definitions
- Common interfaces for markets, orders, positions, and trades
- Extensible architecture for adding new exchanges
Supported Exchanges
- Polymarket (in progress)
Installation
npm install pmxtpnpm add pmxtUsage
import { createExchange } from 'pmxt';
// Create an exchange instance
const exchange = createExchange('polymarket', {
apiKey: 'your-api-key',
secret: 'your-secret',
});
// Fetch markets
const markets = await exchange.fetchMarkets();
// Fetch ticker
const ticker = await exchange.fetchTicker('YES/NO');
// Create an order
const order = await exchange.createOrder({
marketId: 'market-id',
symbol: 'YES/NO',
type: 'limit',
side: 'buy',
amount: 10,
price: 0.5,
});
// Fetch positions
const positions = await exchange.fetchPositions();Architecture
src/base/- Base Exchange class and interfacessrc/exchanges/- Exchange implementationssrc/types/- TypeScript type definitionssrc/errors.ts- Custom error classes
Development
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run watchLicense
GNU GPLv3
