Flashbots 🛠MEV Applications
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Hack with some of the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem, ETHGlobal New York 2023. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
foreign [Music] Global hackers we're very excited to have you here uh today I'll be going over a quick workshop on medshare uh some quick ideas related to the Mev market today and as well a little sneak peek of some swab Concepts and things you uh potentially can't hack on um for this hackathon related to Suave but in the very near future to get your ideas going and then additionally at the end we'll be going over uh the the prizes that flashbots is sponsoring so if you're interested in that mostly please skip through to the end but you will miss some Alpha if you do that cool let's get into it yeah so first Let's do an overview on Mev and Order flow auctions which is what ofas stand for so yeah state of Mev um there's a premise when when users transact on blockchains they generate value um you know the the classic example of this is when I transact with uh uniswap um or any other amm um there is the value that my transaction um you know passes through the protocol but then there's also the value that my transaction creates that is able to be extracted which is particular which is usually extracted via reordering transactions in the block or inserting new transactions into the block um today this value is mostly captured by searches and validators one of the common examples especially in this sort of amm example is slippage so if I set my slippage as being potentially up to 20 of the order value um a Searcher could see that if it's in the public Med pool and then insert a transaction before mine which will buy up a token such that the price um will essentially take it all the way up to like 19.99 of what my slippage was um and then they are essentially extracting that value um and that is an example of how a user users can be negatively impacted by some strategies um this is the general flow of the transaction supply chain today and this is post merge and introduction of um the proposers Builder separation design philosophy that we see um which is very common in uh transaction markets and markets so you either interacts with the wallet um this is uh what you can view as an intent um it's sort of a buzzword these days but this is um you know this is like pre-transaction State this is like you know I have a desire and the desire is expressed I express my desire to the wallets and sort of something is like a gas price you know I can sort of choose the gas price and that is like my desire for how fast the transaction should be included next we have a transaction and so that typically go from the wallet to the mempool or the wallet to a Searcher um next the Searcher will take that transaction and do something with it either um something that negatively impacts them or sometimes positively impacts so um jit is a good example of uh just in time liquidity that often actually improves execution prices but unfortunately that comes at the cost of LPS so there's always a trade-off um yeah Searchers send these uh in a format called a bundle to a builder Builders will then construct blocks and participate in a block auction um hosted by the validator and that last piece is all facilitated Through Math boost but that's a little too in the weeds for this Workshop cool so yeah in that last example we talked a lot about how users transact through the mempool um and that is how negative strategies are most likely to occur on the user so the current solution that we've seen is private channels um this was first introduced with Mev Geth with flashbots in the flashbots auction and then later on that boost allowed any Builder to or a market of Builders to expose these private transactions that users can send directly to builders so that's awesome because it protects from negative externalities uh in the past in order for Searchers to extract Mev from these strategies they would have to spam the mempool um this by by having these like options out in the open and by having just many many bids this actually creates a lot of next negative externalities for the network one it overloads the mempool but then two it actually just raises gas prices as well for all users the that the disadvantage of this though of course is that we don't internalize any of the value the user has this value that they create but they're not getting any of it it's all going to the search or the validator and so um that is like potentially one um very active research area for um flashbots in the broader ecosystem is how we can internalizes value and then also who gets that value so yeah private mempool is a big one as I mentioned on the off-chain auction side the other option as well is like on-chain mitigation mechanisms I think um in the limit applications will asymptotically be you know approaching less and less Mev I don't think and many don't think as well that Mev is totally possible to get rid of at the application Level but there's definitely a lot of things you can do so maker has a great example of how they introduce Dutch auctions for their liquidations um in their first versions again users would just Spam their best bids to compete on a Liquidation option opportunity but now a Dutch auction just says okay here's the starting price and it just continuously decrements the price until someone takes it and so this is actually um a much less communication intense auction process which again reduces negative externalities but again you can also front run people's um you know you can wait until someone bids and then try and front run that bid so it doesn't totally remove that um gradual Dutch auctions is another approach that um uh Paradigm uh pioneered which was used in art gobblers um and then amms there's a lot of talk about order flow discrimination so these are models like the MCA mmm dmcamm uh I won't get into those too much but just check out each research if you'd like to see what those ideas are um cool so yeah again these are the common themes a bunch of these protect from negative externalities but they don't internalize value so we want both um hopefully that's that's very obvious um so order flow auctions giving users a fair price for their order flow how do we do that privacy we believe is one of the key aspects of this um in the public mempool example users are revealing all of their information to a Searcher so this is information about their order um everything is in fact inside of the call data is available to the Searcher the gas prices available to the search right this sort of reveals your intent for how fast you want this included um and then lastly and also the this actual signature for your transaction is given to the Searcher so the Searcher can Now package this and include it in any other order flow auction on your behalf so we believe one of the keys here is programmable privacy giving users the ability to selectively reveal parts of this information allows users to have more control over the value they create and the simplest example here is if we actually never give the Searcher the um signed transaction then they're going to have to communicate back with the user or the protocol somehow so benefits for everyone um yeah programmable privacy so users are protected and they internalize value as I mentioned before by requiring Searchers to now communicate back um you know they're very incentivized to now give you some value because if they don't give you any value then why would you ever give this to them you can just actually just give it to a private Channel and just have it be executed um as is so yeah those are sort of the main um the main benefits here um another side benefit is that um you know in instead of everyone just giving privately to these Builders this actually gives Searchers access to like a whole new range of orders that they didn't have access to um from you know a subset of users that they don't even want to like play these games they just want to go straight to the Builder um this allows them another Channel which um you know really increases the market for Searchers um and then yeah lastly Builders and validators and receive more profitable bundles and blocks because if this extra generated value is able to be extracted and given to them then um we have a much better Market so the uh order flow Market Size Market size today um Kickbacks so these are sort of refunds that users are getting from their value um it's in the hundreds of each which is like pretty awesome I think a couple years ago if you had said um you know users were going to be getting refunds for them they generated like that would have been like you know a pipe dream and now it's like a very real which is awesome so the order flow Market size tomorrow Kickbacks without tens of thousands of eats like all of you know the the slide here is wait it's all nav addressable order flow oh yeah it always has been um so you know there is a very very wide market for um users and app developers such as yourself hackers to create these mechanisms which are able to capture more of this order flow um yeah so what can you do today um yeah so for private channels we have flat spots protect we also have Builders rpcs as we mentioned before um use case specific tools so cow swap Dex aggregator is one inch Fusion matcha these are um sort of ways to minimize Mev um and then yeah general purpose order flow auctions we have Dev blocker and Mev share is the two big ones um and so Med shares uh you know our instantiation of programmable privacy it allows users to um as previously mentioned reveal subsets of their information uh in exchange for um sort of negotiating how much they're allowed to refund and medve blocker also does something very similar except they choose to just sort of reveal the entire piece of information and then include fake pieces of information to sort of throw searches off their scent um yeah so let's get more into med share programmably private it's permissionless at the moment and it's a general purpose OFA protocol meaning it doesn't cater towards any specific applications such as a decks or liquidation but can do all of them um yeah so as mentioned there are low switching costs um you can plug anything into this um permissionless any Searcher can access this um all you need to do all Searchers need to do is listen to a specific endpoint that we have revealed and they're able to sort of already start searching on this um and programmingly private yeah it's customizable so we have a way that you can express a variety of um information reveal so you know you can even go you can do things as minute as only reviewing a specific pool you're trading on or you can do more as like revealing a pool plus the direction but not the size um yeah anything like this is possible um so here's roughly how it works a user sends a transaction to a nav share node the med share node will then selectively reveal a piece of data to the Searcher the Searcher will then send partial bundles back and then the med share node will combine these bundles um and then give them to the Builder but they will include something we also call validity condition which specifies how much of a refund the user gets and so obviously the higher the refund that the user gets the slower it will be included so if ninety percent of the mevs to go back to the user that only leaves 10 for the Searcher and the validator as well as the Builder um so yeah it's up to the market to decide like what is the actual right pricing mechanism for how much the user should get back based on their intent for how fast it should be included cool and we're back so web share for wallets um yeah it's really easy to integrate so route you right well it's simply just need to route your eats and raw transactions to rpc.flashbots.net.net and you can configure your settings through query parameters so this is sort of like you know at the end of the URL put question mark hint equals Etc or refund equals this percent um and any order flow that you share that you send through your wallet uh is now able to be searched on by Searchers in a permissionless way and then yeah lastly Profit just transacts it back and see how much profit you accumulate into your wallet the Builder will take care of sending the payments to you um and there's a really nice guide for users for how to configure this um you can simply specify before you add your uh before you add the RPC to your wallet you can click on some of these settings um and you can even include um Builders so we um had a working group um where we defined some fair market principles and each of the builders on this list have agreed that they uphold these fair market principles in order to get put on this list this is to guarantee that um to have some type of protection that Builders aren't going to abuse the order flow being sent through this um and for the astute Observer um yes this is this is a very this is a social contract in some sense and so we need tools to actually monitor how Builders are upholding these guarantees and um and also just even monitor other things like um you know the the performance of these guarantees Etc and so that's all up for grabs and sort of the data analysis section of the prizes cool so that was my share and we think it's really awesome um and it's it's been sort of a game changer for the Mev industry but let's give you a sneak peek of what's next so the order flow auction end game um I used to use this meme wrong uh I I sort of I would like list a bunch of things and I'd just be like oh look you know look at all these things but I think um and they were like uh sort of like true things but uh you know the big part about this meme is you know the the little girl says like look at all these chickens and so they're you know the the things they're supposed to you know be the the caption the the bottom is supposed to be labeling them incorrectly and so uh yeah look at all these trustless Mev auctions like yeah they're all trustless right no um yeah so I mean Med shares even on there so um you know we totally admit that there's uh you know a centralized uh operation aspect to this um I think no matter which of these Services you're using you're trusting them in some sense to not abuse it and there's not really any like crypto economic or just even cryptographic guarantees that you're um order flow isn't being abused so yeah we have programmable privacy but what's missing decentralized off chain offs in infrastructure it's it's exactly what we think uh the the space is heading towards if we had all of those previous examples but they were running on decentralized infrastructure we think the market would be in a 100x better place um so that's why we introduced the mebum it's an upgraded evm which allows anyone to deploy um these off-chain Mev sharing solutions to a blockchain which then runs on trusted execution environments so that no one not even us flashbots or the operator of the actual node is able to peer into the operations and extract information so um how do we do this with Med specific pre-compiles we expose things like simulate bundles forward to Builder etc etc for these um applications and we allow them to Define these applications in a programming environment that is very um you know Common to most app developers which is solidity and then yes secure hardware and confidential data so you can actually encrypt the um these transactions to the secure Hardware so that again no one but the secure Hardware can see it not even a man in the middle I think um yeah it's an upgraded DVM or it's actually a more a market for mechanisms we think the best mechanism should win that's not necessarily one defined by flashbots or anyone else and so we want anyone to be able to permissionlessly compete for execution on order flow so yes our first rule out will be swad Centauri um it's coming soon TM uh so here's like sort of the key users we're targeting so developers they can contr they can create contracts for ofas um block Builders you could even do rfqs um anything that you can imagine here uh users they would then send bids encrypted bids to um this whole this environment and then lastly executors so these are sort of these are circus and solvers who are like competing to solve on these applications and sort of these are the key components of suave it's an execution node a confidential data store this is what makes sure your bid is actually private and then lastly the chain so that's sort of a shelling point for agreement upon what the actual auction we're running on top of the bids are and then lastly this whole thing just magically combines order flow into blocks which is then sets of proposers um here's maybe another like a slightly more detailed example so you can imagine you know uni X cow Swap and I've share them all being defined on swab and then they can also Pro they uh people can also then Define block builders on Suave as well and these then order flow auctions can program which block Builders they're allowed to send this order flow to and the users also have some say in that as well and then lastly the block Builders will then communicate with validators through some type of epbs like mechanism although currently it's out of protocol and that's you know very much okay it still gets the job done so what can you build on Suave yeah solidity based intense infrastructure order flow auctions Builders decks aggregators validity conditions um custom redistribution mechanisms you could even redistribute erc20 tokens instead of just the underlying token another application is private voting as well this environment uh allows you to aggregate votes and privately as well so it could then compute results um and then another fun one that we talk about sometimes eip4844 blob merging that one's a little bit more involved uh you know for for those Advanced hackers definitely reached out if you're interested in this idea cool let's get into the prizes what you're here for so the open Innovation track unveiling unveiling the Mev potential this is uh supposed to be an open-ended track and we didn't want to be too prescriptive about this essentially any project that showcases Suave Mev or programmably private programmable privacy Concepts will be included um we'll be uh potentially available for this track and so we we really want to see um mechanism designers flex your uh you know crazy ideas and and things of that nature for this track the next track this is the big one data analysis track so the first idea we have here is rex.
what the uh Nev lookup tool for uniswap users the idea here is that it could be a tool where you can look up past uniswap or maybe another or any other Dex trades um and see related metrics so you can see the Mev extracted from a specific bot this lipids caused by trade collision and then you could also even what would be really cool is if you could compare the user's execution to how it would have executed at the top of the block so let's say the user's transaction was in splot uh you know spot 100 in the block what you could then do is grab that transaction and then simulate it as if it were at position one and see what the how much how many coins they would have got at the end of both of those and then compare um swap execution dashboard um yeah a very similar idea to simulate uh you know design a simulation bot to query across major Dex aggregators um and then compare execution quality based on same trade requests to help the community understand if really aggregators are providing better quotes than dex's um medigat are meta aggregators providing better quotes than Dex aggregators and then also our solver systems provide better quotes um additionally there's room for empirical analysis on historical data here as well how vulnerable are each platforms orders to towards Mev how are price execution uh compared between each platform and then lastly the mempool hydrometer hydrometer if you know if if you also know how to say that word please include that in your presentation uh so yeah is the is the public pool really drying up with order flow moving to private mempools um recently we uh released a a project called mempool dumpster which is um the first public actually one of the first they're actually there there have been other attempts uh the first public mempool aggregator which reveals all of this information um and and gives it to anyone to to do historical analysis on so you could do things like um analyze exclusive uh mempool transactions from specific sources or see the propagation of transactions through the metal pool um yeah so things you can do with this are um you could actually look at blocks and see which ones which transactions in a block were seen in the public mempool and then that tells you which of the transactions in the block were private um yeah how valuable are these transactions add metrics or visualizations to inform the mempool evolution after the adoption of Med boost or end order and specific order flow options if you have one in mind you'd like to analyze um yeah and so projects in this track should focus on Illuminating the dark corners of the Meb supply chain um additionally there are already tools which attempt to do some of these things so a compelling project will do something that hasn't been done if you need um if you want examples of projects that have things that have already been done please reach out um lastly the ecosystem track and this is focused on broadening the med landscape the first one is a med game the idea here is um to basically create some type of game that allows Searchers to submit bundles um and essentially stress test the underlying environment that uh that this Dev game is running on so one example recently is um you know friend.tech launched on base and it was it was quickly found out that uh there's actually opportunities to extract Mev uh on the um sort of underlying infrastructure there and so we think if there was a game like this that any new chain could deploy to stress test their environment this would help reveal some of these um these uh yeah these inefficiencies in the underlying infrastructure um so one example of this is like a project like fomo 3D so look into that um if you're looking for inspiration next would be a memberware uniswap front end slash flashbots protect ux so producing memberware front end Fork which informs users about potential Med from their trade and directs them toward the med share or existing overflow options and shows an estimated refund amount uh and then lastly back run my Oracle um so craft a system where Oracle updates can be auctioned via nav share or similar Services um I think Uma is a project that's really interested in this as well so if you have any thoughts please reach out to us or them amazing and those are our prizes we're extremely excited to see what everyone will be hacking on and we cannot wait to see the submissions and thank you for helping contribute to a more fair and transparent ecosystem thank you
Automatic transcript — names and jargon may be misspelled.