Stream Pump AMM Data with Helius - Enhanced WebSocket
Learn how to stream live Pump AMM data from Solana using Enhanced WebSocket with Helius.
Enhanced WebSocket
Why choose Enhanced WebSocket – fast JSON streams with decoded accounts and transactions. No custom network stack is required.
Available on Business and higher plans.
How it works – connect to the Atlas endpoint, subscribe to Pump AMM transactions, and listen for updates. The sample retries five times with exponential back‑off.
Requirements
- Node.js ≥ 18 (tested with v20)
- TypeScript ≥ 5 if you plan to run the
.ts
samples withts‑node
- A Helius Business Plan or higher
- An environment variable named
HELIUS_API_KEY
that stores your API key
Install dependencies globally: npm i -g typescript ts‑node
Implementation
Install Dependencies
Create the WebSocket Client
Create a file named enhanced-ws-pump.ts
with the following code:
Set Environment Variables
Add your Helius API key as an environment variable:
Replace your-helius-api-key
with your actual Helius API key from the dashboard.
Run the Application
Execute the script to start streaming Pump AMM data:
You will see parsed Pump AMM transactions in your terminal. The client retries automatically when the socket closes.
Key benefits
- Browser-compatible - The WebSocket protocol works in both Node.js and browser environments
- Rich data - Get fully parsed transaction objects with decoded instructions and accounts
- Simple implementation - No special libraries required beyond a standard WebSocket client
- Auto-reconnect - Built-in retry logic ensures a stable connection
Common issues and solutions
Next steps
Create a UI Dashboard
Build a web interface to visualize incoming Pump AMM transactions in real-time using React or Vue.js.
Implement Database Storage
Store transaction data in a database like MongoDB or PostgreSQL for historical analysis:
Set Up Alerting System
Configure alerts for high-value transactions or specific patterns using a service like Discord webhooks:
Implement Heartbeat Monitoring
Add a more robust heartbeat system to ensure continuous connectivity: