How it Works
- Connect to the Enhanced WebSocket endpoint
- Subscribe to Pump AMM program and listen for transactions
- The code example retries five times with an exponential back‑off
Requirements
- Node.js ≥ 18 (tested with v20)
- TypeScript ≥ 5 if you plan to run the
.tssamples withts‑node - A Helius Business Plan or higher
- An environment variable named
HELIUS_API_KEYthat stores your API key
Implementation
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.If you don’t have an API key, sign up for an account, or have your agent create one programmatically with the Helius CLI.Key benefits
- Browser-compatible - WSS works in both Node.js and browser environments
- Rich data - fully parsed transaction objects with decoded instructions and accounts
- Simple implementation - No special libraries required (just a standard WSS client)
- Auto-reconnect - Built-in retry logic ensures a stable connection
Common issues and solutions
401 Unauthorized
401 Unauthorized
No logs received
No logs received
Ensure the Pump AMM program address is correct and there is activity.
Connection dropping
Connection dropping
Implement more robust reconnection logic or check network stability.
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: