Order Flow Auctions on the MEV supply chain / Alex Vinyas
Prague DeFi Summit 2023 · June 2023 · 23:04
At Prague DeFi Summit 2023, Alex Vinyas asks whether order flow auctions can steer Ethereum away from the dark, authoritarian dystopia he sees MEV creating and toward a more solarpunk future. He looks at two real-world implementations, CoW Swap and MEV Blocker, and examines how they might benefit users at each layer of the MEV supply chain.
Speakers
Topics
From Prague DeFi Summit 2023, hosted by Prague DeFi Summit 2023.
Transcript
thank you well hello everyone thank you for taking the time to to be here I'm Alex binas the product marketing manager at Cal protocol or also known as cowshop and today I'm gonna talk about order flow actions in the Meb supply chain or more specifically on the transaction supply chain so I've broken down the the talk into three main topics everything about order flow auctions production ready order flow auctions where we look at Mev blocker and cow shop and then where is the value going and following the money so first let's try let's try to explore what order flow action are how can you design them and to be the most effective for the user's outcome
so what are ordered flow auctions right order flow auctions are mechanisms that oxygen of multiple users orders to be settled by Third parties with the goal of returning as much value through the users that otherwise would have gotten leaked throughout the transaction supply chain and all the flow auctions are important because they help to surface the true value of transactions because in the moment that you have someone bidding for those transactions at the initial step of the supply chain then you're not going to leak as much value throughout the chain and they also help mitigate the negative externalities of Mev because one of the cool things about all the flow auctions is that you can design that for example from running or sandwiching is de facto prohibited or if
you design the right mechanism then even the mechanism is strong enough that you can do such things so how do other flow actions work well as I said or the flow auctions aggregate multiple transactions together and batch them all at once instead of setting the transactions individually so the first step is to gather the others and send them to the action year and put them into the auction once the orders are all together in in the same auction we send the information to the bidders who then proceed to optimize the the entire transactions of the of the of the auction based on the criteria that the order flow auction is trying to trying to optimize for once that is done then the bidders offer their bids to the auctioneer who then proceeds to select
the winning beat based on the criteria that the order flow is trying to the order flow action is trying to achieve and lastly no the winning Beast is pushed on chain along with the orders all the orders that are within the auction or at least push throughout the next step of the supply chain but what are some of the important designs decisions that you need to take into consideration when designing another flow auction and of course these are high level and there are many more type of decisions that you need to make but the the most important one in my opinion is what type of orders there are either you have intent or transactions and it's very important to make the clear differentiation between these two because of course all transactions are intense right if I want to transfer
money my intent is to transfer money but there is a big difference between what an actual intent is and a transaction and the big difference is that intents are fully composable right I'm not hard coding the output like in a transaction on the contrary what I'm just saying is hard coding the input and I don't really care how you combine the output what I want to do is something I'm not specifying where I want to do it the second decision you have to make is who has the settlement rights for the orders in the auction is it completely public anyone can just simply plug into the auction and settle orders if they will win is it public permission do you basically need to I don't know put a bond or take something to participate in the auction as a settler or is it private is the auctioneer the only one
that decides who has these rights the third part is what are the bids objectives do does the order flow auction want to maximize Mev and then maybe return the value that has been leaked to the users or does it want to minimize Mev in a way that already the users are getting the value beforehand and they don't have to wait for this rebate transaction and lastly what type of information is shared from the orders to the bidders is it all the information do bidders have full access to the information of the trades is it only partial they don't know everything but they know enough information just to bid for it or is it all information but obfuscated in a way that they can't really like gain the system and they have to express their true beat for it
but now let's look at the different levels at the of the stack in which you can perform all the flow action the first level that you can perform the the auction is at the top level and this for me is the most interesting place to do it because it's the first stage of the user's interaction with the blockchain right in here you have a lot of room to actually improve what the outcome of the user transaction or intent is going to do basically because the transaction no they kind of a final message that is pushed on chain has now been created yet the second stage that you can do it is at the Builder level so basically you can create a private main pool and in here even though the transactions have already already been created you still
have room to optimize these transactions and basically kind of try to avoid as much value leak that the users has left and in this case these two type of order flow transactions at this level are specific right they have they have a goal in the case of the dab it can be like application specific and in the case of the builders most likely it's going to be like to return value to the users and actually get their order flow but there is one more level that you can do in order flow action that in this case is more generic which is the validators because essentially the validators just auction the entire block to builders and say just give me the best transactions that I can make the most money out of so now let's look at what type of or the flow auctions there are there are three
main types the first one is an RFQ action which is a price Discovery system basically the way it works is that of chain market makers or of chain bidders just simply respond to the to the quote that they want to provide for for the swap that's been given to them and I like I was missing one thing well and I like to categorize this auction as single intent auctions because basically the only thing you can do is just improve the price right and this is quite a specific and quite narrow only for Mike and makers because then you kind of provide a better price than amns because you have a private inventory that you can basically turn off like a couple of points that amms are not capable of doing
then you have frequent batch auctions which is a price Discovery system on top of a execution price Discovery and it works in a similar way you have off-chain system that basically calculate what is the best execution path and also what is the best price for the orders within an auction and this is a multi-dimensional intent auctions because instead of just having to provide a better quote for the price you can actually provide better optimized execution because you can do things such as like peer-to-peer trading or ring trades which in the case of Cal swap that's where the name comes from which is Coincidence of ones which is when users are completely overlapping and they're matched with one another instead of having to go to the amm and the third type of auction that you
can do is the block space aggregator auction which is neither a price Discovery or an execution path Discovery it's just simply worse by providing several benefits to the users that are using this type of auction and mainly focus on giving the cashback or the value that the transactions from the users would have otherwise leaked in the in the supply chain so if you think about it it's all about the auction and it's finally nice to see that everyone is starting to pay attention to auctions because if you design auctions pretty well you can actually return a lot of value to the to the users so now let's look at two production ready order flow options that house up specifically has been quite involved with which is mub blocker and Cloud shop
itself so MVP blocker is a order flow auction at the Builder level with the goal of providing privacy and fast inclusion for the for the users at the same time it also tries to give a better experience for for Meb because the fact that you cannot be front-run or or sandwich and also the aim of Mev blocker mainly is to redistribute the value to the users which in the end are the ones that are creating this this sort of value so how does mbb blocker work right we have a user that connects in this case to the to the RPC which is Meb blocker no and creates a transaction which would be the this letter and here as we can see this is the transaction and this is
the signature so then maybe blocker what it does is the couples the transaction with the signature for the goal of them sending it to Searchers who have to perform the Mev to return it back to the user and the important part here is if you see the envelope it doesn't have the signature and this is important because then that means that searches can only append transactions behind the user's transaction and therefore like by the design no they cannot try to front run or sandwich the sandwich the the user so then the way the Searcher has to create the unsign bundle it's basically like we have the user's transaction then we would have the background and they need to include the payment to the user once
they have submitted the bundle and the best bit all the different searches and and the different bundles to the RPC right back to the RPC no then the the RPC makes certain checks in this case that you know you're not trying to front run the user or sandwiches so then if those checks go through as you can see then we the Mev blocker includes the the signature of the user of the transaction so that then it can be passed along the supply chain more specifically to the Builder and particularly Mev Blocker in comparison to other different protection rpcs out there is that instead of sending it to a single Builder it sends it to the 10 major builders that are currently out there in ethereum and then
the transaction just follows throughout the supply chain right it goes to the three layers and then it goes to the validator or the proposal and once the transaction gets on chain what we see is that the user gets up to 90 percent of the value if their transaction carries an EV and then the Searchers get the 10 remaining percent minus the fees that they have to pay for the validators but currently Mev blocker has three aim points which is something that people don't talk about much but there are three different use case for a maybe blocker the first one is fast this endpoint is just focused on Fast inclusion for the transactions with the option of getting a rebate but it's important to clarify that not just because you make a transaction you're
gonna get a rebate the rebate that you're gonna get is based on how much Mev your transaction creates then the second one is no reverts which focus on protecting your transactions from Rivers at the expense of having a slower transaction inclusion into the chain but the important part is that you have the guarantee that the transaction submitted there is not going to revert so you're not going to have a failed transaction and the last one is no rivets which basically is is focused on maximum privacy and fasting inclusion but no refunds so if you use this uh this RPC endpoint what you're gonna get is that you're gonna get like the transactions directly sent to the builders and then the transaction is going to be included quite fast and no one is not sent to the
Searcher so this is not possible to do anything or try to alter the transaction and why is Mev blocker important for ethereum well maybe blocker is important because it's the first step to redistribute value to the users who in the end are the ones that demand the block space right and ethereum has been going in this I don't know fatal spin that we keep hurting the users by offering bad prices and like extracted value from there so there might be a point that if we keep doing this we might lose the users it's also important because it gives it gives you it can give you privacy right now which is sometimes depending on the user that you are is far more important than than a rebate and lastly it's also
important because it helps to the most unsophisticated users of ethereum to actually not leak value through their supply chain and this to be honest for me is the most important aspect because you know in the end we might think we're all sophisticated users but you'll be surprised in general how many people need this sort of solution and while Mev blocker is very important for for ethereum it's still not as optimal as as for example cash flow simply because in order to do the undo the user's mistake you have to basically create a new transaction which is the background transaction and then add the transaction after that so in essence you're occupying a lot of the blog space that you don't need to have to occupy
and now let's look at at cow shop as I said cowshop is an order flow auction at the top level and basically a cow shop is a the trade comes up is the UI that underpins the trading mechanism which is called protocol which just adds a batching layer on top of a M's and aggregators that allow us to execute multiple traces together in a single transaction in ethereum but the goal of calcium basically is protect users from Meb because in here since you're leveraging intents you sign a transaction and the the signature kind of hard codes on chain what you're gonna get so you cannot be screwed for the lower end
then it's also important because through intents we can enhance liquidity because in the event of being a perfect peer-to-peer trade there's no need to go out through a liquidity pool in the emms or in the case of ring trades which are kind of like barter economy you can match multiple users with each its own liquidity without having to do any hops on the on the amms it also gives fair pricing via uniform clearing prices because every batch in Council has to have uniform clearing prices so that's also another case of Mev protection because in the end in the case Meb protection arises because there's this parity within the same trading pairs in the same block so in calcium this is not
possible because all the assets that are trading in the same auction get the same price and lastly it optimized the fee consumption because with patching you can also optimize some sort of transactions but how does it actually work well the first stage is to collect the intent of the users in this case via the UI or even in this after the smart contract level and then the intent is registered into into the order book and then once we have uh enough intents the protocol basically creates an auction and then Distributors to the solvers the servers are the third parties that execute the transactions on behalf of the users and then proceed to optimize the the trades within an auction based on the objective criteria that cows has which is maximize
the user plus Surplus and guarantee that they're gonna all the trades in the same batch are gonna get the same trades once all the server once the auction is over the server send the transaction the solutions back to the protocol who then proceeds to rack the rank them and as I said this the winning solver is the one that maximizes the mode the users the user's output and once the protocol has selected a winner in this case let's say the middle one then the protocol proceeds to push the transaction on chain and then everything gets activated and resettled now and then the user or the smart contract gets there gets the tokens but why is calcium important for ethereum well it's important because I said before we go from inefficient
blocks where you have multiple transactions that occupy a lot of space and leave only a very little available block space for others so which means that then these available block space is quite a high demand and this is a cause of a high gas fees and also another particular thing about not using Cloud support directly using amms is that in the end the liquidity pools are on balance right if I trading here this liquidity pool has the certain reserves this one has another one and this one has another one which is the root cause of also toxic flow and then with cow sub we go from efficient blocks because then all the transactions are bundled together into one single transaction and then you have a lot of free space in the
block which means that then there is less demand for it and then gas prices can go lower and then also another part because of the uniform cleaning prices you get the liquidity pools perfectly balanced so now let's look a little bit of where are people losing money so in January and February 2023 you can fight conducting analysis where 80 48 million dollars were leaked through the users throughout the supply chain and here we can see that the big winner is the validator with 30 million dollars which is actually nonsense because they're the ones that do the lease and that means that in general people are overpaying for their transactions and then the second winner is the Searchers because they take 7 million and the builders who are the ones actually building the block
are the ones that get the list and this is why we're focusing on building MAV blocker and cow shop and so far MAV blogger has already have 65 000 different users it has given back to the users 160 167 years and usually they wait time for your transactions to be included is 8.2 seconds and then in the case of cow swap with help protect around 24 billion dollars of of volume through Meb we have returned to the users around 150 or 115 million dollars in volume that goes directly to the users by preventing them from every minimization and so far we've had around a 100 000 different users so in conclusion order flow actions can
bring fairness to the game because if everyone knows the rules before playing the game then it's more fair it can also reduce any of the opportunities because batching transactions like all together is harder to manipulate that trading transactions individually then they allow for a better price Discovery because if you have a fair competition where no one has to worry about other steps after the supply chain then people can reveal their true intent or their true bidding value it lowers the transaction cost because with batching you can optimize all sort of fee and then there's one missing but it's it enhances the liquidity because with intense you can actually not only match use the peer-to-peer but with the
use of uniform clearing places you also get rid of toxic flow which is the case that now for example balancer Dao approve a governance vote that allows cow shop servers to get a reduction of up to 80 percent in liquidity providers fees because basically the the volume that the servers are routing to balancer is non-toxic therefore they're willing to trade again against them much more easily and and lower a better price so in my opinion like intense but the real ones not the transactions are the most powerful one the tool to get rid of Mev and also give value to the users and I also want to say like thank you and acknowledge all these different teams that have done tremendous work and great context around all the flow auctions
and also want to say that if you're interested in helping us we're hiring so please apply in the cloudify careers and I don't know if I have time for questions time for one more question one question hi uh thanks for the talk very interesting um in the slide where you mentioned how Mev protect works what if the Builder is also the Searcher and just inserts a front-running transaction
before he's bundle that only works if it's front-run basically I mean in this case the then the Builder will be kicked out of the order flow auction and it wouldn't receive the future flow so we can't really prevent it but we can only react after it so I think it's within their interest to not lose this amount of flow that is coming through them just for free in a sense okay so you're prevented basically by kicking him out yeah exactly thanks foreign I think you guys are doing great work for the industry so thank you for that
um my question is how many percent of intent get fully matched with your off shampoo before push to amms so this is unfortunately not a big number right now I I would say it's around maybe of the total volume like one percent it's not big enough but this is an issue of like just timing because the auctions are quite short it's not very common to actually have this type of Coincidence of ones right because the users unfortunately don't want to wait for the better price but rather want their transactions to be executed quicker so we can't really extend the auction one of the things we're looking at is allowing users to basically signal that they they want to trade but they only
want to trade if there's a perfect peer-to-peer match so then basically this would just be like a I don't know forever valid order sorry quickly um how many percent of your intern your intent pull up from professional market makers so zero because well I mean I don't know because market makers can be users like it's not the the intent is not that market makers are connected and created the intents it's basically just the way it works is that users go to call swap or on other interfaces try to trade they express their intent and then the
solvers basically like run the optimizations to execute those intents in the best possible way if if it's possible to do account then awesome if not you can just look at different optimizations because for example you have like what we call unidirectional cows which is if three users are trading I don't know in the same direction then you can batch them all together in a single transaction so covers are not only like for peer-to-peer because then you can also have intermediate cows which is like when you two people are trying to sell different tokens but they have a common Hub in the path then you can actually match them there thank you Alex thank you [Applause] [Music]