Using the solana websocket url I'm listening to the solana blockchain logs and then filter those logs based on a certain criteria.
async function main(connection, programAddress) {
console.log("Monitoring logs for program:", programAddress.toString());
connection.onLogs(
programAddress,
({ logs, err, signature }) => {
if (err) return;
if (logs && logs.some((log) => log.includes("BurnChecked"))) {
console.log("Signature for 'Burn':", signature);
// fetchRaydiumAccounts(signature, connection);
}
},
"finalized"
);
}
In the code snippet above, I'm logging out only transactions whose logs includes the word "BurnChecked". While this works, it's not stream lined to lp burns it's generic, I've also tried finding logs that includes "Burn" but's thats even more generic and logs every burn transaction. How can I filter for just lp burns.