Real-time Substreams WebSocket streaming

    Substreams WebSocketBeta

    Stream decoded blocks, swaps, transfers, and any Substreams DatabaseChanges output in real time. Subscribe to one channel or many across SVM, EVM, and TVM with the same URL pattern — and resume where you left off after a disconnect.

    Quickstart
    idle
    Stream
    URL
    Recv 0Blocks 0Events 00.0 blk/s
    Press Connect to start streaming…

    Introduction#

    The Pinax WebSocket service fans out Substreams blocks to many subscribers from a single ingestion path. Every message is JSON; payloads carry decoded DatabaseChanges rows grouped by (network, table). Reorgs are surfaced as explicit undo events.

    Beta. Stream protocol is stable, but channels, payload field-naming and replay window may evolve. Pin a module_hash in production and watch for stream lifecycle fatal messages.

    Endpoint#

    Stream selectors take the form <network>@<table>. Wildcards are accepted on either side.

    WSwss://ws.pinax.network/ws/<network@table>
    URLModeEnvelope
    /ws/<a>Single channelRaw payload
    /ws/<a>/<b>/…Multi channelWrapped
    /stream?streams=<a>/<b>/…Combined, query stringWrapped

    When wrapped, every payload is delivered as { "stream": "<id>", "data": <raw> }. Bare /ws with no streams returns HTTP 400 — use /ws/*@* to explicitly opt into every stream.

    Authentication#

    Authenticate every connection with your project JWT, passed as a ?token= query parameter on the upgrade URL. Browsers can't set headers on a WebSocket upgrade, so the token rides on the URL for every client — browser, Node, Go, anything.

    wss://ws.pinax.network/ws/<network@table>?token=<JWT>

    Grab the JWT from your project's API keys page. Treat it like a password — anyone holding it can open a stream against your quota. Rotate via the dashboard if it leaks.