Intro We have 2 tokens in our project and 3 liquidity pools ( "token1-ETH", "token2-ETH" & "token1-token2"). Token1 has ~5% of fees and includes reflection. Token2 allows users to acquire Token1 for half the fee (compared to direct buy using ETH).

Issue Immediately after launch, we are observing 2 (or so I think) kinds of MEV bots actively attacking our tokens. One of them is a sandwich MEV bot that is wrapping buy and sell around large trades. This one is a nuisance but generates more reflection and not as dangerous. The other one is draining the liquidity pool. It makes huge number of transaction within a single block and is somehow draining the ETH from Token2-ETH liquidity.

Any suggestion on what we can do to protect our users from these MEV bots?

Is there a way to detect MEV bot in solidity contract? Any suggestions on how we can tax the MEV bot higher or block or throttle the number of transaction within a block.

Any help would be greatly appreciated.

I did not share particular details about the contract to avoid making these contracts public and inviting more attacks. I can share these details if required. I have the transaction hashes of these attacks.

2 Answers 2


Sorry, there's not way to analyze block contents in Solidity, or to detect a MEV transaction.

You basically jut have to analyze what they do and how they do it, and then either accept it or try to come up with some countermeasures. But in my opinion MEV is a 'natural' part of the ecosystem and all projects should be prepared for having MEV amongst their token pools.

And, in my opinion, you shouldn't try to add MEV protections to your tokens themselves anyway. That's a losing battle, since it's a lot harder for you to modify your contracts than for the MEV drainers to find a new pattern. Tokens should be really simply and old include minimum logic.

  • In our case, this bot seems to be drain the liquidity pool. The danger is that one of the coin may fail. It's somehow able to make large amount of ETH transaction of buy and sell and extract some of the ETH on the LP, I am unable to understand how they do it. But after a buy/sell the price of the token tanks by 50% or so.
    – Ra Murd
    Feb 26 at 0:29


You should try this MEVBLOCKER.

From the homepage:

  1. Add the RPC endpoint directly to your wallet
  2. Enjoy full, automatic protection from all types of MEV
  3. Get paid by searchers for your transactions

MEV Blocker is a tool that helps Ethereum users avoid the financial losses that can result from MEV attacks while also allowing them to profit from the same mechanisms that are used to exploit them.

Always be careful when using tools like this. This tool seems legit but some research is always recommended.

  • 1
    please edit to describe what this does and how it solves the problem in the question post.
    – starball
    Apr 16 at 20:01
  • Those RPC could protect a wallet, but they won't protect a smart contract. The protection would be at best partial.
    – Ismael
    Apr 17 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.