Unified Market API
Parsecular provides a unified API that aggregates markets across all exchanges with normalized fields. The/api/v1/markets endpoint can fetch from multiple exchanges in parallel:
UnifiedMarket objects with:
- Normalized prices (0.0-1.0 decimal format)
- Consistent status values (
open,closed,resolved,upcoming,paused) - Global IDs (
{exchange}:{id})
The Exchange Trait
TheExchange trait is the core abstraction in Parsecular. It defines a consistent interface that all prediction market platforms must implement, allowing you to write code that works across multiple exchanges.
Supported Exchanges
Polymarket
Decentralized prediction market on Polygon. Supports WebSocket orderbook streaming.
Limitless
Decentralized prediction market with WebSocket support.
Kalshi
CFTC-regulated prediction market for US users.
Opinion
Prediction market with multi-sig wallet support.
Predict.fun
Prediction market platform with API key authentication.
Exchange Capabilities
Each exchange has different capabilities. Usedescribe() to check what features are available:
Feature Matrix
| Feature | Polymarket | Limitless | Kalshi | Opinion | Predict.fun |
|---|---|---|---|---|---|
fetch_markets | Yes | Yes | Yes | Yes | Yes |
fetch_market | Yes | Yes | Yes | Yes | Yes |
fetch_markets_by_slug | Yes | No | No | No | No |
create_order | Yes | Yes | Yes | Yes | Yes |
cancel_order | Yes | Yes | Yes | Yes | Yes |
fetch_order | Yes | Yes | Yes | Yes | Yes |
fetch_open_orders | Yes | Yes | Yes | Yes | Yes |
fetch_positions | Yes | Yes | Yes | Yes | Yes |
fetch_balance | Yes | Yes | Yes | Yes | Yes |
| WebSocket | Yes | Yes | No | No | No |
Exchange Factory
Parsecular provides utilities for working with exchanges programmatically:Base Configuration
All exchanges share a common base configuration:Default Values
| Setting | Default Value |
|---|---|
timeout | 30 seconds |
rate_limit_per_second | 10 |
max_retries | 3 |
retry_delay | 1 second |
verbose | false |
Dynamic Exchange Usage
You can use exchanges polymorphically through trait objects:Error Handling
All exchange operations returnResult<T, ParsecError>. See the Error Handling section for details.