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.

    EVTstream lifecycle

    Same connection, distinguished by "type": "stream". Carries package provenance so clients can route on their own.

    Examples
    [
      {
        "type": "stream",
        "status": "started",
        "network": "solana",
        "package_name": "svm_dex",
        "package_version": "v0.5.1",
        "module_hash": "bd388f2e…"
      },
      {
        "type": "stream",
        "status": "completed",
        "network": "solana",
        "module_hash": "bd388f2e…"
      },
      {
        "type": "stream",
        "status": "error",
        "network": "solana",
        "message": "upstream deadline exceeded"
      },
      {
        "type": "stream",
        "status": "fatal",
        "network": "solana",
        "message": "module panic"
      },
      {
        "type": "stream",
        "status": "undo",
        "network": "solana",
        "last_valid_block": 350000000
      },
      {
        "type": "stream",
        "status": "gap",
        "network": "solana",
        "requested_block": 100,
        "oldest_buffered_block": 500,
        "reason": "requested block outside replay window"
      }
    ]

    Fields

    typestring

    Always "stream".

    statusstring

    One of the lifecycle states below.

    networkstring

    Chain the event refers to.

    package_name, package_version, module_hashstring

    spkg provenance — delivered to every client so you can route on your own.

    messagestring

    Upstream error text. Present on error / fatal.

    last_valid_blocknumber

    Present on undo — roll back any state materialized past this block.

    requested_block, oldest_buffered_block, reasonmixed

    Present on gap when from_timestamp falls outside the replay window.

    Status values

    started

    The server began reading this source.

    completed

    The source reached its configured stop block.

    error

    Recoverable upstream error — see message; the server retries.

    fatal

    Unrecoverable — the source stopped. Surface message and reconnect with ?from_timestamp= to resume.

    undo

    Chain reorganization — roll back state past last_valid_block.

    gap

    Requested replay point is older than the retained window; the stream continues live — backfill the hole via Substreams gRPC.