0

So say I want to copy this transaction: https://etherscan.io/tx/0xf4cf0c28c014dd54bd1453b0a92514111ffce2f5584d47beabbc6db2253597fd

This transaction uses the method "swap tokens for exact tokens". The value on etherscan says '0' even though they spent exactly 0.023452603716565196 Ether for the transaction to buy this specific coin on uniswap.

Because it uses the method "swap tokens for exact tokens", it has thing's like "amountOut" and "amountInMax". The "amountInMax" value is 0.039248390898042606 Ether which is different from the actual amount that was used in this specific transaction.

So what I want to ask is will my bot still be able to copytrade in this case this specific transaction and be able to copy the same amount of Ether used? Like will my bot use 0.023452603716565196 Ether which is the actual amount used, 0.039248390898042606 Ether which is the amountInMax value or nothing?

Or because my bot is scanning the mempool will this transaction when it was still unconfirmed in the mempool just display the actual amount of 0.023452603716565196 Ether used and my bot copies that.

Thanks!

2 Answers 2

0

The input amount 0.02345 was determined from the state of the pool at the moment the transaction was executed.

If the state changes before your transaction is executed then it is likely you won't get the same value. It could be lower or higher, but it will not be higher than the maximum of 0.03924.

2
  • I see, so either way if my bot, detected this transaction in the mempool before it was confirmed and mined into a block then my bot would still be able to copy that same ETH amount of 0.02345 if nothing goes wrong? Basically, it doesn't matter what method is used whether it is "swap token for exact tokens", "swap exact eth for tokens" etc.. the ETH spent is visible on the mempool and can be copied? Correct me if i am wrong thanks.
    – SA22K
    Commented Jan 15, 2023 at 10:55
  • No, while the transactions are in the pending pool they haven't been executed yet, so the real amount isn't final until they are mined into a block. Even in that case a chain reorganization can change the final amount paid.
    – Ismael
    Commented Jan 15, 2023 at 16:23
0

You can listed to wallet transactions using Moralis Streams API. You will receive webhooks whenever a transaction is executed that will contain the transaction data and the logs.

You can get started following this example: https://docs.moralis.io/streams-api/using-node-js-sdk

Let me know if you need any help!

Disclosure: I work at Moralis

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.