How to copy trade efficiently a list of wallets on Uniswap.

Henry Tirla
3 min readDec 8, 2023

--

A Comprehensive Guide to Copy Trading Ethereum Wallets on Decentralized Exchanges.

Copy trading on decentralized exchanges (DEX) presents a lucrative opportunity, especially when mirroring transactions from a curated list of high-performing trading wallets. With the growing list of routers interacting with Uniswap router or any other Decentralized exchange implementing an optimal approach becomes essential to avoid inefficiencies and operational challenges.

My initial approach to solving this problem was to scan through transactions interacting with a specific router and filtering the from address from the un-ending list of incoming transactions and capture the transactions only from the wallet address I am interested in. As you can well agree I came to understand this method is sub-optimal giving the following problems that it poses;

  1. Multiple routers, numerous DEX platforms, and the proliferation of Telegram bots made this approach impractical and Oh my God I hope you have a super premium node to pay for all the rpc calls.
  2. The more wallets you will be tracking the more load you will be processing.The need for a premium node to handle RPC calls introduced further complexity and operational costs.
  3. Non-Efficiency: The inefficiency of this method also resulted in delayed or missed transactions due to node overloading.

At this point it’s safe to say this is not the way to go. After painfully going through this approach I did more research and found a more practical and efficient way to copy trade a wallet or list of wallet transaction irrelevant of which routers they use. I could capture buying transaction, approve transaction and sell transactions of these wallets. I did it by filtering Ethereum transactions logs of newly mined blocks.

What are Ethereum Logs?

Ethereum logs refer to the information generated and stored by smart contracts during their execution on the Ethereum blockchain. Logs and events are used synonymously — smart contracts generate logs by firing off events, so logs provide insights into events that occur within the smart contract. Logs are found on transaction receipts.

I invite you to read the following articles if you are not familiar with this to help you grasp in more details what Eth_Logs are the next section of the article will simply focus on my solution

Article1, Article 2 , Article 3

My Solution

The improved solution involved subscribing to newly mined transactions through Alchemy's API using a WebSocket connection. The received transactions were then filtered using a custom logic to detect relevant events, such as buying transactions.

Code Excerpt

As you can see above I was interested only in transfer topic logs. Which I will then filter to check the address is not equal to ETH on line 183 and check in the dst topic address is found in our monitored wallet list on line 186. If this is the case the a Buy transaction is detected. Here is the full Source code.

Conclusion

By adopting this refined approach, copy trading becomes a streamlined and efficient process, mitigating the challenges posed by multiple routers, varying DEX platforms, and the associated complexities. Leveraging Alchemy’s API and Ethereum logs offers a more reliable and real-time method for capturing wallet transactions.

--

--