2

i want to listen to transactions from pools like raydium or orca and get buy or sell amounts and holder address but im confused about the limitation of the rpc , i don't want to use paid rpc even if i buy one it still cannot handle that number of transaction im trying to monitor a big number of hot pairs here's my current code but its not efficient at all for me :

const { Connection, clusterApiUrl, PublicKey, LAMPORTS_PER_SOL } = require('@solana/web3.js')

const connection = new Connection('https://api.mainnet-beta.solana.com/', { commitment: 'confirmed' })
const transactionConnection = new Connection('https://api.mainnet-beta.solana.com/', { commitment: 'confirmed' })
const programId = new PublicKey('tokenprogramid')
async function fn2(signature){


  const transaction = await transactionConnection.getParsedTransaction(signature, {commitment:'confirmed' , maxSupportedTransactionVersion:0})
  if (!transaction ){return false}
// other code to parse amounts 
  }

connection.onProgramAccountChange(programId, async (logs) => {
  fn2(logs.signature);
} , 'confirmed');



3
  • 1
    Does solana.stackexchange.com/questions/9052/… answer your question?
    – Jon C
    Commented Feb 23 at 22:54
  • i tried to log them before , but i could not find any of the amounts just gas fees used to procced the transaction , i could get the signature from it and get the transaction but its not possible since the limitation of the rpc Commented Feb 24 at 12:20
  • 1
    Ah gotcha, in that case, you may want to look into setting up your own node and using geyser plugins: docs.solanalabs.com/validator/geyser that way you get all the info right away
    – Jon C
    Commented Feb 26 at 13:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.