Endpoint Details
- URL:
wss://pm-api-prod-eu.mobula.io - Event Type:
pm-market-trade
Subscription Format
Subscribe to real-time trade events for a prediction market:Parameters
Platform name (e.g.,
polymarket).The platform-specific market identifier.
Mobula API key. Also accepts
apiKey as alias.Custom subscription ID for tracking. Auto-generated if not provided.
Subscription Confirmation
After subscribing, you’ll receive a confirmation message:Real-Time Updates
Trade events are pushed as they occur on the CLOB. Each message is a flat object with all fields at the top level:Response Field Definitions
| Field | Type | Description |
|---|---|---|
event | string | Always pm-market-trade for trade events |
subscriptionId | string | Your subscription tracking ID |
platform | string | Platform name |
marketId | string | Market identifier |
id | string | Unique trade identifier |
outcomeId | string | Outcome token ID that was traded |
type | string | Trade type: buy or sell |
priceUSD | number | Execution price (0 to 1) |
sizeToken | number | Trade size in outcome tokens |
amountUSD | number | Trade value in USD |
date | number | Trade timestamp in milliseconds |
Unsubscribe
To stop receiving updates, send:Integration Example
Ping / Pong Keepalive
Application-level keepalive: Send{ "event": "ping" } and receive { "event": "pong" }. Use this when you need explicit control over keepalive timing.
ping frames. Most WebSocket libraries handle these automatically. If no response is received within 30 seconds, the server closes the connection.
Requires an active API key with Growth or Enterprise plan. See Authentication for details.