Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7950

Trouble Tracking Raydium Pool Changes for External Accounts with onProgramAccountChange

$
0
0

I'm setting up a listener to track changes in Raydium pools using onProgramAccountChange on Solana. My goal is to detect when certain external accounts interact with or initialize Raydium liquidity pools. However, it seems like the updates aren’t being captured as expected when these accounts perform specific actions, like creating or updating a pool.

Here’s a simplified version of the subscription code:

private async subscribeToRaydiumPools(config: { quoteToken: Token }) {  const filters = [    { dataSize: LIQUIDITY_STATE_LAYOUT_V4.span },    {      memcmp: {        offset: LIQUIDITY_STATE_LAYOUT_V4.offsetOf('quoteMint'),        bytes: config.quoteToken.mint.toBase58(),      },    },    // Additional filters…  ];  const raydiumSubscription = this.connection.onProgramAccountChange(    MAINNET_PROGRAM_ID.AmmV4,    async (updatedAccountInfo) => {      this.emit('pool', updatedAccountInfo);    },    this.connection.commitment,    filters  );  return raydiumSubscription;}

The intention here is to track not only liquidity pools on Raydium, but also when specific accounts interact with Raydium to create liquidity pools. For example, in some cases, external programs like Pump Fun or bonding curve mechanisms interact with Raydium to create or modify pools, yet this code doesn’t seem to capture those interactions. Similarly, I’d like to track interactions on token creation or liquidity pool pages, specifically to capture the pool keys associated with those actions.

Is there a way to modify this setup to capture these events more reliably, similar to how we’d capture direct Raydium events?


Viewing all articles
Browse latest Browse all 7950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>