MEV bots: How do they Work and… Who is Jared?

quadraziD
6 min read
/uploads/mev_bots_0792cdb932.png

MEV bots, short for Maximal Extractable Value bots, are used to identify and execute profitable strategies on Ethereum (mostly) and other blockchains by altering transaction orders within blocks. These bots are powered by advanced algorithms to engage in activities like arbitrage, frontrunning, sandwich attacks, and leveraging flash loans


Defining MEV

MEV represents the maximum value that can be extracted from block transactions by those able to influence their order. This arises because Ethereum processes transactions in batches (blocks), creating opportunities for those who can predict or manipulate the inclusion and sequencing of transactions.


How do MEV Bots work? 

MEV bots are programmed to analyze the mempool for profitable opportunities, using tools and APIs to interact with the Ethereum blockchain and decentralized exchanges. 


Types of MEV Bots


MEV bots can be very flexible and customized to execute a variety of unique strategies, but they are commonly categorized into 4 main types. 


1. Arbitrage Bots

Arbitrage bots scan multiple decentralized exchanges (DEXs) for price discrepancies in the same asset. When they find a difference, they buy the asset where it's cheaper and sell it where it's more expensive, capitalizing on the price gap.


Example: If Ethereum (ETH) is trading for $1,000 on DEX A and $1,010 on DEX B, an arbitrage bot will buy ETH on DEX A and sell it on DEX B, earning a $10 profit per ETH (excluding transaction fees).


2. Frontrunning Bots

These bots monitor the mempool, which is where transactions wait before being confirmed on the blockchain. By analyzing these pending transactions, frontrunning bots can execute their own transactions first, if they predict those pending transactions will affect market prices.


Example: If a front-running bot detects a large pending transaction to buy a significant amount of Token X, it can quickly buy Token X before the large transaction is processed, expecting the price of Token X to rise. Once the large transaction goes through and raises the price, the bot sells its holdings for a profit.


3. Sandwich Bots (FrontRunning + BackRunning)

These are a kind of Frontrunning bots, but they usually "cover" the target transaction from two sides at once. Sandwich bots execute trades immediately before and after a target transaction. They capitalize on the price movement caused by the target transaction to make a profit.


Example: If a sandwich bot notices a pending transaction to buy a large amount of Token Y, it will buy Token Y just before the large transaction and sell it immediately after, benefiting from the price increase caused by the large buy order.


4. Flash Loan Bots

These bots utilize flash loans, a feature of some DeFi protocols that allows borrowing a large amount of assets without collateral, but with the condition that the loan is repaid in the same transaction block.


Example: A flash loan bot might borrow 1,000 ETH, use it to buy a token on one DEX, then sell the token for a higher price on another DEX, and repay the loan—all within the same block. Any profit made over the loan amount and fees is kept by the bot.


The example of MEV (sandwich) bot.

We are a wallet on the Solana blockchain, which is managed by a MEV bot. It was not difficult to determine this, as this wallet constantly performs up to a hundred transactions per minute. 



In our case, it turned out to be a Sandwich bot, which hunts for large transactions of users, covering them from two sides: buys right before them and sells right after them. Getting a few percent of profit from each transaction. 


After analyzing the wallet, we saw how profitable this bot was.


Source: https://coinstats.app/address/GHak4BpDSLV9wxhDtZaKr82bHEtr7h5EJB6VPCaBLumg/


The bot managed to triple its capital in a few days. This is amazing, especially when we are talking about hundreds of thousands of dollars. 


Jared — the greatest on-chain sandwich

Ever wondered how a single MEV bot crypto trader can pull in a jaw-dropping $1M a day? Meet Jaredfromsubway, the mad genius behind one of the nastiest MEV bots out there!

Jaredfromsubway has been grinding for years, using machine learning to train his bot into a market beast. He’s even blown over $3M on gas fees just to pull off his attacks!


Hilariously, his name fits his sandwich attacks perfectly (Jaredfromsubway.eth).

With MEV bots on the rise and tutorials popping up everywhere, it's crucial to stay sharp and safe in the crypto jungle. 


How to Protect Yourself from MEV bots?


By understanding how MEV bots work, we can formulate a basic principle of protection against the MEV bot attack:


DON’T LET THE MEV BOT NOTICE YOUR TRANSACTION BEFORE IT’S COMPLETED.

Use Protect RPC Endpoints

One effective way to mitigate the risks posed by MEV bots is to send your transactions through Protect RPC Endpoints. These specialized endpoints help bypass the public mempool, reducing the visibility of your transactions to potential attackers. By routing your transactions through these endpoints, you can significantly lower the chances of being targeted by MEV strategies such as frontrunning and sandwich attacks​​.


Use private transactions

This method hides your transaction from the public view, reducing exposure to MEV exploits. Directly send to miners or block builders for enhanced privacy. 


Set Slippage Tolerance 

Slippage occurs when there is a difference between the expected price of a transaction and the executed price. By setting a slippage tolerance, you specify the maximum price change you are willing to accept for your transaction. This control measure helps protect against price manipulation by MEV bots, ensuring your transactions are executed within acceptable price ranges​​.


Protect your trades with . 


When trading on , you can simply turn on MEV protection (private transaction) and all your transactions will go through private mempool, which means that MEV bots will not be able to notice your transactions before they are completed. 

Master the art of sniping & trading

Equip yourself with the knowledge and tools to become a professional sniper. Your journey to expertise starts here.