Research conducted and written by Ari Juels, Lorenz Breidenbach, and Florian Tramèr of Chainlink Labs
As Ethereum’s popularity continues to increase thanks to tokenization, then DEXes, and now DeFi, we’re seeing unprecedented, consistently high gas prices for users of the network. While this is a mark of Ethereum’s tremendous success, it unfortunately means higher transaction costs and longer mining latencies for users. As transactions languish in the mempool, another undesirable side effect occurs: Transactions become more vulnerable to front-running.
Even when gas prices are low, as users’ transactions pass through the mempool, savvy traders and bots get a sneak peek at them before they are mined. Sophisticated players of this kind can profit from this form of advance intelligence by strategically generating their own transactions. By then paying a higher gas price than the transactions they exploit, they can ensure that their own transactions are processed first.
This problem isn’t hypothetical. A recent study by Daian et al. (including authors of this blog) documented millions of dollars of such activity per year in just a subset of DeFi contracts.
Frontrunning gains today are almost certainly higher than the Daian et al. paper indicates. And given that most trading activity happens in centralized exchanges, where frontrunning by operators and potentially others is possible, what that study found may be just the tip of the tip of the tip of the iceberg. Wall Streeters have known for many years how lucrative the ability to front-run trades can be, and firms regularly sell their clients’ orders to high-frequency traders. The example below illustrates the issue as it can affect smart contracts today.Ordering problems in DeFi and beyond
DeFi contract operators want fairness and transparency for their customers. They often include countermeasures to front-running, such as gas caps. But these are not fo...