Advanced MEV strategies: LP sandwich and reverse LP sandwich attacks
MEV issues often extend beyond trading since liquidity providers (LPs) also encounter both positive and negative impacts from sandwich attacks in liquidity pools.
Some DeFi platforms might experience just-in-time (JIT) liquidity attacks, also known as LP sandwich arbitrage attacks. These types of attack, categorized as maximal extractable value (MEV) strategies, particularly target high-value tokens, especially within pools employing concentrated liquidity models.
What are pools with concentrated liquidity?
"Concentrated liquidity" enables providers to concentrate their funds within specific price ranges of a token's trading pair. Unlike traditional liquidity provision models where funds are spread evenly across all pricing points, this method allows LPs to allocate their tokens in a price range they believe will be most profitable. This approach is employed by such DeFi platforms as Balancer, Trader Joe's or Uniswap V3.
LP sandwich vs. traditional sandwich attacks and arbitrage
LP sandwich arbitrage is similar to front-running and back-running attacks, the difference being that here arbitrageurs benefit from liquidity provision rather than trading. Attackers identify large swaps in AMM pools, instantly add liquidity before the swap at the precise price point of the upcoming transaction and withdraw it after the swap. In doing so, they accrue transaction fees and profit from price impacts. This strategy can benefit the transaction initiator since the added liquidity minimizes their price impact. However, for existing liquidity providers, this type of MEV strategy can reduce revenues and potentially impact the TVL of the entire liquidity pool, reducing organic trading volumes.
To mitigate this risk, DeFi platforms can adopt preventive measures like a mandatory wait period between liquidity transactions or other practices.
For LP sandwich attacks to be successful, the profit must exceed the associated gas expenses. Hence, transactions in this type of MEV are notably larger than the average user's transaction and require significant capital, which goes beyond traditional arbitrage involving flash loans.
Main features of reverse LP sandwich attacks
Reverse LP sandwich attacks use the same front-running and back-running tactics as LP sandwich attacks, but differ in a number of nuances, such as their effect on LPs.
In contrast to the average LP sandwich attack, which can be potentially advantageous for both the attacker and the liquidity provider, the reverse LP sandwich attack solely benefits the attacker. It leaves the liquidity provider with losses, making them provide liquidity at a less favorable rate. In a typical scenario, an attacker identifies an LP who's about to add liquidity to a pool and makes a swap that changes the ratio of assets in the pool. Due to the attacker's interference, the LP ends up adding more of one asset than planned. Consequently, the LP is tricked into providing liquidity at an unfavorable rate. The attacker subsequently benefits from a swap at the distorted ratio created by the LP's deposit. The profit margin, which is the variance between the assets the attacker initially swapped and their earnings after the counter-swap, is pocketed by the attacker, disadvantaging the LP.
Appropriately adjusted slippage tolerance could theoretically prevent such attacks. However, this strategy is often successfully performed due to LPs setting high slippage tolerance limits or no limits altogether.
MEV strategies, including LP sandwich arbitrage and its reverse variations, are also driving the evolution of pooling models and protective measures for liquidity providers. Addressing these challenges is essential for DeFi's further expansion and sustainability.