0

Using the Etherscan api (or bscscan in this case, but same idea) for a specific hash, you get a value based on the token that is being used. In cases of coin swaps, only one of the coins is acquired, nut through the inputs to the contract function you can approximately get the swapped token value.

For example: for hash 0x202b5d9ed02686cbd320309b717c8ebcfcb9ec3f6570eef6be030d30881a5365, it's clear that there is a swap between BNB and QUACK (Sold 1.376*E12 QUACK for 12.8 BNB), but on the API I get only the value for of 1376750580763876621600 (which are the QUACK tokens sold if you divide by 10^9), but not the number of BNB tokens of the swap that were acquired.

Using the input data, it's clear that the amountIn is 1564489296322587070000 and amountOutMin is 12500197080184471193, so theoretically minimum acquired BNB is 12.5, but is there a way to get the final swapped value, which is 12.8 BNB?

Any help/support is highly appreciated!

Xouzoura
  • 1
  • 1

0 Answers0