Sorry everyone, long overdue, but its time for a new MEV thread

Today we look at the Flashbots auction and the searchers that were able to game it using a super clever exploit in how we priced and merged bundles

Let's go 👇🏻🧵
For our journey today you will need a deep knowledge of Flashbots bundles

Bundles are groups of transactions executed in the order they are provided. Either the entire bundle is executed, or none of it is

That allows users to express transaction preferences very granularly
For some time we could only support a single bundle per block, but recently Flashbots introduced the ability to merge independent bundles!

Here's a thread on that release
Every block there are a huge number of bundles. How do we decide what goes on chain and in what order?

First each bundle is simulated individually on top of the latest block to find out what the bundle's expected gas price is. Image
Then bundles are sorted by their expected gas price from highest to lowest.

If two bundles conflict then the bundle with a higher gas price is included. The other bundle is discarded. Image
Somewhere in the last two tweets was a slight gap in logic that searchers were able to find and exploit.

Did you catch it?
Bundles are sorted according to their simulated gas price at the top of a block

But with merging some bundles weren't actually at the top of the block! They are behind other bundles

The gap: there was no check ensuring that bundles have the same gas price before & after merging
Bundles can pay tx fees via smart contracts. Thus, if a bundle could tell it was merged behind another bundle then it could dynamically reduce its fees to lower its gas price!

Miners would sort bundles expecting one gas price, but find a different gas price when they were mined
Here's what that looked like in practice

The green bundle looked like it would beat the yellow bundle, but actually it ended up paying way less!

The miner and the yellow bundle's author lost out on revenue while the green bundle's author profited at their expense Image
How was this done?

There's no way for a transaction to check where it is in a block natively, so searchers needed to get clever.
Searchers would send a "fake" bundle in parallel to their "real" bundle. The fake bundle had a high gas price & was designed to very likely be the 1st bundle in the block.

The "fake" bundle would cost searchers a bit of ETH to send, that was *the point*
If the "fake" bundle had landed 1st in a block it would spend a bit of the searcher's ETH

Then in the "real" bundle searchers could check if their balance of ETH had decreased any in that block!

If so they knew their "real" bundle had been merged behind the "fake" one!
With this knowledge that it had been merged behind the "fake" bundle, the "real" bundle could safely decrease its payment to the miner, thus gaming the auction Image
The fix for this was simple: check to make sure that bundles pay no less than we expect after being merged.
The MEV ecosystem is hypercompetitive. Searchers will find and use anything they can to gain an edge.

Uncle bandit attacks, tricking other searchers' simulations, and now this show that the reach of searchers goes beyond what is on-chain

Where will searchers find an edge next?
If you're excited by Flashbots and the work we're doing then check out our open jobs:

github.com/flashbots/pm/t…

Bonus points if you think you've found some edge in Flashbots and share it with us🙂
Lastly, check out our Github repo to learn more and hop in our Discord to join the conversation

flashbots.net
discord.gg/QXyxFRcx

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Robert Miller

Robert Miller Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @bertcmiller

24 Jun
It's a golden age for searchers. Late enough that Flashbots and DeFi exists, but not so late that massive institutions are competing for MEV.
Even still the barrier to entry for the top strategies is getting higher very quickly. It's probably a few months of work to catch up to the best backrunning arb bots now.
It is funny to think about the early days of Flashbots when there was literally 1 market maker, 1 ESD bot, and 2 arb bots sending bundles. Unbelievably good opportunity to make money back then.
Read 4 tweets
9 Jun
A thread of all my MEV related threads in chronologic order 👇🏻
The first Uncle Bandit pulling off a multi-block heist and launching a new category of MEV strategies
Read 8 tweets
1 Jun
Yesterday Flashbots published MEV-SGX, our proposal for using secure enclaves to provide a private mempool and a sealed bid MEV auction.

Thread on how MEV-SGX works and why it matters 👇🏻
ethresear.ch/t/mev-sgx-a-se…
Flashbots' focus is to enable a permissionless, transparent, and fair ecosystem for MEV extraction.

To date we've made progress on this by releasing two products: Flashbots Alpha and MEV-Explore.
Flashbots Alpha is composed of MEV-Geth and MEV Relay

MEV-Geth is a client that allows users to communicate granular transaction order preferences through transaction "bundles"

MEV-Relay is a gateway that Flashbots runs today, for reasons we'll discuss below
Read 18 tweets
13 May
Introducing the Flashbots Dashboard, a collection of real time metrics to give the community transparency on the Flashbots Network:

dashboard.flashbots.net

Thread 👇🏻
In January Flashbots released Flashbots Alpha v0.1, a proof of concept communication channel between miners and users that enables transparent and efficient MEV extraction.

Since then we've seen rapid adoption, and now over 30% of blocks on Ethereum are Flashblocks.
Flashbots has two types of direct users today: searchers & miners

Searchers are users who send transactions via Flashbots - today these are mostly bot operators extracting MEV

Miners are the block producers of Ethereum today, who want to extract MEV in a fair & transparent way
Read 12 tweets
12 May
Even @VitalikButerin can't escape the monsters of the dark forest

Twitter wasn't the only party watching Vitalik's wallet. As always bots were ready to extract what value they could from his pending transactions.

Brief recap of those bots and what Vitalik did
Earlier today Vitalik sold his Shibu on Uniswap, and @FrankResearcher documents that adventure well

Normally when you swap on Uniswap the transaction is publicly relayed through nodes until it reaches miners. Due to this anyone who wants to can see the transaction before it is mined.
Read 13 tweets
12 May
Deleted my tweet about V getting sandwiched, he actually got backrun
This bot backran 3 different shibu transactions in a single block, including Vitalik's

Never seen that before
The plot thickens! The bot that backran Vitalik was actually Ethermine's.

They also run sandwich bots so it's interesting they chose to backrun him instead of sandwiching.
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(