DappCon 2023: MEV Transparency - Ensuring Fairness In DeFi Markets - Olga Fetisova
DappCon 2023 · September 2023 · 21:30
Olga Fetisova discusses MEV transparency at DappCon 2023, covering efforts to make the value block producers extract by reordering or censoring transactions more visible in order to ensure fairness in DeFi markets. The talk covers what transparency around MEV could change for traders and protocols.
Speakers
Topics
From DappCon 2023, hosted by Dappcon Berlin.
Transcript
hi everyone thank you for joining as um was mentioned my name is Olga fisa and today we're going to be talking about me metrics and how to actually ensure fairness in defi Market um so the first part of the talk I'll be focusing mainly on what me is what it means for us what it means for the community we'll cover some uh metrics we'll go through some stats and the second part of the talk will be focusing mainly on the transparency initiatives challenges and Solutions so what is me can you please raise your hands who actually know what me means for us and for the community great I see quite a lot of hands but how many of you actually know whether you've been me attacked before or
not wow quite uh less hands I guess um so let's get into that then and figure out so while blockchain Network ensures all transactions and are valid and new blocks are appearing preventing the downtime it is actually not a require not a guarantee that all transactions will be ordered in the exact same manner they appear to the blockchain while block producers have a full autonomy of selecting the transactions whatever transactions they want to include in a blog because each block has a limited number of transactions usually they uh order transactions by the highest gas price as we see here and uh which means they have a full autonomy of censoring and
reordering transactions uh extracting what is so-called known maximum extractable value so in other words me is the profit that can be extracted by miners or other actors of the blockchain network who can uh insert remove or reorder transactions making it more profitable for themselves according to flash Bots the organization that focuses on me research nearly half a billion dollars has been extracted just this year from me opportunities just since the merge so can you imagine what number and this number this value actually accounts for
the number that's been paid to validators only to the ethereum validators which means the attackers actually earned way more than that and we'll get in a few slides why so to put this uh in a perspective it creates a very uh big opportunity right on certain dat ethereum validators earn way more e while extracting me opportunities than from uh executing the transactions from then from the transactional fees while some M activities are legitimate uh making sure that the transactions are indeed ordered in the best possible way it also creates an unfair advantage and manipulative
practices so today I'm going to be focusing on the most uh occurred common L occurred damaging types of M and I will cover uh these three types specifically I'll talk about front running front running is uh when a bot spots an opportunity sees a transaction in the public men poool and then duplicates this transaction and places this transaction within the same bundle in front front of the victim's transaction benefiting from the opportunity back running is very similar but it's the other way around so basically the attacker has Place places the transaction right at the end of the users's transaction right and the at the
end of the victim's transaction while front running and back running is not that common by itself a combination of those two is a very common attack which is called a sandwich attack so a sandwich attack is basically placing both a buy order and a sell order in between of the victim's attack creating so-called sandwich attack with the victim so let's look a little bit closer in the sandwich attacks since it's the most one that you can find in my many blocks so how does sandwich attack occurs first of all a user places a transaction so imagine a high transaction uh is placed in a public M pole a but uh user very important indicates a slippage so that's basically
a tolerance a user's tolerance toward the price change so the user says okay I'm allowing the price of the token to change to this a certain amount a bot knows that so what do the B do aot front runs this user by placing the transaction right in front of the victim's transaction which causes the price of the token to go up which means well consuming the maximum slippage of the user which means once the user's transaction is executed it is executed already at a way higher price which means this the the user loses right what does the bat do at this stage the boot places is a sell transaction right at the end of
this um right at the end of the sandwich uh at a very very high price of the token and sells the token which causes the token price to go down which again means that the the user loses so the both benefits in the in the meantime um by benefit by getting the difference between buy and sell order and the user and the user's transaction is executed at below the mark market price and the user gets way less tokens that they could could have actually gotten before right that's not fair so now this is this is just an example but let's look how we can actually spot this transactions the sandwich attacks within the block it is quite simple to find out
uh if we start analyzing the block uh if we see for example in a block the same token traded multiple times the price difference would be most likely the gains are earned and this would indicate the sandwich attack so here we can see um an analysis from Zer Mev another organization who is focusing on MV research um here we can see already an analyzed graph but as I mentioned um we'll see here that the Die For example is traded multiple times in a block which means that that was a sandwich attack and indeed it's already marked there that this is a sandwich attack so again let's look at the same block this is a randomly chosen block by me and we can see here immediately on top of the
analysis that the attack well specifically three sandwich attacks has caused nearly $40 in user losses while the last transaction in a block is actually a payment to the minor which means that the minor got 0.41 e which again indicates that the attacker has earned even more why because the attacker obviously needs to pay some bribe to the minor and they need to make sure that the this transaction is profitable for them to put this in the perspective the average payout per block hovers around $100 which is the modest 0.06 e but obviously depending on the price but on certain days when the market is volatile
and there are a lot of trading activity this value can reach crazy numbers so let's look at a slightly different block this block I chose within the time frame what that uh when FTX was crashing and here we can see well slightly or completely different numbers right so here we can see immediately from zero MEF stats that from uh this specific block the bot has caused over $6,000 of losses to the user um exploring the M opportunity and the payment to the to the minor was 3.6 e which means that the gains from this attack were even higher than that
according to the block magazine one of the famous me Bots have earned within that time frame millions in proceeds the report states that the bot actually earned $34 Million by m opportunities in just three months can you imagine crazy numbers no wonder why this is a very very attractive opportunity for Bots according again to flash bot's dashboard the transparency dashboard that is publicly available we can see that this opportunities come from various dexes and here from this pie chart we can see that most of the dexes don't actually protect you from these me attacks here you would see that most of the attacks coming actually from Unis
swap V2 and V3 that doesn't necessarily mean that if you're trading on Unis swap that's it you should not um that means that Unis swap actually has the most of the liquidity available there and even if you trade uh through different Dex aggregators most like your transaction would be rerouted through Unis swap or one of the other dexes remember in the beginning to ask how many of you actually know whether you've been meev attacked or not before it's quite simple to check it out um one of the easiest way to go to zero.org you can all go and check it out place your either wallet address your transaction hash any block you want to analyze and the the tool will actually tell you
whether you've been attacked before or not quite simple right so I'll actually will invite you to check it out afterwards um so as you know there are a lot of opportunities being extracted and as well as a lot of research being done to prevent this opportunities right now we have a lot of organizations and some of them I already mentioned in this talk that focus and specialize in M research among those organizations we have flashboards that I've mentioned few times in this talk we have agen fi we have Zer that I also mentioned in the talk and all of them dedicate a lot of resources to actually understand and evaluate the situation but that doesn't really protect us right
so today I'm going to mention two ways that you can already protect yourself one of the ways would be using an additional RPC endpoint for those who doesn't know rpcn point is the way within blockchain application to communicate with the blockchain it is a request response based model that sends uh where where an application sends a request to the blockchain and it receives a response with a requested data it is insanely simple to adjust it in your favorite wallet such as metamask wallet with just a couple of clicks among those RPC end points we have a few famous ones M blocker MF share backround me and some other ones they're quite simple but
obviously some of them have uh more advantages than others and uh let's look a little bit closer in me block blocker um why M blocker is special so first of all as I mentioned it is very simple to adjust it in your wallet your favorite wallet such as metamask wallet with just a couple of clicks and uh what it's going to protect you from first of all it sends all the transactions instead of the public M Pool it sends sends it to me private pool so that means your transaction is actually never exposed publicly right so that means that the Searcher does not really know about your transaction additionally it adds fake transactions to confuse the Searchers on the
truthfulness so that they cannot try to probabilistically attack you and as an additional thing it offers you a rebate on your trade so while it protects you from front running it allows still back running while it allows back running it guarantees that at least 90% or more of the value will be forwarded back to you great right so M blocker is relatively new but it's gaining its popularity and um today it's already protected over $16 billion in volume while saving 370 e that's quite a simple way of protection but as you can see numbers are great um for you I added here a QR code
in case you want to scan it and add it immediately to your wallet again it's just couple of clicks and you're going to benefit from that so as I mentioned this is one of the ways to protect yourself another way to protect yourself would be to use a dedicated dab that already protects you from me opportunities and one of these dabs that I'm going to be talking today is the cow swap how does cow swap protect you from me so cow swap is a nadex aggregator that combines the best price so it matches your order with the best liquidity provider on chain and on top of that it protects you from M opportunities while it's already using me blocker it also focuses on three main principles or features one of them is
the delegated trade execution which means that your transaction is executed by so-called solvers who are the ones responsible for your transaction so at no time you are actually out there in the public M Pool so you're never going to be affected the second feature it's the coincidence on fonts that's where cow comes from C which means some of the orders are actually matched offchain great right and then additionally on top of that it provides the uniform clearing prices so that means that the price of the token within the batch is going to be the same so these two methods that I mentioned RPC endpoint and cow swap are just the ways that we can currently
protect ourselves from me opportunity from me attacks however that doesn't really eliminate the problem right the problem still exists and the Bots keep finding new and new ways to attack us and to steal our precious e or precious money there are a lot of challenges one of the challenges in my opinion well from the data perspective is the data availability obviously not all of the data is public thus for example centralized exchanges do not actually share their data so it is quite hard to get a full comprehensive picture on the scale of this problem thus make a good solution and well propose a good
solution and solve it um while there are a lot of organizations that focus on M research and actually try to figure out how to solve it within the community there are some solutions available that we can talk after the after the talk and discuss that um however this is also a call to the community Ms um challenge possesses a significant challenge but it also creates an opportunity an opportunity for the whole Community to come together innovate and ensure that ethereum remains the golden standard in the blockchain network thank you thank you so much Olga who has
questions let's start there hey uh thanks for sharing great great talk um just a quick question what's the business model of the M blocker do you like background the transactions yourself and then you share part with the user and then keep part as like a revenue or well right now there's um there are a few models that being discussed but right now it's uh there is nothing no gains pretty much so that's why it's a great opportunity for everyone to use the same is actually with cow swap um either uh there are no profits profits made so so that's a good opportunity for everyone to use it and explore it while it's free perfect I
love public goods uh and then the last probably question uh so it's on eth obviously on ethereum right but any other chains um that you're covering or maybe from the M perspective any other chains where you see it as a big problem as well um well I'm covering or you mean the the okay M blocker yeah so right now we're focusing uh well the cow swap is focusing on um uh e and nosis but we're also discovering that um we need to integrate with other chains and we're working on that thanks thank you we had the question over here yeah thank you for for the information uh I had one question
regarding um FH these schemas about full homy encryption uh and uh given that that goes against you know the mvv everything being public on that uh men pool how do you how do you see all all these uh me based attacks and uh even Flash the flashboard community when smart contracts actually start using this FH schema uh for for being able to compute data without actually decrypting the the data first so how do you do you see me going completely away or just a good me being uh being kept as you can select of course which parts of the transactions will be encrypted in the
menol so so yeah how how do see all that yeah thank you for your question I think the previous question was asked also in the in the talk before that and indeed this is uh still unknown how it's going to be treated but I don't think in my opinion me disappears well first of all while the transaction is going to be encrypted uh there's somebody should be able to validate the transaction right but even if they know if they don't know the the the transaction itself and they get the key after they approv the transaction it still does not eliminate all of the me types right so for example uh back running is still an option in this case okay thank you yeah thank you very much for the
talk um I was curious how cow swaps approach uh compares to Unis swap X and 1in fusion in in terms of me uh protection thanks um so indeed there are obviously some competitor available right now a few months however we actually did a comparison on that and um C swap still offers quite a few benefits uh first of all it provides you some transactions that some transaction types that are not actually available then um such as 12 for example orders limit orders and so on um another benefit is that we actually batch the
transactions together and they are executed at a uniformed price which means that the price within the block within the batch is going to be the same which again prevents you from being exposed uh to some of the me opportunities okay thank you we still have time for questions if anybody has some more so you mentioned 320 eth have been saved uh I was just wondering how is that Quantified is this the total sum of rebates so far or something else yes um so the way for us uh actually the whole
data all the data for M blocker is all publicly available and you can find it on jun's dashboards and um well actually on the blockchain um so yeah the way um you can go and check it out how much volume it's been um feeding how much M's share is increasing how much M's blocker share is increasing and how much transaction been going through and how much um it we already saved why these opportunities all right anybody else for questions hi thanks for the talk um kind
of a more of a generic note so am I correct that like fundamentally there is no other way to protect against m apart from introducing more trust into the system so basically instead of using an open mol I trust a particular service be the cow swap or something else and U basically I say okay you can front run me but I trust you not to do that and you basically trade off trust for money yeah um yeah there are thanks for your note there are some solutions that are currently being discussed one of the solution is for example frequently batched auctions where the transactions are gathered together within a certain time span of a time so for example within a minute or so and then execute it at a uniformed price um which means that there is no way for the for the
attacker to actually try to probabilistically attack this trade because the price would be the same uh but again that doesn't prevent from all the types of am again front R um that prevents from the front running but back running would be still an option all right it seems like there's a lively discussion but it will have to be continued in the break thank you so much Olga thank you [Applause]