Use case: detecting new pool creation on Raydium
One practical application of program activity tracking is detecting new liquidity pools the moment they are created. Pool creation events often precede significant price action, making real-time detection valuable for traders and analytics platforms.
const RAYDIUM_AMM = new PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8");
const INITIALIZE2_DISCRIMINATOR = Buffer.from([175, 175, 109, 31, 13, 152, 155, 237]);
connection.onLogs(RAYDIUM_AMM, async (logInfo) => {
if (logInfo.err) return;
const tx = await connection.getTransaction(logInfo.signature, {
maxSupportedTransactionVersion: 0,
});
if (!tx) return;
const accountKeys = tx.transaction.message.getAccountKeys();
for (const ix of tx.transaction.message.compiledInstructions) {
const programId = accountKeys.get(ix.programIdIndex)?.toBase58();
if (programId !== RAYDIUM_AMM.toBase58()) continue;
const data = Buffer.from(ix.data);
if (data.subarray(0, 8).equals(INITIALIZE2_DISCRIMINATOR)) {
console.log("New Raydium pool detected!", logInfo.signature);
// Extract pool accounts from ix.accountKeyIndexes
}
}
}, "confirmed");
Use case: monitoring DeFi protocol activity
Tracking program activity is essential for monitoring DeFi protocol health. You can watch for specific instructions like liquidations, large deposits, or governance votes.
// Monitor a lending protocol for liquidation events
const LENDING_PROGRAM = new PublicKey("LENDING_PROGRAM_ID");
connection.onLogs(LENDING_PROGRAM, (logInfo) => {
if (logInfo.err) return;
for (const log of logInfo.logs) {
// Anchor programs log events with a specific format
if (log.includes("LiquidateObligationEvent")) {
console.log("Liquidation detected:", logInfo.signature);
// Fetch full tx for details: borrower, collateral, debt amount
}
if (log.includes("DepositReserveLiquidity")) {
// Track large deposits for whale monitoring
console.log("Deposit event:", logInfo.signature);
}
}
}, "confirmed");
For production monitoring at scale, log subscriptions over WebSocket will not keep up with high-throughput programs. Use gRPC streaming to get transaction-level filtering with backpressure handling and guaranteed delivery.
Tools for exploring program activity
Several tools in the Solana ecosystem make it easier to inspect and track program activity without writing custom code:
Helius provides enhanced transaction APIs that return pre-parsed instruction data, account changes, and token transfers in a single call. Their webhook system can notify you when specific programs are invoked, removing the need to maintain your own WebSocket connections.
SolanaFM offers an explorer with deep instruction-level decoding. It automatically resolves IDLs for known programs and displays decoded instruction arguments alongside the raw data. Useful for manual investigation and understanding unfamiliar programs.
Solscan provides a program analytics dashboard showing instruction frequency, unique callers, and activity trends over time. Their API includes endpoints for fetching all transactions involving a specific program with pagination support.
Triton operates Yellowstone gRPC infrastructure that supports program-level transaction filtering at the validator level. This is the most performant option for real-time program monitoring, as data is filtered before it reaches your application.
Performance considerations
When tracking high-activity programs (DEX routers, token programs), you will encounter significant data volumes. A few strategies to keep your monitoring system stable:
- Filter at the source: Use gRPC program filters or Helius webhooks rather than fetching all transactions and filtering client-side
- Batch RPC calls: When fetching full transactions for decoded instructions, use
getMultipleTransactions or batch JSON-RPC requests
- Cache IDLs: Fetch program IDLs once and cache them locally. IDLs rarely change and fetching them per-transaction wastes RPC credits
- Handle version 0 transactions: Always pass
maxSupportedTransactionVersion: 0 when fetching transactions -- legacy calls will miss transactions that use address lookup tables
FAQ
How do I track Solana program activity without running my own node?
You do not need a validator or full node. RPC providers like Helius and Triton offer WebSocket log subscriptions and gRPC streaming that let you monitor any program in real-time. For lower-volume use cases, the logsSubscribe RPC method on any reliable endpoint is sufficient. For high-throughput programs, gRPC streaming with Yellowstone filters gives you validator-level performance without operating infrastructure.
What is the difference between program logs and inner instructions?
Program logs are text messages emitted by programs during execution using the msg! or emit! macros. They are human-readable (or base64-encoded structured data) and useful for detecting events. Inner instructions are the actual CPI calls a program makes to other programs -- they contain the full instruction data, accounts, and program ID. Logs tell you what happened; inner instructions tell you how programs interacted with each other.
Can I decode instructions for programs that do not use Anchor?
Yes, but it requires more work. Non-Anchor programs use custom serialization formats for their instruction data. You need the program source code or documentation to understand the byte layout. Some programs publish their own IDL-like specifications. Tools like SolanaFM maintain a database of known instruction decoders for popular programs, which can save you from writing custom parsing logic.
How do I track activity across multiple programs at once?
For monitoring several programs simultaneously, gRPC streaming is the most efficient approach. Yellowstone gRPC supports multiple program filters in a single subscription, so you can watch DEX programs, lending protocols, and token programs in one connection. Alternatively, Helius webhooks let you configure multiple program-based triggers that all push to a single endpoint. Avoid opening separate WebSocket connections per program -- that approach does not scale past a handful of programs.
For teams that want this same filtering running inside the validator itself rather than over gRPC or WebSocket, our guide to building a custom Yellowstone Geyser plugin covers implementing the update_account and notify_transaction callbacks directly.
This guide covers techniques current as of April 2026. Program interfaces and IDL formats may change as the Solana ecosystem evolves. Always refer to official program documentation for the latest instruction layouts.