CODE - https://github.com/web3yurii/detoxer
DECK - https://docs.google.com/presentation/d/16recVigZBdYaYNwmzYI4cIYsjRycBFh4Xn4_6Clkr7I/edit?usp=sharing
VIDEO - https://www.youtube.com/watch?v=eJUWp7XjE0k
In decentralized exchanges like Uniswap, MEV (Miner Extractable Value) attacks - particularly sandwich attacks - pose a significant threat to regular users. These attacks exploit the ordering of transactions within a block, enabling sophisticated actors to front-run and back-run trades for profit at the expense of others.
Detoxer is inspired by new flexibility of Uniswap V4 - hooks. It introduces a set of hooks that aim to dynamically increase swap fees for attackers while lowering or maintaining fair fees for victims and honest users. The goal is to make malicious strategies economically unviable - taxing MEV bots while shielding the average trader.
Detoxer is a unique, fully on-chain approach to MEV resistance using Uniswap v4 hooks. Unlike other solutions that rely on async swaps, off-chain data, or external coordination, Detoxer enforces protection at the pool level by dynamically adjusting fees based on user behavior.
The biggest challenge was backtesting the hooks effectively. Designing the hooks was relatively straightforward, but validating their impact required building a full simulation pipeline using real historical swap data. Most of the development time went into processing events, labeling attackers/victims, and running repeatable tests across thousands of transactions to tune fee logic and measure real outcomes.
Add new features:
Improve backtesting: