Skip to article
relayOpen console
Streaming
On this page

Streaming

Streaming

Connect to live Solana data with WebSockets, Yellowstone gRPC, or Preprocessed transactions.

Choose your connection

Open Streaming in your console for your purchased limits and endpoint settings. Each product requires an active paid period, positive allowances, and an enabled service. Your Relay key works across the products included in your plan.

ProductNetworkService setting
Standard WebSocketsMainnetEnabled
Enhanced WebSocketsMainnetEnabled
Yellowstone gRPCMainnetEnabled
Yellowstone gRPCDevnetEnabled
Preprocessed transactionsMainnetEnabled

An enabled service still requires the corresponding purchased allowance. Streaming uses its own paths alongside your HTTP RPC endpoint. Shreds, upstream data add-ons, Webhooks, and Sender are not included.

Standard Solana WebSockets

Connect with your Relay key, then send JSON-RPC requests with an ID. The standard account, block, logs, program, root, signature, slot, slotsUpdates, and vote subscription families are supported.

WebSocket connection
wss://relayrpc.top/ws?api-key=YOUR_RELAY_KEY
Subscribe to slot updates
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "slotSubscribe"
}

Subscription IDs belong to their connection. Pending subscriptions count toward the limit. Per-connection subscriptions are capped at 1,000 and otherwise equal your purchased subscriptions divided by connections, rounded down. Close or unsubscribe when the data is no longer needed.

Enhanced transaction subscriptions

Plans with enhanced WebSocket access can use transactionSubscribe and transactionUnsubscribe on the same endpoint. They share your WebSocket connection, subscription, and credit limits. This is the Relay interface to Helius LaserStream WSS transaction updates.

Watch transactions involving an account
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "transactionSubscribe",
  "params": [
    {
      "vote": false,
      "failed": false,
      "accountInclude": [
        "So11111111111111111111111111111111111111112"
      ]
    },
    {
      "commitment": "confirmed",
      "encoding": "base64",
      "transactionDetails": "full",
      "maxSupportedTransactionVersion": 0
    }
  ]
}
FieldAccepted values
Filter: vote, failedBoolean
Filter: signatureA transaction signature
Filter: accountInclude, accountExclude, accountRequiredPublic-key arrays; at most 1,000 addresses combined
Filter: tokenAccountsnone, balanceChanged, all
Options: commitmentprocessed, confirmed, finalized
Options: encodingbase58, base64, jsonParsed
Options: transactionDetailsfull, accounts, signatures, none
Options: showRewardsBoolean
Options: maxSupportedTransactionVersionNonnegative integer; required for full or accounts details

Set the supported transaction version to what your decoder handles. Unsubscribe with transactionUnsubscribe and params: [subscriptionId]. Relay does not add omitted decoding options for you.

Yellowstone gRPC on Mainnet or Devnet

The native gRPC endpoint exposes /geyser.Geyser/Subscribe, a bidirectional stream of SubscribeRequest and SubscribeUpdate. Use TLS / HTTP2 and authenticate with your Relay key in x-token metadata.

Mainnet connection settings
Endpoint: relayrpc.top:443
Transport: TLS / HTTP2
x-token: YOUR_RELAY_KEY
Method: /geyser.Geyser/Subscribe
Devnet metadata on the same endpoint
x-token: YOUR_RELAY_KEY
x-relay-network: devnet

Omit x-relay-network for Mainnet, or explicitly use mainnet-beta. Devnet access must be included in the purchased plan. Both networks share the same stream count, filter limits, and credit allowance; Devnet is not unmetered.

Each active Subscribe call counts as one stream, even when calls share a TCP connection. Per-stream filters are capped at 64 and otherwise equal purchased filters divided by streams, rounded down. Other Geyser methods are not exposed. Keep 64-bit slots lossless in your client.

Preprocessed transaction feed

Preprocessed access uses a dedicated Mainnet WebSocket route. After connecting, send one subscription with an object of account filters. Include at least one accountInclude or accountRequired address; accountExclude is optional. The combined limit is 1,000 addresses.

Preprocessed connection
wss://relayrpc.top/preprocessed?api-key=YOUR_RELAY_KEY
Subscribe once per connection
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "preprocessedSubscribe",
  "params": {
    "accountInclude": [
      "So11111111111111111111111111111111111111112"
    ]
  }
}

The subscription returns a JSON acknowledgement, followed by binary transaction frames. Each frame contains a one-byte format version (1), an eight-byte little-endian slot, a 64-byte signature, and the remaining signed transaction bytes. Preserve the slot as an integer with 64-bit precision.

One subscription is allowed per connection. Filters are fixed for that connection; close it and open another to change them. There is no unsubscribe method on this route.

Credits, reservations, and reconnects

ProductRecorded chargeInitial reservation
Standard and enhanced WebSockets1 connection credit + 2 credits per started 100,000 uncompressed upstream application bytes337 credits
gRPC, either network2 credits per started 100,000 observed upstream payload bytes1,344 credits
Preprocessed0.1 credit per received binary transaction message, rounded cumulatively up to a whole credit per connection200 credits

For example, 1–10 Preprocessed transaction messages cost 1 credit, and 11–20 cost 2. There is no opening charge for Preprocessed or gRPC. WebSocket and gRPC byte charges also round cumulatively within each session.

Reservations cover upcoming usage and are separate from recorded spending. A verified gRPC cancellation charges received bytes; a verified Preprocessed cancellation charges received transaction messages. Once the stream has stopped and its final counters are verified, the unused customer reservation is released. If a stream is interrupted or expires without verified final counters, its reservation remains awaiting confirmation. Provider accounting is tracked separately and does not change a finalized customer charge. All these products share your plan’s credits. See credit balance definitions.

Implement bounded reconnects in your client. Subscription IDs do not survive reconnection. Relay does not promise historical replay, gap-free delivery, or exactly-once notifications.

Search documentation

Find what you need

Search article headings, methods, and explanations.