Decompiling and Understanding Frontrunners

Eli Barbieri
2 min readAug 20, 2021

When a new user joins the Ethereum Ecosystem, they typically begin by transferring some ETH to a MetaMask wallet, and making a trade on Uniswap. But most users do not realize that their transactions are being gamed by a large network of highly profitable bots. And while most DEFI users are aware of the frontrunning crisis, few understand how they game the system, and how much value they drain from average users. Over the next few months, I will attempt to understand this issue, share my thoughts, struggles, and process, and propose a decentralized solution that can help to mitigate this problem, and hopefully encourage new conversations, and open new lines of inquiry.

While it is very easy to see the red pirate listed on the Dextools transaction history, it is difficult to calculate the profits these frontrunners generate. By decompiling the main method of the frontrunner, and querying its transaction history and input data, I was able to calculate a rough estimate of the activity. The frontrunner I decompiled has been active since December of 2020, and over the course of 1 day, the contract drained 1.8 ETH with 1,342 transactions. ETH is currently valued at over $3,200 USD, which makes the daily profit more than $5,700 USD. This amount projected over a week totals over $40,000 USD, and more than 2 million USD over a 1 year period, all from a single frontrunner.

With over 192,000 transactions at this time, the above frontrunner not only drains value from average DEFI users, but also consumes a substantial amount of Ethereum blockspace, millions of gas, and has a significant environmental impact — and this is merely one frontrunner amongst hundreds. In order to secure the future of the DEFI ecosystem and protect average users, we must find secure, decentralized, and efficient solutions to combat this crisis.

--

--

Eli Barbieri

Ethereum Researcher and Developer. Data Product Tech Lead @Nethermind. Cicero Labs