Created
May 28, 2025 20:28
-
-
Save gayleQN/4df69ee5457a50f23d0555d4caf87a33 to your computer and use it in GitHub Desktop.
Pump.fun new token created! QuickNode Streams filter code example for Solana
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function main(stream) { | |
| const PUMP_FUN_PROGRAM = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; | |
| const matches = []; | |
| for (const block of stream.data) { | |
| for (const tx of block.transactions) { | |
| if (!tx.meta || tx.meta.err) continue; | |
| // Check if any inner instruction invokes pump.fun | |
| const invokedPump = (tx.meta.innerInstructions || []).some(ix => | |
| (ix.instructions || []).some(i => i.programId === PUMP_FUN_PROGRAM) | |
| ); | |
| // Optional: confirm it's a Create instruction from logs | |
| const isCreateLog = tx.meta.logMessages?.some(msg => | |
| msg.includes("Instruction: Create") | |
| ); | |
| if (invokedPump && isCreateLog) { | |
| matches.push({ | |
| signature: tx.transaction.signatures[0], | |
| blockTime: block.blockTime, | |
| mint: tx.meta.postTokenBalances?.[0]?.mint, | |
| amount: tx.meta.postTokenBalances?.[0]?.uiTokenAmount.uiAmountString, | |
| logMessages: tx.meta.logMessages | |
| }); | |
| } | |
| } | |
| } | |
| return matches.length ? matches : null; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Visit https://dashboard.quicknode.com/streams/new to create your stream
Dataset: Block