RPC WebSocket API
Stream real-time Solana data using standard WebSockets.
Introduction
Helius provides a standard Solana WebSocket interface that allows you to receive real-time updates about accounts, programs, transactions, and blockchain state. Our WebSocket implementation follows the standard Solana WebSocket API, making it compatible with existing Solana clients and libraries, while benefiting from Helius’s infrastructure for improved reliability.
Connection Setup
To connect to the Helius WebSocket endpoint, use the following URL format:
Replace YOUR_API_KEY
with your Helius API key. You can also use our other network endpoints:
- Mainnet:
wss://mainnet.helius-rpc.com?api-key=YOUR_API_KEY
- Devnet:
wss://devnet.helius-rpc.com?api-key=YOUR_API_KEY
Subscription Methods
Helius supports all standard Solana WebSocket subscription methods:
Account Subscriptions
Subscribe to changes for a specific account:
Learn more about accountSubscribe
Program Subscriptions
Subscribe to changes for all accounts owned by a program:
Learn more about programSubscribe
Logs Subscriptions
Subscribe to transaction log messages:
Learn more about logsSubscribe
Signature Subscriptions
Subscribe to transaction status updates:
Learn more about signatureSubscribe
Slot Subscriptions
Subscribe to new slots:
Learn more about slotSubscribe
Slot Updates Subscriptions
Subscribe to detailed information about slots:
Learn more about slotsUpdatesSubscribe
Root Subscriptions
Subscribe to new roots (finalized blocks):
Learn more about rootSubscribe
Vote Subscriptions
Subscribe to vote activity:
Learn more about voteSubscribe
Unsubscribing
To stop receiving updates for any subscription:
Replace the number in the params array with your actual subscription ID.
Error Handling
WebSocket errors follow the JSON-RPC 2.0 specification:
Rate Limits
Websockets are subject to rate limits based on your Helius plan. If you exceed these limits, connections may be dropped or throttled. For high-volume applications, consider upgrading to a higher tier plan or using LaserStream for enhanced capabilities.
Enhanced Capabilities with LaserStream
For applications requiring more advanced streaming features, Helius offers LaserStream, which provides:
- Historical replay to catch up on missed data
- Enhanced stability through multi-node aggregation
- Multiple protocol options (gRPC, Enhanced WebSockets)
- Higher throughput and lower latency
Learn more about LaserStream for enterprise-grade data streaming capabilities.