Avoiding MEV with your transactions

MEV (short for Maximum Extractable Value) is the maximum profit that blockchain miners and validators can make by including, excluding or changing the order of transactions in a block.

When it comes to activity in DeFi Saver and the broader decentralised finance space, any transactions that include token swaps can be vulnerable to MEV attacks.

This is because token swaps don't have a pre-programed, definite outcome. For example, compared to borrowing 50 USDC from a lending protocol that will always result in you receiving exactly 50 USDC, any swaps you execute will only include certain limiting factors, such as the slippage limit that controls the lowest amount you could receive from the swap.

Numerous MEV bots will look for transactions in the mempool which would allow them to profit from manipulating the pools that are meant to be used in the swap included in the transaction, thus resulting in your swaps only receiving the minimum amount set by your slippage limit, instead of the estimated and expected amounts.

What types of transactions at DeFi Saver are vulnerable to MEV attacks?

This would be all transactions that include a swap within, such as: Boosts, Repays, leveraged create, leveraged close (aka self-liquidation), as well as collateral and debt swaps.

How to avoid MEV attacks and prevent losses?

Using TxSaver

For all Safe smart wallet users, we introduced TxSaver. This tool lets you simply sign the wanted transaction and let TxSaver handle the transaction submission while keeping it safe from MEV attacks.

You can read about TxSaver in detail in our Knowledge Base article dedicated to it.

If you currently have a position on a DSProxy, you can consider migrating it to a Safe to gain access to TxSaver.

Setting a private RPC in your wallet

For DSProxy users, the best option would be to configure a MEV-preventing RPC in your wallet that you can temporarily switch to when submitting transactions.

The most popular options and one's we usually recommend are:

Using these, your transactions will be privately submitted directly to block builders, allowing your transactions to be executed before any bots can realize if there's any value they can potentially extract.

Note that these RPCs may not be ideal for everyday use and transactions could potentially be harder to track. If you face such issues, consider using these RPCs only when needed (i.e. only at the moment of submitting your transaction), while switching to regular RPCs for regular apps use and transactions that don't include swaps.

Our DFS Automation bots already use MEV preventing RPCs whenever possible.


  • TxSaver

  • Efficient and risk-free transactions

Last updated