Given a transaction on Uniswap,

enter image description here

how to find out what pair is being swapped, and the amount of it? Namely, via web3.js/ethers.js

Is there relevant and sufficient information in the fields of a transction? Or will one have to make additional calls?

1 Answer 1


You need to decode the transaction input using UniswapV2Router abi. Look at this part of ethers' documentation: https://docs.ethers.io/v5/api/utils/abi/interface/. Especially at the parseTransaction method.

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.