Stream every Pump.fun account update and transaction in real time using the LaserStream SDK. This page walks through a complete TypeScript script you can run end-to-end: it prints each transaction as it lands, reports rolling stats (throughput, unique fee payers, total fees in SOL) once a minute, and stays connected across reconnects automatically. It’s a useful starting point for anything that needs continuous Pump.fun visibility — trading bots, analytics dashboards, alerting pipelines, or just exploring the data shape so you can build something more specialised on top.Documentation Index
Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites: A Helius API key (Business or Professional plan for Mainnet LaserStream) and Node.js 18+. Familiarity with Account Subscriptions and Transaction Monitoring helps but isn’t required.
Setup
Create a fresh project, install the SDK +bs58 (used to decode transaction signatures), and set your API key:
The script
Save this asindex.ts, then run npx ts-node index.ts:
What the script does
One subscription, two filter blocks
A singlesubscribe(...) call carries two named filter groups:
- The
accountsfilter receives every account owned by the Pump.fun program (bonding curves, mint state, etc.) every time their data changes. - The
transactionsfilter receives every transaction that interacts with the Pump.fun program. Thevote: false, failed: falseflags drop votes and failed transactions before they reach your handler.
Reading the raw fields
A couple of values in the payload need a small conversion before they’re easy to use:tx.signatureis aBuffer. Run it throughbs58.encode(...)to get the base58 signature you’d see in an explorer or in agetTransactionresponse.tx.meta.feeis a u64 stored as a string so values aboveNumber.MAX_SAFE_INTEGERdon’t lose precision in JavaScript. Wrap it inNumber(...)before doing arithmetic. The same string-for-u64 convention applies to several block-level fields too — see Slot & Block Monitoring for the full data shape.
Rolling stats
AsetInterval prints a snapshot every 60 seconds: total transactions, successes versus failures, throughput, unique fee payers, and total fees in SOL. Press Ctrl+C for one last snapshot before the script exits.
Extending the script
A few directions to take this further:- Decode instruction discriminators to label trades as
buy/sell/create— see Decoding Transaction Data for the parsing pattern. - Persist the rolling stats to a database (Postgres, Redis, ClickHouse) instead of in-memory
Set/ counters. - Alert on thresholds — large fee payers, sudden volume spikes, new bonding-curve accounts.
- Replay missed activity on startup by setting
fromSlotonSubscribeRequest(up to 24 hours back — see Historical Replay). - Combine with Slot & Block Monitoring for block-level context.
Next Steps
Transaction Monitoring
The general transaction-filtering patterns this script uses.
Decoding Transaction Data
Parse the binary transaction payload into readable Solana transactions.
Account Subscriptions
Watch specific account state changes with filters.
Historical Replay
Replay up to 24h of past Pump.fun activity from a starting slot.