Skip to main content
DexBuilder provides real-time Event Contracts data through the WebSocket Broker. Public market-data channels do not require authentication.

Connection

Event Contracts:
For Event Contracts, use the separate product connection:
The examples below use the Event Contracts channel prefix pred. Event Contracts uses the corresponding ec prefix.

Subscribe to a Public Channel

A subscription request contains a request timestamp t, a client id, an operation, a channel, and channel-specific items.
The server acknowledges the request and then sends channel data. Public channels require items; all: true is reserved for private channels.

Public Channels

Response Envelope

Channels with cached state can send type: "snapshot" before subsequent update messages. Order-book snapshots contain full bids and asks arrays; they are not deltas.

CPI Example

Subscribe to a crypto reference price:
Example update:

Connection Recovery

When a connection is interrupted:
  1. reconnect with backoff;
  2. restore public subscriptions;
  3. use REST endpoints such as /api/v4/event_contracts/markets and /api/v4/event_contracts/tokens/{token_id}/ticker to refresh authoritative state;
  4. deduplicate repeated updates using the channel key and timestamp.
See WebSocket Protocol, Public Channels, and WebSocket Authentication for the complete protocol.