 I'm excited to be here talking today on the Patreon of Saragossa, which is La Wilher de Pilar, and I'm Alex Villas, I'm a marketing manager and COUP protocol, and today I'm gonna talk to you about how does COUP protocol reduce MEV by optimizing transactions through patch auctions. I've broken down the talk into four topics, which is the first one, MEV, the good, the bad, and the ugly, then what is COUP protocol, then the difference in the mindsets of maximization versus minimization, and lastly, where are we heading? So, MEV, the good, the bad, and the ugly, will Ethereum remain under this utopian dream of building decentralized finance for fairness for all the users, or will the dystopian side take over, and as always, will the bigger fish eat the smaller fish? So first, let's try to define what is MEV. MEV was first coined as minor extractable value, but now has been recoin as maximal extractable value, and maximal extractable value is this hidden power that the block producers have, and what this hidden power allows them to do is the ability to arbitrarily include, exclude, or reorder any transaction in the block. Of course, this is a bit of a problem because right now, with the introduction of MEV Boost, we're incentivizing the block producers to only care about the maximization of the profits and not care about like the overall healthiness of the network. Before, block producers, no, miners, only had the source of revenue, which was gas fees, but with the introduction of MEV Geth and also the boom of DeFi Summer, then suddenly, maximal extractable value became a thing, and Ethereum kind of like turned in the wrong direction and starting hurting what makes Ethereum great, which was their users. But in reality, where does MEV come from, no? MEV comes from two ways, from either the execution layer and the application layer. In the execution layer, it comes from the fact that as we just saw, that the block producers have this sort of hidden power to order the transactions in their own will. And basically, like as we all know and we've seen, data shows that they're constantly doing this. But not only that, it also comes in the application layer because it is important to realize that the different trading mechanisms that you use when interacting in Ethereum will expose you to less or more MEV. So be careful out there choosing your trading mechanism when you're executing your trades on Ethereum. Not only that, but it also comes from the fact that we're always gonna live in a world that there's gonna be difference in prices between the reality that's happening off-chain and the reality that's happening on-chain. In other words, there's always gonna be latency arbitrage, kind of like this competition to get the opportunity to buy cheap in either a Uniswap or whatever and kind of sell at a higher price in a central exchange. And lastly, what is truly like a little bit the nonsense in here is that even though the transactions are truly atomically happening in Ethereum, the prices are not. We often see that we have blocks that have multiple transactions and they're happening atomically at the same time. But if you kind of look carefully at the data, you can see that there's a price disparity with the same token pairs and even in the same trading venue. This is a big issue in finance because it's very nonsense that the transactions are happening at the same time but the prices are completely different. And now that we know the definition and we know where MEV comes from, let's see what you can do with the power of inserting transactions at your own will. So there are three main forms of attack in MEV that are well known. The first one is front running. And basically front running consists of any transaction that has any sort of value such as like a liquidation on our arbitrage will go from I get it to basically the block producer get it. And they do that because they have the power to insert the transaction wherever they want. But not only that, the irony is that if I send the transaction to kind of get the liquidation through the mempool, what the block producer will do will replicate the transaction, put their transaction in front of mine. And even like the ironic thing is that my transaction will also be included after so that they can earn the gas fees that I've paid and in the end my transaction gets reverted. Then we have back running that even though it's kind of notorious that people argue that back running is less harmful in the ecosystem, one can argue that it's still back running is harmful because it's still taking away the opportunity from someone else. And basically this is if you're like a large hedge fund or a whale or like a big trader and you're doing like let's say a million dollar trade against a single AMM, you're gonna like leave the reserve pool, the reserve prices of that AMM on balance in comparisons to the other AMMs. Of course you know you're gonna do that because you know what you're doing and that means that your first trade is gonna create kind of like an arbitrage opportunity to rebalance the other pools. And you can try and sequence the trades in a way that you are the ones that snatch that opportunity. But because you don't have the power to kind of sequence the trades in the order that you want, mainly as soon as your transactions hit the mempool, someone else is gonna take that opportunity from you. And lastly, the most famous one, the sandwich attack and the one that is most helpful to the users. And the sandwich attacks happen because in reality you think that you're placing a market order when you're trading on an AMM or an aggregator. But essentially what you're doing is setting a limit order that is controlled by your slippage tolerance. And this is how the block produces no take advantage from you because what they do is basically insert a transaction in front of yours that pushes the price up to your maximum slippage tolerance pain point. Then insert your transaction so push the price even higher to later on execute another transaction in the opposite direction. And what this finalizes is that the miner has been able to make profit at your cost by basically buying low and selling high at the expense of you getting a very bad price. But how damaging is MEV? Well, according to Egen-Fi website, which is a website specialized in DeFi and MEV analytics throughout the last month of September in the last 30 days, 90% of the top 10 exploited contracts are either AMM or aggregators. Not only that, but 10 out of the 13 billions that MEV volume has moved in September have been used to perform sandwich attacks. And as we just saw, this is the most helpful attack for the users because it gives them the worst price. And lastly, change sign analytics using the data from the FlashBoards team has estimated that since 2020, there's been a total of $1.3 billion of MEV extraction from the users. Now, why are these numbers of problems? These numbers are a problem because Ethereum truly wants to become the world computer due to its ability to settle transactions in a decentralized, open and atomic manner. We need to try to fix MEV and we need to try to fix MEV because I think we all want to and believe that Ethereum will indeed become the world computer and absorb all the transaction value of the world. And then if that happens, the logical thing to say is that at the current stage of things, also MEV is gonna increase. And if MEV increase, this is gonna poke the regulators and basically the regulators are gonna come in and cannot try to dictate how we should operate the market. We've already seen that in several reports from the Bank of International Settlements, how they try to establish, like whether front running or sandwiching is illegal activity or even more particularly in Europe, where I'm from. We can already see this in the MECA regulation that current like the current forms of front running or sandwich attacks will be deemed illegal under the SMA market structures. This of course is a problem because I think we all believe, we all don't want to have the regulators to come in and dictate how the market should run, but rather we want to just build technical solutions that like address this problem so that the regulator doesn't have to step in and kind of like ruin the party. So where is COUP protocol? COUP protocol is the trading mechanism that underpins hopefully now the famous UI Couch of Exchange. And it's similar to an AMM or an aggregator, but with the fundamental small difference that we add a theme batching layer on top of them that allows us to execute, sorry, that allows us to aggregate multiple trades together and execute them in a single Ethereum transaction. Not only batching allows us to do this sort of aggregation for transactions, but it also allows us to give structurally better prices via COUS which stands for Coincidence of Ones. And these give better prices because if the counter opposite orders are in the same batch, we can match the user peer to peer and therefore they don't need to go to the liquidity pool and thus save on transaction cost or liquidity provider fees and on price impacts. Batching also allows us to be the sort of meta-dex aggregator similar to Sky Scanner. We can query all the AMMs or all the liquidity on chain as well as all the other aggregators so that in a sense your kind of baseline price is always gonna be the price that the AMM or the aggregator gives you, but because batching offers certain benefits, we almost always improve it. Then it also offers MEV protection because one of the key reasons for batching is that the batch executors have to guarantee the price that you get. So either you get your price or your trade is not gonna go through and thus you're not gonna be faced with failed transactions. And lastly, for all the if-maxes that we're all here, it also allows us to do gasless swaps which basically allows you to pay the gas fees in your cell token. And you don't need to if actually for trading on CouchUp. So how do we actually reduce the MEV on chain through batch auctions? Well, the goal is that through batch auctions we want to reduce the overall interactions with AMMs. And if we have to go to AMMs, then at least we're gonna try to diminish the level of exposures that the trades are gonna have against MEV by applying certain rules to the batch auctions. The main way to actually reduce MEVs, as we just saw, is executing coincidence of ones and because you don't need to trade against a liquidity pool and the trades are much completely peer-to-peer, therefore there is no matter in the order of those transactions because it's a pure simple transfer between two parties and there's nothing like no one can get in the middle. Then second, if we have to go to the AMMs, then we try to break order dependency by having a single price per asset per batch. Basically, this is achieved because every single batch settlement that happens in cloud protocol has uniform clearing prices. And uniform clearing prices means that the people that are trading the same token pairs in the same parts are always gonna get the same price. Unlike what is happening right now, that we see a lot of price disparity. And this is guaranteed because the executors of the batch commit to a price vector that regardless of the order of the trades are always gonna give the same outcome. In other words, the order of the factor does not alter the product. And lastly, batch auctions allows us to re-aggregate a fragmented liquidity via ring trades. This is something very interesting because it allows us to actually match different users without the need to go through many liquidity pools. And for example, here we have a batch where we have four different users and where we have kind of a coincidence of one in a ring trade, where the four different users are trading four different tokens and they're all trading in the same batch. And without having to touch an AMM because each user is kind of providing the liquidity needed for the other user kind of like in the circle. So in the first one, it would be like in the, oh, sorry, in the top now we have die against aura and actually the liquidity for the first one that's selling die goes to the other one that's trying to buy USDT and so on. And like we make a circle, USDC, USDT, and USDC against aura. Now, how do we actually compete for MEV minimization? COUP protocol outsources the settlement of these batch auctions to a competition of third-party algorithms. Whoever gives whatever algorithm gives the best price improvement for the user and those that minimizes MEV the most is the one that actually wins the right to settle the batch auction. Not only they win the right to settle the batch auction, but it also gets rewarded for doing so. Currently, right now, there are 12 different solvers competing against each other for kind of minimizing the amount of MEV, or in other words, maximizing the value for the users. And they can be grouped into four different types of solvers. We will have single-order solvers that basically specialize of just settling one order in a batch. Then we will have batch count-dex aggregator solvers that specialize on finding this coincidence of ones amongst users. Then we will have mixed integer programming solvers which kind of are able to settle multiple trades against like Uniswap B2 or Uniswap B3 style kind of pool. And lastly, we will have the quasi-linear solver or quasi-modo that specialize in settling trades of the batch auctions in more fancy pools like Balancer. So what are the difference between the maximization and minimization mindsets? Is really MEV protection, is all the MEV protection out there the same thing? Well, of course not. Although one can argue that, in my opinion, no, Flashbox technology and CowProtocol technology are kind of two sides of the same coin. They're two sides of the same coin because both technologies absorb the settling of the transaction to a competition of their parties. And in that competition, the kind of the winner is the one that optimizes the bundle of transactions in the most possible way for the users. The difference here is who is the monarch in both systems. In the case of Flashbox, no, they're trying to maximize the value for the validators and thus kind of maximizing the extraction for the users. But in the case of CowProtocol, we're trying to maximize the value for the users and thus minimize the value for the validators. So where are Flashbox goals and mission? Well, Flashbox is a collective group of individuals that have done a lot of work in kind of highlighting the issues of MEV in the space and kind of educate a lot of people and make us realize what are the consequences of building systems that are prone to MEV. But from their website, you can take that their goals is divided into three steps. The first one is to illuminate the dark forest and they've done so via MEVExpect or MEVExplore. And basically, this helped educate a lot of people within the Ethereum community by putting a number and seeing how helpful MEV is. The second one is democratizing extraction before MEVGeth or MEVboost. The extraction was only available to a very few amount set of players, but now with the democratization of their tool, a lot more people can do it. And while it's good that a lot more people can actually do extraction, we need to try to realize that we're kind of democratizing a weapon that's harming the overall Ethereum users. So it's kind of like a tricky situation here. And then lastly, distributing the benefits. This is still not very clear part or very clear how they're gonna achieve it, but right now, one can say that they're redistributing the benefits to the wrong people because the benefits right now that are coming from MEV extraction are going to the validators, which are not the ones that are creating the opportunities because in the end, the opportunities are created by the traders. Are created by the traders, yeah. So what are COUP protocol's goals and missions? Well, COUP protocol goal is to actually achieve one single price per token per batch and we want to try to achieve that by basically executing one batch settlement per every block. But if we are to compare as well into three main points, we will have that the first one is protection from the dark forest. And basically we do this by executing the coincidence of ones where the user doesn't have to go against the liquidity pool and also through a delegating trading model execution where the user doesn't send the transaction directly to the mem pool but rather sends it to an offset, an off-chain set of relays that will be the ones that kind of like handle how the transaction sits in the mem pool. Then the second one is if we have to go to the AMMs and if we have to go to the mem pool, we try to avoid extraction by enforcing certain rules to dispatch actions. And the most important rule is the uniform clearing prices which in the end breaks the order dependency and does makes those trades much more or less immebiable. And lastly, distribute the benefits. If you're trading on couch up already today, you already know this. If not, I recommend you doing so. But already today, kind of like the price improvements that these so-called solvers or searchers are able to find are giving to the users instead of being kept for them. And for example, in this case, we can see the kind of like the batch in the middle that there was like 18 different trades and on average, there was a surplus of 2.5% for each order. But to sum it up, how are they different? In the case of cow protocol technology, if we look at the key metric that evaluates the success of the technology, is the overall reduction or overall reduction of the exposure of MEV. Versus in the case of flashback technology, the key metric is how much MEV is being extracted. Looking at the World Democracy section, one can argue that cow protocol technology is democratizing the tools for protecting users. Versus flashback technology, that they're democratizing the tools for extracting value from the users or from attacking the users or hurting the users. And if we are to look at how these two different technologies interact with on-chain, the goal of cow protocol technology is kind of reduce the amount of AMM interactions that the users have, because in the end, like AMMs are the reason that MEV exists. But in the case of flashbacks, they want to maximize the amount of AMM interactions because these ways, they can maximize the slippage tolerance from your trades and kind of extract the most value from you. And lastly, if we look at how both systems kind of play by the rules, in the case of cow protocol, we see that the more money to the users, the less MEV and the higher the chances of have for winning and the right to settle the batch. And in the case of flashbacks, the more money that goes to the validators, the less money that goes to the user and therefore the more MEV, the higher the chances you have of winning. So where are we heading? As I said before, not all is lost. Like we believe in building technical solutions that kind of address this type of problems and we think we're on the right path to kind of like reduce all the big chunk of MEV that is happening right now on Ethereum. So what is the future of DEXS? We believe that the future of DEXS is one that focuses on fairness and cost improvement for the users, rather than just let them trade in kind of like some optimal ways. It is one also that offers MEV protections because as we said before, if the transaction value in Ethereum is gonna increase, MEV protection is gonna become more and more important. It's also one that puts the users at the center of it, in the end in our system, the users are the monarchs because they are the ones that are creating the opportunities for different price improvements. So they are the ones that should actually be rewarded for it and not other parties in the system. And lastly, it's one that abstracts users from complicated technology. It is unrealistic to expect that everyone is gonna know what is an RPC or how to add an RPC or even stay up to date on all the different liquidity pools to trade your token or what is their like hottest new DeFi like trading venue. And how are we gonna get there? What does the future of finance look like? Well, the future of finance looks like one that we have a cow batch builder where this builder commits to have the first transaction of the block to be a cow protocol settlement. And this is important because if the first transaction of the block is a cow protocol settlement, then we're gonna have uniform trading prices in all the trades that are happening within there. And therefore there is no MEV that can happen with the trades. Then if that's the case and we have that first transaction, then the transactions that are gonna come after are gonna actually be like true intents of arbitrage from the market and we're gonna be able to like have the overall Ethereum ecosystem in a sense focus on the real market efficiency because right now a lot of the arbitrage that's happening is toxic arbitrage and it's not arbitrage from the market but rather the leftovers that the MEV attackers are kind of living in there. And lastly, it would be like the combination of the utopian side of the flashback technology with cow protocol. So how does this look like? Well, currently we have this scenario right now in Ethereum where we have the mem pool and we have the different searchers of private order flow that submit their bundles to the builder and then it goes to the relay and the validator. But for us, the key is to kind of break the order and kind of transform searchers into cow builder and put cow protocol and cows up in the middle of it in a way that if we convince builders to focus on the utopian side and kind of shift the revenue mindset from hurting users to actually protecting and maximizing to the value of the users, then we're gonna have a much overall better outcome within Ethereum. And will the market fix MEV? Well, the question is that if MEV maximization takes over, we will have not built the future of finance but rather have just built the new old system but just with new rails. So help us build the future of finance because we're hiring for a lot of positions and thank you very much. Thanks, John. Hello, Alex. Ah, sorry. No problem. Question. So the batch doctrine process you're describing is one in which you have a bunch of orders from individual traders and then a collection of solvers each submit a price vector that can satisfy all of those orders. How do you get the individual traders to commit to an order without them knowing the final price? Well, basically it's like they see in a way worse is that when you go to cow swap, you sign a message with your intent to trade. And basically your baseline price is the quarter price that we give you. So from there, the solvers start working on trying to improve the price. So you're always at least at base, you're gonna get what we have showed you in the UI. And from there, if there are price improvements that the solvers can find, be a coincidence of one or some sort of batching, then it's gonna be rewarded in the form of surplus from you. So you're gonna get more. How is the quarter price calculated by basically looking at the on-chain prices and from there, like we discount the gas? Okay, here. Sorry. Thank you for the talk. The question is, do you have any guarantee that the individual user is going to have its trade executed in a batch? Like the way it works is that you sign a message, no? And then if your prices get out of market, then the trade is not gonna execute, but you're not gonna get charged for a failed transaction or anything, because simply the trade doesn't execute. So in a sense, like the guarantee is that if your order is more or less within the market pricing, then within a matter of 30 seconds to one minute, it's of course gonna be included. Hi, I'm here. Sorry. Hi, thanks for your thought. I was just wondering, you can pair FlashBulls and Cowswap, but isn't Cowswap solving for the subsets of the MEV that FlashBulls is trying to solve for? And also, how do you feel about MEV maximization with MEV rebates being equal to MEV minimization? Can you repeat the question, sorry, I didn't hear you. So you can pair FlashBulls and Cowswap, but how do you feel about, to me, it seems like Cowswap is solving for a subsets of the MEV that FlashBulls is trying to solve for? As in, for example, you don't solve for illiquid pairs, you only solve for MEV that goes through AMMs. But FlashBulls is not trying to solve for MEV. FlashBulls is just making a tool that is making MEV extraction more excessively common for whatever user. But in the end, the goal of their action is that the higher the more MEV, the more I'm gonna pay and the more likely I'm gonna be included, like my bundle is more likely gonna be included on the next transaction. And they do that because they're in the execution layer. And the problem is that they are able to do that because the trading mechanism that people use, like AMMs, expose their users to MEV. But what we try to do is kind of like fix the MEV at the application layer so that then FlashBulls wouldn't have like a way to extract MEV. So if like, you know, in the end, if the servers kind of like find the optimal prices and uniform clearing prices, the MEV that will go to the block producers is nonexistent because there's no, like it doesn't matter the order of the transactions. I don't know if I convinced you. Thank you.