Skip to main content
Get your free API key at dashboard.predexon.com - required for WebSocket connections.
Get real-time trade notifications from Polymarket markets. Subscribe to specific wallets, markets, or receive all trades with a Pro plan using the wildcard subscription.

Use Cases

Copytrading

Subscribe to top traders’ wallets and get instant notifications when they make trades to mirror their positions.

Market Monitoring

Track specific markets for price movements and trading activity in real-time.

Portfolio Alerts

Monitor your own wallet or watchlist for trade confirmations and activity.

Analytics & Research

Stream all trades (Pro) to build datasets, analyze market dynamics, and identify trends.

Quick Start

const ws = new WebSocket('wss://wss.predexon.com/v1/your_api_key');

ws.onopen = () => {
  ws.send(JSON.stringify({
    action: 'subscribe',
    platform: 'polymarket',
    version: 1,
    type: 'orders',
    filters: { users: ['0x1234...'] }
  }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type === 'trade') {
    console.log('Trade:', msg.data);
  }
};

Connection

Endpoint

wss://wss.predexon.com/v1/<API_KEY>
Include your API key in the URL path. The server validates the key and returns your plan tier.

Connection Response

On successful connection:
{
  "type": "connected",
  "message": "Connected to Predexon WebSocket"
}

Idle Timeout

Connections with no active subscriptions are closed after 120 seconds. Subscribe to at least one filter to keep the connection alive.

Plans & Limits

FeatureFreePro
Subscriptions2100
Items per subscription5500
Total items1050,000
Wildcard (all trades)NoYes

Wildcard Subscription (Pro only)

Pro users can subscribe to all trades across the entire platform using the wildcard subscription. This is ideal for building comprehensive datasets, real-time analytics dashboards, or monitoring market-wide activity. Wildcard rules:
  • Wildcard must be the only subscription on the connection
  • Wildcard allows only one active connection per API key
  • Cannot add other subscriptions while wildcard is active
Example wildcard subscription:
{
  "action": "subscribe",
  "platform": "polymarket",
  "version": 1,
  "type": "orders",
  "filters": {
    "users": ["*"]
  }
}

Error Handling

All errors follow this format:
{
  "type": "error",
  "code": "ERROR_CODE",
  "message": "Human-readable error message"
}

Error Codes

CodeDescription
INVALID_API_KEYAPI key not found or invalid
INVALID_FILTERSMissing or malformed filters
SUBSCRIPTION_LIMITMaximum subscriptions reached
ITEMS_LIMITMaximum total items reached
ITEMS_PER_SUB_LIMITToo many items in single subscription
WILDCARD_NOT_ALLOWEDWildcard requires Pro plan
WILDCARD_CONNECTION_LIMITWildcard allows only one connection
CONNECTION_LIMITToo many connections for this API key
SUBSCRIPTION_NOT_FOUNDSubscription ID doesn’t exist

Close Codes

CodeReason
1000Normal closure
1001Server shutting down
1006Abnormal closure (network issue)
4000Idle timeout (no subscriptions for 120s)
4001Authentication failed
4002Limit exceeded

Best Practices

Reconnect with backoff

Implement exponential backoff when reconnecting after disconnects

Subscribe quickly

Send your first subscription within 120s to avoid idle timeout

Batch items

Combine multiple items in one subscription when possible

Handle errors gracefully

Check error codes and adjust subscriptions accordingly