Tackling 2 Billion Dollar Problem In Production: OEV Design That Works And Scales

EthereumZuri.ch 2025 · 31 Jan 2025 · 22:01

Marcin Kazmierczak tackles oracle extractable value (OEV), which the talk frames as a two billion dollar problem, and presents an OEV design that works in production and scales. Speaking at EthereumZuri.ch 2025, he looks at how value leaked through oracle updates, often captured around liquidations, can be handled in DeFi protocols.

Speakers

Topics

From EthereumZuri.ch 2025, hosted by EthereumZuri.ch.

Transcript

[Music] hi everyone good to see you hope you had a beautiful morning now about the lunchtime today I'm going to talk a little bit about Oracle extractable value Marson co-founder of redstone uh the fastest growing Oracle on the market right now few words about us um so we did happen to raise $15 million last year of our Sera and keep growing in terms of of uh Revenue number of clients change supported uh fairly quickly so we keep expanding we support the two most popular Oracle models uh push Oracle and pull Oracle across evm and non evm

chains uh we're also supported by some prominent figures in the industry like stany from a sandep from polygon Alex gloski founder of ZK sync and so on so we do chat a lot with the people that are creating solutions that we support as the Oracle and for the price feeds we love doing research so whenever there's like a new meta new aspect before we go into that and create a solution we also like to understand it pretty deeply that's the reason we usually every quarter uh release a report about a specific topic that is very important for oracles we did so early in the days for liquid staking tokens for stable coins back in

beginning of 2023 as far as I remember um um liquid reaking tokens uh reaking and now we are preparing one for Bitcoin liquid staking and staking General with Babylon Lombard pump PDC solf and so on and we are a team of cool guys in a sense like we try to be pretty easygoing and open to everyone in the space while keeping professional because oracles the one single thing that they have to keep is reliability and making sure the price fits delivered are secure but we can do it still in a say open and nice way we don't necessarily need to try to be a monopoly or H do some dirty tactics like

maybe some other of the players in the market might do okay let's start from the beginning who knows what an oracle is raise your hand and who believes knows like how it works in practice like you know under the hood okay there's okay it's more technical than I expected you know you never know what's going to be the audience of your talk so why you need oracles oracles deliver data to daps uh for smart contract execution this is like a very broad description but then when you look under the hood it turns out that currently it's mainly Market data so about volatility market cap interest rate and so on so about financial products and then if you strip even further down it turns out that

actually over 95% are price fit for assets and and in those assets it's mainly crypto so Bitcoin e stable coins which sometimes are not stable as we know from the market uh and many other different uh categories like tokens and nfts question to you all what is the one most utilized price feed in whole crypto if if USD correct it's not Bitcoin it's not like s it's not like even stable coins like usdc because some people like to hard code that usdt or usdc is one to one with dollar uh which is one approach the other one is like you know if everything collapses then

it's good to reflect the market value if USD from that's a data from last year sorry I didn't update it but it's about 90% of traffic so nine out of 10 calls would go to eusd reason being ethereum is the home of defi like that's where defi started and you know uh is still very much active and there are a lot of l2s that utilize Eve as the main asset as for our traction we support over 100 clients on 60 chains and some of the use cases for oracles lending markets so oracles are used for creating positions and liquidations when they hit the liquidation threshold leverage protocols like gearbox Delta Prime uh cence uh reaking and staking this is a

category where we pioneered a lot so in reaking and staking you can take the market rate so you take the price of an asset that people trade on decent shes exchanges or you can take a kind of like fundamental rate so the rate from Redemption of the contract for example from R stake if to stake if if you take that rate it assumes that if Lio explodes your protocol is going to be drained as simple as that because you will be reporting that Lio still exists and is working functioning properly and even though for example r stti e would be traded at a discount on the market you would report still a high value and yield protocols but let's go to the crooks of

today presentation Oracle extractable value what it is so speed of information delivery matters and in Defi and finance even more who knows what that guy is who that guy is no spark very close but the guy name is PES so he was an Athenian career that sole job 500 years before Christ was to deliver a message that a um the battle in Marathon Was Won and he was supposed to deliver it to aens um Nike by the way is like the victory that

they they won he delivered it h said and then paid the highest prize you can so he went down on floor and died because of that quick run but over there the speed of message mattered and you can see it like throughout the whole history of uh mankind a modern example maybe some of you know I hope because it's a beautiful one Flash Boys raise your hand if you know the story Flash Boys okay half of the people know so it's a story of guys traders that created one in a 300 kilm 1,300 km of fiber optic cable worth 300 $ 10000 million from Chicago to New Jersey just

to reduce the latency of trades on um centralized uh stock exchanges and other venues that people trade with with from 17 to 13 milliseconds it's four milliseconds gain and apparently at scale with all of the trades they were able to front run all the other Traders so a Trader was looking at the trade was clicking enter and before his information got to the execution engine they already let's call it sandwich attacked him so either sold or bought quickly before so the person who intended to do the trade was actually crooked with his intention at the very beginning right now if you're interested in that story I highly recommend there's also a documentary

about that and I recommend uh Michael Lewis in general because this is the same guy that created uh The Big Short uh mball which is also a beautiful movie The Blind Side and also he created going in infinite about FTX and SBF I haven't seen that one so you tell me once you check out whether it's worth it or not but in general is a really good writer and Storyteller right so we know that speed matters throughout the history and now even more than ever so how Liquidations in defi are relevant for that when you go to AA Venus Morpho Landing protocols or other protocols that allow you to borrow something you put in a collateral let's call it usdc th000 usdc and then

you take a loan in Bitcoin let's say right now the loan would be worth $800 uh here I took uh $1,000 uh sorry here I took that the usdc would be uh $90,000 and the loan in Bitcoin is $80,000 worth in usdc and this is what the Oracle is updating and at a certain point if Bitcoin grows because efficiently your shorting Bitcoin so you you put in dollar you took out Bitcoin as a loan so you believe that Bitcoin is is going to drop in price and that happened a lot especially at the end of the last year when we broke $100,000 there are a lot of people a lot of activity on chain that people were trying to short Bitcoin because they thought okay now it has to plummet again

but then it kept Rising right it went above 100 and so some people hit the liquidation threshold their positions were sold of on the market and there was also a liquidation discount for the Liquidators themselves so that they're incentivized to actually close the position sell on the market and pay out the debt in the product itself Venus is the biggest Landing protocol on B&B chain right now sitting at above 2 and a half billion dollars in uh loans in assets inside so total value locked and over 30 days we analyzed the amount of liquidations and for the major purs so Bitcoin e and wrapped BNB it was about 1 and a half million dollars only in 30

days and it wasn't a very volatile uh 30 days actually we could have taken something even more volatile so there's a lot of money at stake how it works on ethereum for example right now with liquidations if Redstone or chain link or any other Oracle delivers price feed on chain that is going to cause the liquidation everyone sees that right because this is on chain and then what happens is liquidation Bots are trying to put a transaction of liquidation as close as the next one after the update on chain that allows for the liquidation so essentially the logic is update happens on chain of the price Fe from the Oracle

and then everyone is trying to bribe me Searchers to put their liquidation transaction as close uh to the price update as possible so that they get the liquidation bonus as simple as that on ethereum it's mainly flash buts but look ethereum was the home of defying the very early days but right now we have a lot of chains different block times different me searches on these Networks work like for example I don't know on B&B chain we learned there was a company called oh my God I'm blinking right now but flash bots of B&B chain that had 80% of the market I don't remember right now if anyone remembers feel free to shout so what we created is a cross-chain abstraction protocol for Oracle extractable value

what happens on this chart logic is very simple both price update and liquidation are being packed into a single multic cold transaction so it could be Pro processed automatically on chain so instead having this scenario of first update then liquidation you try to kind of like bundle them up all together and then it it's getting delivered on chain so this composed transaction works like uh every normal evm transaction when it's delivered onto the destination chain so the mechanism works out of the box on any evm chain so say it can be BNB chain ethereum base arbitrum optimism and so on right so you don't

have to necessarily work with those me Searchers try to create any kind of like shady contract or like you know try to bribe them to include those transactions it actually works out of the box biding process is pretty complicated I can share like the the exact repo of Atlas which is the product that we are using a company that created this uh this fast plane it's our partner to create this o but the building process pretty simple so every update interval let's call it every second a price data is delivered via Redstone offchain it's visible and then if there is no interest from any uh Liquidator to bid to kind of like a buy

a r to liquidate with that transaction with that price feed that price feed is delivered on chain with redstone so let's say regular scenario happens but the moment a liquidator observes that this price feed on B&B chain for example or any any other chain that we support is going to cause a liquidation that is profitable he starts to bid on that right it's an auction that happens lightning fast and then the highest beer gets the privilege to include their liquidation transaction together with the price update so let's imagine price update gets a super tiny additional spot for also the liquidation and people are bidding and trying to buy that slot and the moment they buy it it's included and

delivered on chain and for more redundancy straight after that Redstone delivers regular transaction so imagine for whatever reason there was any mistake or glitch then the regular update is going to happen on chain so there's like redundancy because the thing that we don't want to break is to add any additional security assumption or like a problem into the flow and now the kicker what I told you in the beginning on oov that matters speed the whole process lasts up to 400 milliseconds so it doesn't add like let's say 12 seconds or a minute of delay because there are already on the market oev solutions that are creating for example a dedicated L2 for OE or some other system that is let's say

abstracted the the biggest issue with them is that they're adding seconds if not minutes of latency to the whole process and here because especially in a volatile Market when Market is plummeting it's very important to keep liquidating the positions quickly so there is no bad debt acur to the protocol itself so in the same example here you can think of the transaction from the relayer from Redstone going on chain and the transaction of liquidation is actually delivered alog together uh in a package um that's the flow how it would look like on Venus for example how we operate so there's a position of 1 BNB worth $600 the loan of 400 usdt so you are

believing that BNB is going to grow in value right because you put it as a collateral Redstone keeps updating the prices on chain then fast lanane operates all the time those actions so they operate with every single update of ours this auction and at any point anyone can put the bit and you know get included into the uh price feed and now also an interesting one some people can gamble so they can try to bit on price feeds that are not certain going to hit the liquidation threshold because sometimes you know with let's say large positions a small number can matter so they can just buy this spot and it turns out they didn't

liquidate okay whatever right so the the liquidation didn't happen but they bought the spot so they kind of like up bu a little bit even the opportunity to be included um and if there are no biders the price updates happen as regular and now the benefits and I believe this is the most important about the design of ours no bugs no code changes no any heavy lifting that the protocol has to do to start using that so if Moro a or any other Landing protocol would like to start using this oev they have to do zero code changes they just have to use Redstone price feeds as the Oracle for a

specific market so literally there is z technical aspect they have to take into consideration or even like a security assumption and this is one principle that we started designing the OE with because any update on a big system that is already working is a Potential Threat right so we don't want to add any opportunity for malicious actors to act on no time so it adds 400 milliseconds uh on ethereum even on B&B chain that the block time I believe is a second or two seconds I don't remember right now exactly but this 4 400 milliseconds is marginal because usually price updates from an oracle happen every couple of minutes sometimes even couple of hours or maybe couple of

seconds but it doesn't the updates on chain don't happen quicker than the FL flash auction that we are running over here H interestingly enough fast lane is a company that is going to do liquid staking token on monad because they have infrastructure and on monad the Block time is going to be even quicker same with mega if so we are right now working on V2 that will be also able to reduce this 400 millisecond even more so it's accustomed for those super performance chains no bad that possible um as the full price stream is available to solvers anyone can update it on chain so what is happening with that

is regular oracles update pricing on chain either because of heartbeat or deviation threshold so it's not imagine uh Devi threshold is half% but actually after 0.3% the liquidation could have happened but in current design of chaining for example the liquidation is going to happen already with the 0.2 margin uh blocker because the update is not going to be live on chain and in our flow the moment the Liquidator sees the opportunity of liquidation he can pay oh Liquidators pay the gas because why chaining is updating that infrequently is because they have to pay gas for every update and here the Liquidator is incentivized not only to

pay the gas but also to pay back some of the value to the protocol to the Oracle and the protocol from which is liquidated in the form of this bid so actually we can we can even deem that we created a push feed that has 0% uh deviation threshold in terms of liquidations so for liquidations has 0% because people are th throwing those price feeds on chain and there's no heaps if the flow breaks for whatever reason there is any glitch in the system there is always the Redundant additional update after fast lane uh auction so that it can work with regular flow if this one is uh by any mean

interrupted so this is for the Red Snow AV happy to answer like any questions after the the talk because I have only 58 seconds uh but also it's a special presentation for me because we are approaching the Redstone talken after four years of building is coming pretty soon uh We've created a redstone Expedition with our Redstone miners that are part of our community members and people love Alpha right so I'm giving you Alpha of three hours we are going to announce it at 3 p.m. today that igen layer chose Redstone as a primary Oracle for their new program so we are launching actively validated service on IG layer people will be able to stake uh please don't record and don't put it on

Twitter I mean come on like I give you I I know it's not live stream so I I I give you a favor I mean like it's always nice to get some additional information H but please don't put on Twitter I shouldn't have done it um yeah so I ler we are going to launch an ABS and IG layer and people will be able to stake our token on igen and earn additional rewards in also other tokens all right and I'm liter at clock thank you very much I don't know if I have a moment for a question or not yeah absolutely actually we're opening up now the questions thank you Martin so uh yeah hey Martin I have a question about the the the auction the Ving mechanism since

it's happening offchain correct H then yeah how does how the bidding Works how do you know that you know whoever is bidding the highest will pay you how they pay you uh well this is the design of Atlas so this module of multi- transaction build bundled in one transaction um so no but you I guess you only include the transaction that that is with of the highest B there right um so let's say me and yeah wgang gu are trying to to to to to liquidate and uh I I made a like a better payment for you yes to include my my transaction mhm um so how are you sure that I will pay you

oh you you get the spot only after you paid so you have to no but it's 400 milliseconds how so 400 millisecond is the whole flow uh I I don't know what's the exact time for the bidding process but the bidding process is for example now I I I would have to check in the documentation but 100 millisecond is the bidding process so super quickly because no those are not humans that are bidding where where do I pay you because there's a special special contract to which you have to pay once the payment is done then you are able to be includ in this slot so unless you pay you're not able to no blockchain will do will finalize in 100 second um that's a good question I would have to check that with fast lane but I know

they have like a registry of Liquidators that are taking part in this game of like they it's an open system so anyone can come and start like bidding but how the payment process exactly works I'm not certain all right thanks [Music]