Using LaserStream WebSocket
LaserStream WebSocket gives you a simple WebSocket integration and is available on all Helius plans, making it a convenient choice for developers. This example uses Solana’s logsSubscribe method, so you receive log messages only.
How it works
Connect to the LaserStream WebSocket endpoint, subscribe to logs mentioning the Pump AMM program, and process the incoming log data. The example below includes automatic reconnection logic with exponential backoffs.Requirements
- Node.js ≥ 18 (tested with v20)
- TypeScript ≥ 5 if you plan to run the
.tssamples withts‑node - Any Helius plan – works with all plan tiers
- An environment variable named
HELIUS_API_KEYthat stores your API key
Implementation
Install Dependencies
Create the WebSocket Client
standard-ws-pump.ts with the following code:Set Environment Variables
your-helius-api-key with your actual Helius API key from the dashboard.If you don’t have an API key, sign up or have your agent create one programmatically with the Helius CLI.Run the Application
getTransaction with the signature from the log entry.Key benefits
- Universal access - Available on all Helius plans, including free tier
- Lightweight - Minimal data transfer since only logs are streamed, not full transactions
- Easy to implement - Uses standard Solana RPC WebSocket protocol
- Low barrier to entry - Perfect for prototyping and initial monitoring
Getting full transaction details
Since the Standard WebSocket only provides log messages, you’ll need an additional step to get complete transaction data:Common issues and solutions
No logs received
No logs received
Connection dropping
Connection dropping