Types of MEV in DeFi

Hackless Team
Hackless
Published in
4 min readNov 24, 2022

At Hackless, we’re designing security solutions for DeFi, some of which are powered by MEV. While we see the opportunities that can be used for good causes, there appear to be many actors who make use of MEV for fraudulent activity. We’ve outlined the most common types of attacks for you to be aware of.

| To learn more about Hackless, check out our Twitter page and discover the future of security in DeFi |

Miner/Maximum Extractable Value (MEV) refers to the maximum value that can be extracted by reordering, inserting, or censoring transactions in a block.

How MEV extraction process works

Searchers begin their MEV process by monitoring the blockchain using bots built with complex algorithms and automation tools. When the opportunity arises, they analyze the logic behind the transaction, determine the attack vector, and create a bundle. A bundle refers to multiple transactions collated and executed in the order they are created. Searchers go through this process to guarantee their MEV objective when the block is produced.

After a bundle is created, a searcher will send it to a mine using off-chain networks like Flashbots’s MEV-Geth. This lets searchers skip the public mempool and express their transaction sequencing preferences swiftly and risk-free directly to block producers.

When the block producer includes a searcher’s bundle in their block, the MEV extraction process is complete.

Types of MEV

Currently, DeFi players suffer the economic effects of MEV in more than one form. We’ve described different types of extractions that take place below.

Front-running

This means receiving a transaction ahead of a known, yet unconfirmed transaction in the mempool. Front-running bots monitor large trades entering the mempool and use this knowledge to seize opportunities and be first in the execution queue.

By executing a winning trade first, front-runners benefit at the expense of the original honest trader.

Snipping bots

The term ‘sniping’ has been coined implying that the extractor is the first to buy the tokens when the liquidity pool is added to the DEX.

When a new liquidity pool is created on a decentralized exchange traders can profit if they are the first to buy the new tokens and then sell them to new buyers. It is preferred to buy these tokens in the same block, or next several blocks, as the creation and funding of the liquidity pool.

Back-running

This involves receiving a transaction second in line or right after a known target transaction has been executed. Back-running bots are watching the mempool for new token pair listings or liquidity pools created on DEXes.

When the bot spots a profitable opportunity, it places an order right after the initial one and buys a large number of tokens, leaving a small amount for other traders. Then, the bot waits for the price to spike after other traders have purchased the token and sell at a higher price for a profit.

Sandwich attack

Sandwich attacks include both front-running and back-running tactics. Often, they are applied on decentralized exchanges that use an AMM concept. If played correctly, it results in the price of an asset rising or falling with a single big trade under this strategy.

MEV actors watch a mempool for large transactions and sandwich them — they place two transactions, one before and after the original trader’s transaction.

Time-bandit attacks

In this type of attack, block producers reorder blocks that have been mined in the past to create MEV opportunities, and as a result, earn profits. This form of MEV might appear when block rewards are significantly lower compared to MEV. This incentivizes miners to disrupt the consensus to earn more profits.

Gas golfing

If the gas golfing strategy is applied, it means that the existing functionalities of smart contracts have been optimised to lower the amount of gas involved. As a result, an extractor gets a competitive advantage of setting higher gas prices, while keeping their total gas fees unchanged.

Bottom line

We have provided a brief overview of the most common types of MEV, with the list constantly growing. It’s quite obvious that MEV is negatively affecting the entire user experience in DeFi. Particularly, it results in more expensive transactions, increased price slippage, lost arbitrage opportunities and ultimately, revenue loss.

Hackless is passionate about MEV — not only in the context of addressing and solving associated risks but also to capitalize on opportunities. We’re building DeFi security solutions that will focus on minimizing MEV risks, as well as using MEV tools to offer benefits to users.

Stay with us — become Hackless!

Follow us on social media to receive timely news, and stay tuned:

⚡️ Website

⚡️ Twitter

⚡️ Telegram channel

⚡️ Telegram group

⚡️ LinkedIn

--

--

Hackless Team
Hackless

We are fortifying DeFi security for protocols and individuals. Shielding from hacks 24/7; MEV protection; staked assets rescue.