Skip to content
Alchemy Logo

Solana Subscription API Endpoints

List of Solana PubSub WebSocket subscription methods, grouped by category.

Solana exposes a PubSub WebSocket API alongside its standard HTTP JSON-RPC. Each subscription opens a long-lived stream that pushes notifications when on-chain state changes (account data, program-owned accounts, transaction logs, signature status, slots, blocks, votes, and roots).

Connect to the PubSub endpoint using your Alchemy WebSocket URL:

wss://solana-mainnet.g.alchemy.com/v2/<-- ALCHEMY APP API KEY -->

Solana uses native *Subscribe / *Unsubscribe methods instead of eth_subscribe. Each *Subscribe call returns a numeric subscription id which you pass to the matching *Unsubscribe to cancel the stream.

Solana PubSub uses JSON-RPC 2.0 over a persistent WebSocket connection.

FieldTypeDescription
jsonrpcstringJSON-RPC version. Set this to "2.0".
idstring | number | nullClient-supplied request identifier. The server echoes it in the subscribe response.
methodstringPubSub method name, such as accountSubscribe or slotSubscribe.
paramsarrayOrdered method parameters. Use an empty array when the method takes no parameters.

Many subscription methods accept an optional commitment parameter. Subscriptions that accept commitment default to finalized when unspecified.

After a subscribe request succeeds, the server returns a numeric subscription id in the JSON-RPC response. Later notifications are pushed as JSON-RPC messages with a method-specific notification name and the active subscription id.

FieldTypeDescription
jsonrpcstringJSON-RPC version.
methodstringNotification name, such as accountNotification or slotNotification.
params.resultanyMethod-specific notification payload. Many methods include a context object and a method-specific value.
params.subscriptionnumberSubscription id returned by the corresponding *Subscribe method.

MethodDescription
accountSubscribeSubscribe to notifications when one account's lamports or data change.
programSubscribeSubscribe to notifications for accounts owned by a program.

MethodDescription
logsSubscribeSubscribe to transaction log messages that match a log filter.
signatureSubscribeSubscribe to status notifications for one transaction signature.

MethodDescription
rootSubscribeSubscribe to notifications when the validator sets a new root slot.
slotSubscribeSubscribe to notifications when the validator processes a new slot.

Solana WebSocket subscriptions on Alchemy are billed by bandwidth — pro-rated to the exact byte. See Compute Unit Costs for the per-byte CU rate and PAYG pricing.

Broad streams can produce very high bandwidth, especially programSubscribe without filters. To keep usage predictable:

  • Prefer the most specific stream and scope with mentions / mentionsAccountOrProgram / dataSize / memcmp filters.
  • Keep payloads small (e.g. encoding: "base64", transactionDetails: "signatures").
  • Set usage limits and usage alerts before running high-volume streams in production.

Check the Chains page for details about product and chain support!

Was this page helpful?