How to fetch newly created pairs/pools on Solana Raydium Dex with solana-py

Henry Tirla
2 min readJan 14, 2024

Everything in solana is an account and understanding how these accounts interact with each other is key in understanding how solana token accounts interact with each other. In this case we will be focus on transactions involving Raydium Liquidity Pool V4 mint address: 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8.

Using LogSubscribe rpc node connection we will be looking for the initialize2 instruction emitted by raydim dex during the creation of pools for new token and found in each transaction instruction list.

Expected Output

Here is my full solution

To Elaborate more on my solution. I am simply listening to all transanction involving Raydium Pool V4 Address decoding these transactions and searching through the logs if the word initialize 2 is found, if yes then I am certain this is a Pool created transaction hash because it’s only found in created pools log.

How efficient is this method is something to debate about because unlike EVM compatible chains there are no logs implemented on Solana that permits you to listen to certain types of transactions without explicitly deconding the transaction hash. Another approach I found onchain is some addresses will track metaplex for newly created token and serum program id for newly created markets. How efficient is one method over the other I can’t tell and if you are snipping new pools then you should consider different approaches and gauge timeline to evaluate which one is more efficient.

Snipping NEW Pools

If you are reading this article you are probably interested in snipping new pools in solana. Due to the high competion of snipers I strongly suggest bundling your buy with Jito at least this guarantees your transaction will be added on-chain, though it does not determine when, and this is a huge hold back for me when it comes to solana the inability to have that sense of control on the time periods of my transactions on-chain. In my future articles I will be talking about different models of snipping on solana and which ones are efficient for fast execution.

Happy Coding Happy Snipping WAGMI !!!

--

--