0

I can find all my transaction records through the wallet address, and I can get the hash of the transaction records, but I want to know how much tokenA I paid and how much tokenB I got for each swap transaction. How can I know this? Suppose it is in Raydium DEX.

Is there a third-party API that can get this information? Or parse it directly through the code? I use Nodejs.

In fact, I want to know through the code when I spent how many sol (or how many dollars), how many tokenB I bought, and when I spent how much tokenA I exchanged for how many sol (or how many dollars).

1 Answer 1

0

You can simply use the getTransaction endpoint on the standard RPC node for each transaction signature that you've fetched, and then look at the "pre" and "post" balances for your accounts.

More information about getTransaction at https://solana.com/docs/rpc/http/gettransaction

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.