Sandwiches

What is a Sandwich Attack?

Sandwich attacks are one of the most harmful types of MEV exploitation. They work by manipulating the slippage of a user's transaction to maximize profits at the expense of the user.

How Sandwich Attacks Work

  1. Slippage Setting: When a user sets a slippage tolerance for a transaction, it defines the maximum acceptable deviation from the expected price. For example, if you want to swap 1 ETH for 3000 USDC and set the slippage to 10%, you are willing to accept a minimum of 2700 USDC for your 1 ETH.

  2. Exploiting Slippage: Sandwich bots take advantage of this slippage tolerance. In this scenario, a bot will strategically place two transactions around the user's transaction:

    • Buy Order Before: The bot places a buy order just before the user's transaction, causing the price to increase.

    • Sell Order After: The bot then places a sell order immediately after the user's transaction, selling at the higher price created by the user's trade.

  3. Maximizing Slippage: This sequence forces the user's transaction to execute at the maximum slippage tolerance, here reducing the received USDC from 3000 to 2700, allowing the bot to pocket the $300 difference.

Mitigation with Merkle Private Pool

The Merkle Private Pool protects users from sandwich attacks by keeping transactions private until they are included in a block. This prevents bots from seeing and targeting your transactions, safeguarding against the harmful effects of sandwich attacks.

Benefits of Using Merkle Private Pool

  • Transaction Privacy: Keep your transactions hidden from public view until they are mined, preventing bots from exploiting slippage settings.

  • Slippage Protection: Ensure you receive the expected value from your transactions without losing out to sandwich bots.

  • Secure Trading Environment: Conduct transactions in a secure environment free from predatory practices like sandwich attacks.

Last updated