Surviving MEV: How DeFi Users Lose Value
EthCC[8] · 2 Jul 2025 · 19:31
Sergej Kunz examines MEV mechanisms and losses experienced by DeFi users. The presentation discusses existing protections and presents measurements of value lost across protocols and chains.
Speakers
Topics
From EthCC[8], hosted by Ethereum France.
Transcript
[Music] So hi everyone. It's a pleasure to stay here at the GHCC and today I'm going to speak about surviving math. How defi users lose value and what we can do against it. What is math? Math is a maximal extractable value.
So when you interact with the blockchain, you create do a swap by yourself. You create the transaction by yourself. You send the the transaction to RPC endpoint. Most of the cases you send to a public RPC um endpoint with a public me. So other participants in the blockchain can monitor and can analyze your transaction and try to extract value. Normally when you swap on the DAX you swap with a maximal acceptable price impact.
This is because of the architecture of taxes u the c the the thing what you necessarily need to set to avoid failed swaps for transactions if the rate changed a little bit. Yeah. So and meth attackers uh very often use the sandwich attack. They see your transaction, they take it, they create a bundle, use maybe flashbots and make a transaction before you transaction, after your transaction.
They bundle it and set with a priority for the execution and send it to the block builders. Block builders are doing it because they make money out of it. So the uh uh attackers paying to to uh block builders for actually from our point of view it's uh extracting not in legal way value from user swaps. We have seen one one billion US dollars stolen from users through math attacks only in 2024 and this is around 10 percentages of all swap transactions.
So back in 2019 there were only a few um few u math kind of uh extractions. I remember when I have first time heard about flashbots. Uh these guys actually build it to help help people who were in a position that they had something in a smart contract but couldn't withdraw it because they could be front run. So I think Andre Croner was also participating in the first uh extractions.
Um and they helped they kind of white hacked some some of the cases and helped people to to to get the money back. But after a lot of people recognized they can make money out of it. And you see we reach already 1.1 billion of US dollars in 2024. that it's uh 2025 looks much worer. So this is a nice solution what um with with what cow swap first came I think it was 2022 um beginning of 2022 maybe end of 2021
kwap team taugh how to prevent math math attacks and introduced um intentbased swap One is followed but with own architecture own solution and after us unis swap deployed unis swap max also based on our tach with the douche auctions. If you look in the co solution, user create aura and the aura is shared with their kind of private aura book and there are solvers.
Solvers are looking for the optimal call data what would benefit a lot of a lot of uh users. what's uh created aura and these auras can can be batched can be batched in a in a batch where um also auras can be matched with each other. The thing is that the settlement is done through drivers and the driver need to stake what I know 500,000 USDC cash and 250,000 US in cow swap token.
That means we have a safety bond of $750,000. But we have we see right now a huge amount of volume going through the protocol. So people need to trust a protocol here. In this case they need to trust the drivers that they do the right thing. We have seen also some manipulations. Um I call this approach uh enforcement by rules, human rules, paper rules. It works. It works in in a lot of cases very very good. But you have the other side of the metal. It's uh centralization and you trust.
If you'll take a look on uh Unisoft solution, they introduced um uh the based on auction um you create also order. You can share it um with the um unis swoop API. It's shared with the market makers and they settle. They mix little bit up with RFQ system. So some orders are not sold through Dutch auctions. Some of the orders are uh taken directly by the market makers.
It's in in a lot of cases much more um efficient. But again you have kind of one decision maker who say okay market maker gives better rate but is is it true you never know no one knows except the team. So maybe they can make money out of it and uh not selling it through Dutch auction but selling to the market maker and and getting maybe profits one in we were thinking about how to solve the math problem and avoiding centralization because our value propositions are non- custody and atomic execution.
So what we did we just use our limit order protocol we wrote an extension what everyone can do like we have different extensions as well at for limituras um you can actually implement almost everything on that it's just intentbased protocol where you just sign an aura offchain and it's shared with the with the market makers uprust traders the we call them resolvers in our network so the the user submit the order. The order is going through um our relayer infrastructure for EVAM compatible chains. We have a new thing since this year we launched on Salana. We use onchain notification of
the aura. So publication of the aura. I like it very well because it's introduced like a good grade of decentralization. So you do need a centralized uh relayers who forward your orders to the market makers. Market makers see them directly. We extended our intentbased swap protocol also with a crosschain functionality by using hash lock contracts. It was very interesting uh to discover that after we invented the approach with the intentb swap and Dutch auction with the price finding mechanism I will explain a little bit later about
that we uh came to the solution that actually what is already existing since 2013 2013 what was invented for the bitcoin blockchain the uh hasham lock contracts escrow contracts we can actually use to introduce uh intent by swap also crosschain. So user create aura it's shared with the rele network um it it goes to the market makers and as soon as profitable for the market maker they start to settle they create um on source chain and escrow on destination chain escrow the client application verifies that it was done as how it should be done. So
the user get this right amount on the escrow and assigned to the wallet of the user and the application share a secret. It works like with a password and then um the market maker can um um finalize the flow. It's fully automic. It can be also black if the market maker is not settling. There are some safety deposit small one so the other resolvers can uh continue to settle or um pay back to the user. So it's fully automically and non- custody.
So if you take a look on a um comparison um math protection by architecture design I call it it's us and unis swap. Math protection by trust is cow swap. We have price impact reduction. I will show you in the next slides. Uh what is also unique unique feature what we have it's uh it was very also interesting to discover. It was somewhere I don't know one of the events I was spoke with some people and u I got um a picture in my mind how we can do it very nicely and um generate surplus on the 10 base swaps what our user get
we were able to collect surplus for the we were able to organize more supplies for the user since December 2022 in amount of 28 million dollars. I will show you a real world example. It's um it's a new 911 what you can get by using our tag. So um we have um partial fields. It's one thing what we invented as well with the Dutch auctions. What unis swap still don't support. How how I know um and this is this is one of the best cases what shows that everyone is cooking own soup right? We need a standard what everyone should align and improve and we
all should use one network uh instead of like cooking own soup and having own resolvers on networks and and building different things and uh also missing some features. Partial fills allows us to generate the suppressor plus I will show you as well. So gas adaptive pricing is a is a thing uh what I came to um when you create an order it's Dutch auction the prices are fixed the auction is fixed but the gas price change in the process and our settlement contract uh can adapt to the gas execution price changes. So the settlement um uh happens um how it should happen um for the small amounts
immediately for bigger amounts we try to sell over time to to extract more value and more spread surplus for from our users exclusive API you unis swap introduced exclusive API we didn't we didn't do that at the beginning uh in terms of like um we want to drive decentralization and exclusive API Okay. Gives more power to the centralized entity to decide okay what what is the best for the user. Uh in our case we uh just extended our Dutch auction and set priority period. If someone wants to settle for the higher price than the Dutch auction they can and they have little bit time slot to do that.
So they um if they don't if they fail other market makers can still continue to settle and there are no disadvantages for the user. It's like enriching aura instead of deciding who is the best. No inter interface fees at one in cow swap I think cow swap did AB test or something with the with the interface fees and had some discussions in the in the d from my point of view we are too early to extract value from the users. We need to prove that our cash is the best cash and our traditional finances will come and use our cash and as soon they come we will we can generate money when when when they are there but uh as
as uh as long we need to prove ourself we need to prove that we have huge amounts of volumes from our point of view it's too early to extract anything out of it. So and crosschain swaps unis swap unis swap introduced um integration of across and across is kind of bridge of assets. It works very well very it's very fast but uh then it's at the end again the same situation here centralization custody service and you need to trust that these guys give you on the destination chain these tokens what you what you want.
Um yeah, G swap I think they're cooking on own solution again. So that's why I'm asking again everyone just let's sit together let's build a protocol. Um I think unis swap tried with someone with a cross together to build something we weren't not we were not involved we tried to be involved and it's a little bit hard to push through uh but I have still hoped that we can work all together. So um we have gas wars. This is disadvantages um of Dutch auctions.
Um it's a competition between between arbiters traders, market makers. Um the price um we try to sell almost on spot price. When someone tries to swap at 1 in, the protocol sells starts to sell from spot price and it goes down to the market rate and most of the cases market makers start to um increase the uh premium for their gas execution costs to be the first only the first can take what they want to take.
So Dutch auction um here's a real world example. Someone exchanged 12 million USDT to WTH uh and this guy got 29,000 was loss more. It's the new 911 turbo maybe turbos in in the lower package. So it it happened only uh because partial fills were allowed. We started to sell from the spot price and went down to the market market rate. And uh this is maximum acceptable price impact where you get sandwich on the on the on the classic swaps when you do the transaction by yourself. So and so market makers started to settle here. We are we have like 13 market makers
arbitrage traders who compete to each other. So and uh you see normally they arbitrage with centralized exchanges. They borrow from a settle and then withdraw from centralized exchange or a bridge from um through USDC native bridge or something um to to other blockchains. So when you swap on base and you exchange a lot of Ethereum, you have much higher price impact than on Ethereum and is the arbitrage opportunity for the market makers. So we turn it a little bit around. We went away from classic swaps where the user was there was responsible for everything and took all the risks of math of uh of failed
transactions. We said okay there are professionals who want to make money. We will create a marketplace and our protocol sells orders to market makers who want to make money who are professionals. So it's really nice nice um nice example here with 200k and this guy just got it because they used our tech. This is um the adoption of uh gas execution costs. So if gas uh became more expensive the price point goes a little bit down but still in acceptable uh range and not less than min return of the user.
So um crosschain how already said we used the intentbased protocol we extended with HTLC's there are some projects who are working working on HTLC's but no one combined intentbased protocols and we also didn't expect this it was just uh like um discovered by us and we found out it's it sounds cool it was still experiment and we were able to deliver it last year in September and also by crosschain swaps is based on Dutch auction M protection by design by architecture design and always competitive environment. So we avoid decentralization. So we have a competition in um in in our network.
That's it. Thank you very much. Um if anyone has uh have questions, we have one one half minutes. All right then. Thank you very much. It was a pleasure to be here. Come to our booth. We have uh nice uh 1in token air drop. Um you can get um small chip NFC um and claim some 1 in tokens to play around with our 1 in network and our 1in wallet and get some of our merch. Thank you.
[Music]