I've had a problem for a few days trying to get access to new pools as quickly as possible. I've tried to take data from mainnet.json on raydim but it works once a minute and it's very slow compared to photon. I've also tried using connection.onLogs() this function takes logs from the raydium address and looks for logs from initialize2. The problem with method 2 is that not all tokens get and there is a long delay. My question is: Is there a better method or is this a problem with my rpc which is not as fast as photon's. Can someone help?
connection.onLogs( programAddress, ({ logs, err, signature }) => { if (err) return; if (logs && logs.some(log => log.includes("initialize2"))) { console.log("Signature for 'initialize2':", signature); fetchRaydiumAccounts(signature, connection); } },"finalized");