Skip to main content
Alpha — This endpoint is part of the Prediction Markets API, currently in early access. May change without notice.

Endpoint Details

  • URL: wss://pm-api-prod-eu.mobula.io
  • Event Type: pm-market-details
This stream is the live counterpart to the /pm/market/details REST endpoint. Each push carries the current absolute values of the market-level stats block — subscribers can merge straight into the snapshot they fetched at page load. Updates are throttled to 1 per second per market server-side.

Subscription Format

{
  "event": "pm-market-details",
  "data": {
    "platform": "polymarket",
    "marketId": "0x1234..."
  }
}

Parameters

platform
string
required
Platform name (e.g., polymarket).
marketId
string
required
The platform-specific market identifier (Polymarket condition ID).
subscriptionId
string
Custom subscription ID for tracking. Auto-generated if not provided.

Subscription Confirmation

{
  "event": "subscribed",
  "type": "pm-market-details",
  "subscriptionId": "abc-789",
  "platform": "polymarket",
  "marketId": "0x1234..."
}

Real-Time Updates

Each tick is a flat object whose mutable fields mirror the stats block of the REST response:
{
  "event": "pm-market-details",
  "subscriptionId": "abc-789",
  "platform": "polymarket",
  "marketId": "0x1234...",
  "totalVolumeUSD": 30215.42,
  "volume24hUSD": 30215.42,
  "liquidityUSD": 10984.13,
  "tradesCount": 2241,
  "trades24h": 2241,
  "tradesPerMinute": 38,
  "lastTradeAt": 1747569612400,
  "timestamp": 1747569612480
}

Response Field Definitions

FieldTypeDescription
eventstringAlways pm-market-details
subscriptionIdstringYour subscription tracking ID
platformstringPlatform name
marketIdstringMarket identifier
totalVolumeUSDnumberAll-time traded volume, in USD
volume24hUSDnumberVolume traded over the last 24 hours, in USD
liquidityUSDnumberSum of notional book depth across all outcomes (Σ price × size on bids + asks)
tradesCountnumberAll-time trade count
trades24hnumberTrades in the last 24 hours
tradesPerMinutenumberTrade count over the last 60 seconds (momentum indicator)
lastTradeAtnumber | nullTimestamp of the most recent trade (ms epoch), or null if no trade observed since the ingress pod started
timestampnumberServer timestamp when this update was emitted (ms epoch)

Update cadence

  • Triggered on: every executed trade, every book snapshot
  • Server-side throttle: at most 1 message per second per market
  • Cold markets: the first push only happens once the market’s REST snapshot is in cache — hit /pm/market/details once at subscribe time to warm it instantly, or wait up to a few seconds.

Unsubscribe

{
  "event": "unsubscribe",
  "data": {
    "subscriptionId": "abc-789"
  }
}

Integration Example

const ws = new WebSocket('wss://pm-api-prod-eu.mobula.io');

// Warm the REST cache so the first WS push fires immediately.
fetch('https://pm-api-prod-eu.mobula.io/api/2/pm/market/details?platform=polymarket&marketId=0x1234...');

ws.onopen = () => {
  ws.send(JSON.stringify({
    event: 'pm-market-details',
    data: { platform: 'polymarket', marketId: '0x1234...' }
  }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.event === 'subscribed' && msg.type === 'pm-market-details') {
    console.log('Subscribed:', msg.subscriptionId);
  }

  if (msg.event === 'pm-market-details') {
    const { volume24hUSD, liquidityUSD, tradesPerMinute } = msg;
    console.log(`24h vol $${volume24hUSD.toFixed(0)} | liquidity $${liquidityUSD.toFixed(0)} | ${tradesPerMinute} trades/min`);
  }
};

Ping / Pong Keepalive

Send { "event": "ping" } to receive { "event": "pong" }. The server also responds to WebSocket protocol-level pings — most client libraries handle these automatically.