Substreams WebSockets service — stream decoded blocks, swaps & transfers in real time.
    Read-only preview
    You're browsing the public WebSockets reference. Sign in to open a live stream with your team's API key.

    QuickstartBeta

    Open a WebSocket, subscribe to a network@table stream, and start receiving decoded blocks in real time. Pick a stream below — then drop the URL into wscat, Node, or the browser.

    Endpoint
    WS
    1# npm i -g wscat
    2wscat -c "wss://ws.pinax.network/ws/solana@swaps?token=<YOUR_JWT>"
    No API key loaded — samples show a <YOUR_JWT> placeholder. Open Try it to paste a token and stream live.
    Available streams (loading…)live from GET /streams

    WSSUBSCRIBE

    Add <network>@<table>channels to this connection's subscription set. params is required and accepts wildcards (*@swaps, solana@*) and comma-separated network lists (solana,base@swaps).

    Envelope. Every command is one JSON text frame — { "method", "params", "id" } — and the server replies with exactly one frame: { "result", "id" } on success or { "error": "<message>", "id" } on failure. method is case-sensitive; id is echoed back so you can correlate. Invalid commands return an error reply but never close the socket.

    Request

    Request
    {
      "method": "SUBSCRIBE",
      "params": [
        "solana@swaps",
        "mainnet@erc20_transfers"
      ],
      "id": 1
    }

    Reply

    Reply
    {
      "result": null,
      "id": 1
    }
    • Idempotent. Re-subscribing to a selector you already hold is a no-op.
    • All-or-nothing. A single bad selector rejects the whole command with an error reply — the existing set is unchanged.
    • No snapshot. Only future blocks are delivered; SUBSCRIBE does not replay history.
    • wrap_envelope is fixed at upgrade time and is not affected by SUBSCRIBE — reconnect to change envelope mode.