Skip to main content

How Can a Protocol Use Slippage Tolerance Settings to Prevent Front-Running Attacks?

Users set a slippage tolerance (e.g. 0.5%) for their trade.

If the final executed price is worse than the initial price by more than this tolerance, the transaction is automatically reverted. Front-running bots attempt to insert a transaction before the user's to profit from the price change.

By setting a low tolerance, the user ensures that the front-runner's transaction will cause their own to revert, making the attack unprofitable.

What Is a ‘Price Tolerance’ Setting and How Does It Manage Slippage Risk?
How Can an Oracle Be Manipulated in a Price Feed Attack?
How Does a ‘Revert’ Transaction on a DEX Differ from a Simple Cancellation on a CEX?
How Does a Transaction Get Added to the Mempool?