Skip to content

Instantly share code, notes, and snippets.

@gayleQN
Created May 28, 2025 20:28
Show Gist options
  • Select an option

  • Save gayleQN/4df69ee5457a50f23d0555d4caf87a33 to your computer and use it in GitHub Desktop.

Select an option

Save gayleQN/4df69ee5457a50f23d0555d4caf87a33 to your computer and use it in GitHub Desktop.
Pump.fun new token created! QuickNode Streams filter code example for Solana
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;
}
@gayleQN
Copy link
Author

gayleQN commented May 28, 2025

Visit https://dashboard.quicknode.com/streams/new to create your stream

Dataset: Block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment