NEAR - Sponsor Image NEAR - Confidential swaps across 35+ chains Friend & Sponsor Learn more
00:33:52 · 3 years ago
Podcast

David's Takes: A Hitchhiker's Guide to Riding an MEV Bot

Welcome to David's takes. A new format with David and RSA where we explore David's weekly articles in 30 minutes or less.

Up next

All episodes

Inside the episode

Welcome to David's takes. A new format with David and RSA where we explore David's weekly articles in 30 minutes or less.


TIMESTAMPS

0:00 Intro

1:00 Why did David Write This?

6:17 A Reserviour of Liquidity

9:25 The Ships Metaphor

13:36 Offchain Signed Orders

17:17 Intents

22:07 Dutch Auctions

24:06 Impications Of This?

28:25 How This Impacts Bridges

30:30 What's Left To Unpack?

33:15 Closings And Disclaimers


RESOURCES

Read David's article here: https://www.bankless.com/a-hitchhikers-guide-to-riding-an-mev-bot/

If you're looking for a more technical explanation check out our recent episode with Dan Robinson: https://youtu.be/h4gzZib0j48

Transcript
00:00
David

If you look at the original Xbox games, the graphics sucked. And then if you looked at the late stage Xbox games, the graphics were like orders of magnitude better, but it was the same hardware. How did that happen? It's because the software got better. And so this is the software of Ethereum layer, improving what we can do with the hardware layer of Ethereum.

00:23
Ryan

Hey Bankless Nation, we've got a new show format for you. This one's short, punchy, the deep dive into a crypto rabbit hole that David and myself are exploring. These are our takes. Take them or leave them. 25 minutes max. It's gonna be our punchiest episode ever, right, David?

00:37
David

God, it's pretty ambitious to say we're gonna do this in 25 minutes or less. It would be a first.

00:42
Ryan

Each of these episodes will focus on one specific theme. On today's episode, we're talking about an article that David published recently in the Bankless Newsletter. It's called A Hitchhiker's Guide to Riding an MEV Bot. David, why'd you write this article? Why is this topic important?

00:56
David

Yeah, because every once in a while we go down collectively, the crypto world goes down the crypto rabbit hole, which we're all carving out, and then we find something new. We find something while we're digging in the crypto rabbit hole. And what we have found recently is this what the world of the MEV industry of crypto is calling intense. Intense as in I intend to do something. And the idea here is that this brand new fertile field that we've just unlocked could be real big, real big. And the why this is such a big deal, and why this uh why I wrote a whole entire article about this is that an intent, in theory, inverts the relationship that the average Joe swapper on Ethereum, the average on-chain swapper, has with the MEV vertical. Right now, there's an adversarial relationship with swappers and MEV. MEV wants to eat up the value of all the swappers and the swappers wants that to not happen. And then with intents, we actually can make these people be on the same team and actually get them to collaborate and cooperate, which is part of the bull case of crypto is learning how to align incentives. And so intents is a mechanism for swapping that aligns incentives between swappers and MEV. That's the big idea, and that is the thing that we have potentially discovered while we are going down the crypto rabbit hole.

02:11
Ryan

I completely agree. This rabbit hole goes deep. So we're going to begin exploring it in today's episode. But first, we disclose nothing big or specific in this episode. Both David and I hold Ether. Uniswap X is a subject of today's episode. Uniswap has previously been a sponsor on the Bankless Pro podcast. This is my time to remind you that we are long term investors. We're not journalists. We don't do paid content. There's a link to all bankless disclosures in the show notes at all times. Before we begin, we also want to thank the sponsors that made this episode possible a hitchhiker's guide to riding an MEV bot. Okay, David, what's the big idea here?

02:47
David

So I uh use metaphors when I write. Uh I think it's the best way to explain some of this stuff. Uh and so I start this article with this metaphor of Ethereum as just one gigantic ocean of liquidity. If there's like one activity that we do on Ethereum, uh, it's swapping tokens. Like Ethereum, if you want to be ultra reductive and kind of make a jab at Ethereum, you'll just call it like one gigantic DEX. Like that is what Ethereum is. It's just a it's just an exchange. It's it's like it's a marketplace for marketplaces. So it's like a meta dex. Like you can host many DEXs on Ethereum, but really Ethereum just is a place to swap tokens and assets if you really want to dumb it, dumb it down.

03:29
Ryan

The term ocean is kind of interesting too, because i y ocean implies some depth, right? You can have more shallow uh parts of the ocean, you can have deeper uh parts of the ocean.

03:38
David

Yes, there's that. Yeah. And that relates to this term called liquidity, right? And we all know what liquidity is in in crypto. It is just the how deep market uh like um order books are on an exchange, or how much assets are in a Uniswap liquidity providing position. There's this like fundamental relationship that uh like if at a very deep level, that water and liquidity and assets and markets all have with each other. And it's why it's why we use the words liquidity. That's not a coincidence, it's because people people way back when discovered that there's a relationship, a pattern between like actual water and the liquidity of market structures. And so this is why I call Ethereum a reservoir of liquidity. It holds a bunch of liquidity in Uniswap AMMs in like, you know, God forbid Ether Delta once upon a time. Uh zero X and actually the originator of off-chain order, Zero X. And now we have Uniswap, right? Um, Curve is another reservoir. Is like so, like, think of curve as like a very big lake, or maybe a curve is an ocean. Uniswap is also another ocean. Uh, we got Velodrome, which is a smaller little tiny ocean on a layer two, but really in you with you summate everything, Ethereum is like, you know, the earth with all of its oceans put together. And in order to navigate across this landscape of Ethereum, if you view the Ethereum as a landscape, which you ought to, because like every single contract address or your Ethereum address is a destination. And in order, and then you also you also have tokens inside of your addresses, and each of those tokens have addresses, little destinations all across this world. And we need sometimes to do our transacting, we need to go from place A to place B, from token contract address A to token contract address B. And this is what the activity of swapping is. You're going, you have USEC in one contract address, and you need to turn it into another token or Ether, which is at a different contract address. So, like, if we're putting this into metaphors, we actually need to travel across Ethereum's liquidity pools, pools of liquidity. And we actually need to do something, we need to make a transaction to get that job done for us. And this is like starting to set the scene for like what is this big meta structure of Ethereum? But we have these liquidity pools with different assets all over Ethereum, and then we have to go across these pools in order to get our jobs done. And that's kind of where I start off this article with this metaphor.

06:01
Ryan

Yeah, and you were using so if you picture Ethereum as this ocean of liquidity, right? Uh in the rest of this this article, this kind of resonated with me. You use this metaphor of ships, and you say this at the beginning. As swappers on Ethereum, we're about to upgrade our ships, moving from gas-guzzling clunkers that blast through the swells to sleek yachts, oh yachts, that stealthily send you where you need to go without disturbing the waters. You've got this image here. Um, and the on the one side it says on chain decks trade. And this looks like some sort of, I don't know, standard ship that is uh, you know, going through the ocean. It's

06:37
David

Yeah.

06:37
Ryan

it's a tugboat or something. There's there's a massive amount of wake uh

06:40
David

It's just

06:41
Ryan

both pushing the water

06:42
Ryan

of it.

06:43
David

a it's like a bulldozer going through the water, just like pushing the water around it, just leaving a massive wake. It's got this like messy like uh pipe that's just burning oil at the back. It is just brute forcing its way through the water. Yeah, uh-huh.

06:58
Ryan

All right, and you're calling that the on chain dex trade, which is now that's where we live. That's what that's like.

07:03
Ryan

Yeah, I use Uniswap, that's an on-chain dex trade. So you're saying that's like a big freaking tugboat. Yep. And then you've got this other side, juxtaposes. You say off-chain signed order. And I don't I have no idea what I'm looking at, but this looks like a stealth yacht. It's making it's going through the ocean, but it's making very little waves, uh, you know, very little movement, not much wake. And you're calling that the off chain uh signed order. Looks like also that the you know the scene is at night, so something stealthy is implied here as well. So why this metaphor? Why are you painting this picture?

07:36
David

Yeah, so both of these images are actually made with mid-journey just to aesthetically please

07:40
Ryan

Really?

07:41
David

the viewers. Yeah. So there's

07:42
Ryan

I could tell the second one was. I didn't know the first one was.

07:44
David

Yeah, the first one definitely was. Well, think about how big uh all those wakes are. I I I think the prompt was like metal heavy tugboat with massive wake or something like that. Okay.

07:53
David

So I I was good the so actually, can you pull up another tab and type in C shadow IX529?

08:01
Ryan

C

08:02
David

C shadow.

08:03
David

Yeah.

08:04
Ryan

Okay, C shadow.

08:07
David

IX529, yeah.

08:09
Ryan

Oh

08:09
David

IX IX stands for

08:11
Ryan

what's this thing?

08:13
David

Okay, okay, so now now type in F F117, Nighthawk. You can just do F117.

08:20
Ryan

F117.

08:21
Ryan

Nighthawk. Okay. F117.

08:24
David

Mm-hmm.

08:25
David

Yeah, so this is this is a stealth. This is a stealth fighter, famous stealth fighter, right? Developed by Lockheed Martin. They have uh all the the ship, the the this is a plane, this is a jet. Um this is a stealth jet, one of the first stealth jets ever. And the angles on this ship are meant to absorb radar and also not leave a a wake. And so they also was were charged with building this navy seashadow ship, which is a like kind of the same version, but as a ship. And it's built in this way that is A, it's absorbs radar, so you can't see it, and B also doesn't leave a wake. Because if like it's great if it doesn't show up on radar, but if you could just see the wake of this ship that it leaves behind, the white churny waters behind it in its path, then like all of your stealth technology goes to nothing if you just leave a wake. So it's also built in this way to cut through the water so that you can't detect it as it goes from point A to point B. And then on the other hand, and then that's supposed to be in contrast to like this tugboat, which is like, I don't give a F, just like get out of my way, liquidity. I'm pushing you aside and I'm brute forcing my way. And so these represent two different strategies from crossing for crossing Ethereum's waters. And now

09:32
Ryan

Oh.

09:32
David

Remember, Ethereum doesn't do like doesn't have an army. And so you're allowed to do as much MEV as possible, which is why like, you know, in the normal world, we have like armies and militaries to protect us.

09:43
David

But in the Ethereum world, which doesn't have an army, and anything is fair game, we actually need to be more adversarial in how we choose to cross its liquidity oceans because there's no army to protect us. And so we all need to develop strategies that are protective of our payloads, which are our swaps.

10:01
Ryan

Ooh, these these metaphors, these analogies are starting to stack up here. Okay, but so before we continue on that, we'll park this idea of two different ships an on chain dex trade, messy, huge like wake. It's just pushing the water out of its way. Off chain signed order, stealthy.

10:17
Ryan

Sleek, cutting through water, uh below radar, undetectable. But what is an off-chain signed order? We know what an on chain dex trade is, okay? That's where you go to Uniswap, you make a swap, it's all on chain, you could everyone could see it. What is an off chain signed order and what does that have to do with what we were talking about in the intro? This this this word intense.

10:35
David

Yeah.

10:36
David

Yeah, so uh an off-chain signed order stands in contrast to an on-chain dex trade. Um, so an off-chain signed order, it's actually pretty similar to an on-chain dex trade, except that you don't actually execute it as a transaction. And because of that property, you can construct your transaction differently than if you had on like Uniswap or SushiSwap or Curve or anything that's an on-chain DEX trade. So with an on-chain dex trade, you put in certain parameters that are like fixing, fixing variables in your transaction. Because if you don't fix them, then the MEV bots come and eat them, right? So we'll like with our tugboat, who's just like bulldozing through the Ethereum's liquidity, it's a lot of things are hard-coded into them because if they're not, then the MEV monsters will get in and eat that transaction up. And so, like, what am I talking about here? Um, we want to we have token A, want token B. Uh, we are uh setting, like, hey, we're only accepting 3% slippage. Uh, and then we're also going to go through this route. And so Uniswap actually has a product, and so does SushiSwap and um, you know, anything that has an order router.

11:47
David

An order router. Think of that as like loading up your ship, your tugboat, your slow, heavy tugboat, with like a predetermined path through Ethereum's liquidity pools to get from point A to point B. And so you're saying this is my path, and I'm only going to allow for 3% slippage to get there. We're hard coding all these parameters in in order to make sure that like when we get across this path, the MEV monsters only ate like 3% of our transaction or 2%, whatever we set our slippage to. But these are parameters that we're all encoding into our transaction to protect us. It's like adding panels to our ship, big metal panels to our ship. And it actually, every single parameter that we hard code is also an additional gas cost. And that's just what it takes for individuals to get across Ethereum if they are going to construct their own ship using an on chain dex trade. We need to get across somehow. So we got to build our own ship. And that's what Uniswap and any order router does when they help us make a transaction that is an on chain dex trade. We are basically custom building our own ships.

12:46
David

An off-chain train sign transaction is very, very uh is like uh the inverse of this. And so all you're doing when you sign an off chain intent, and off chain just means that you're not actually going to execute this as a transaction. You're going to, with your private keys, sign a transaction, but not broadcast the intract a transaction with an intent. So

13:07
Ryan

No gas

13:07
David

no gas. You just

13:08
Ryan

to sign transactions.

13:09
David

Yeah, so like you can take an Ethereum transaction that you would broadcast to the mempool, and then you can just sign it and not broadcast it to the mempool. And that becomes an off-chain signed order. So like an on off-chain signed order is like a precursor to a transaction that's on-chain, but it does not become a transaction on-chain by you. And so what do you do with this off-chain signed order is that you just state your intent. I have 2,000 USDC on the Ethereum layer one. I would like one ether on the Ethereum layer one. Or I actually would like one ether on Optimism or Arbitrum or ZK Sync or whatever. You just sign, you just sign what you want and your minimum amount of desired tokens on the other side. And so you're saying I've got 2,000 USEC and I will accept no less than one ether. And anybody who can service this is free to take this transaction and execute it.

14:02
Ryan

So that's why we call these intents, right? It's an intent. So I intend uh to uh provide 2,000 USDC in exchange for one ether. And you kind of broadcast that. You're not broadcasting that on chain, you're broadcasting this to all of the MEV bots.

14:18
David

You're broadcasting it to the MEV stack, which is usually the thing that you're trying to hide from. But instead you just actually tell them what you want.

14:27
David

And that that is the big unlock.

14:27
Ryan

And

14:30
Ryan

who's in the MEV stack? What is this this

14:32
David

All the monsters. So you have ME, you have MEV arbitragers, like liquidity pool balancers, sandwich attackers. You've got like just decks arbitragers. So if two different pools on Uniswap and SushiSwap are unbalanced, then they'll reorder reorder it. The entire spectrum of possible arbitrage opportunities are encoded into MEV bots on Ethereum around Ethereum. They're like this swarm of things around Ethereum that make sure that everything inside of Ethereum is maximally efficient. So like when you say like what is it, it's like it's everything that is relevant to markets.

15:08
Ryan

it's the hive? It's whoever can make a profit, profit, whether these are like uh market makers or bots or some combination of somebody, you know, it's it any anyone who who is willing to make a profit on this exchange here.

15:19
David

Right. And part of this stack is it's probably becoming very, very verticalized. So so market makers and MEV bots are probably collapsing into the same

15:30
David

same vertical, for example. So this just turns into a a vertical of like

15:34
David

The the efficiency checkers of Ethereum markets. So like if anything is disturbed in Ethereum, then they will rebalance it. And this is why we go back to this metaphor of liquidity and disturbing uh or di here's a word, dislocating pools. Dislocating Ethereum's pools or liquidity is like when you take 2,000 USDC out of the Uniswap pool and you put it into the Uniswap Ether pool. Like you're taking, you take water, scoop it up out of one pool, and you dump it in another pool because you just made a trade. Well, all of a sudden you've dislocated Ethereum's pools, and that is like signals to MEV bots, like, ooh, chaos, disturbances. I need to go consume that chaos and rebalance the pools because of that's what arbitrability arbitrage is. So this is why the tugboat that's like blasting its way through the waters of Ethereum, because it's just a super inefficient ship, it like attracts every single MEV bot under the sun because it's creating imbalances in its wake. That's why you don't want to leave a wake because you attract MEV bots. And so all of these custom built ships that we're making when we make a transaction on Uniswap or SushiSwap, we're just using, we're making like a one-time ship to get us from point A to point B. And it's like super messy and heavy and laden and gas inefficient because we have to layer on all these MEV protection mechanisms, or else we'll get eaten. And so this is what MEV bots do. They rebalance dislocated pools. And this is why there's this antagonistic relationship between on chain DEX trades and MEV bots, because MEV bots abhor chaos. They want to absorb that chaos and turn it back into order, and that order is an efficient market.

David Hoffman

1490 posts

Co-owner at Bankless. Optimistic storyteller of frontier technology.

A huge thanks to our Friends & Sponsors
No Responses