Ugur Mersinlioglu - Recapturing Oracle Extractable Value through specialized OFAs
EthereumZuri.ch 2024 · April 2024 · 23:25
Ugur Mersinlioglu examines oracle extractable value (OEV), the frontrunning, arbitrage and liquidation opportunities created when an oracle data feed updates, or fails to update, for the dapps that depend on it. At EthereumZuri.ch 2024, the talk argues that generalized order flow auctions such as MEV Blocker and Flashbots MEV-Share are not viable for oracles, and makes the case for specialized OFAs for oracle transactions to combat OEV.
Speakers
Topics
From EthereumZuri.ch 2024, hosted by EthereumZuri.ch.
Transcript
okay perfect hello uh welcome my name is uger I work at API 3 and uh today I'm going to be talking about recapturing Oracle extractable value through uh specialized autoflow auctions uh sounds like a very complicated topic but it uh truly isn't I've tried to break it down into let's say technically understandable Parts as much as possible uh so let me start off first off what is API 3 so API 3 is an oracle project most of you know oracles when it comes to price feeds so you need the ethusd price to build a landing protocol for instance uh what do we do you difference than comparatively to other oracles uh typically how other oracles work is they
rely on somebody running an oracle they get data from somewhere like coin Gecko and then you trust essentially a layer of middleman transmitting data from places like coin gecko exchanges directly and so on and what we do differently is we go to the source directly so when we operate or partner with people coo in our example runs an oracle directly and then you use multiple what we call first party oracles and aggregate between them and that creates uh transparency and verifiability of what you're actually consuming uh the Oracle landscape is uh very interesting I just put like some of them up there they typically stand for something uh but at the end of the day uh all of them kind of give you the same thing you need a price on train and uh
there's various different way ways of doing this I could do a presentation just talking about the uh pros and cons of various approaches how centralized and decentralize they are but for the sake of this presentation I'll just say everybody here kind of gives you a price uh and uh everybody kind of competes for a place on this list this is the defi Lama uh TVs dashboard so how much value are these oracles securing uh how many Protocols are using them and uh you see on there like various different numbers like how many Protocols are using for instance chain link and how much value chain link is securing and uh uh one thing to note about this why I call this uh meaningful
numbers without meaning is [Music] um I'll take API 3 as an example uh 6 months ago when we launched uh our decentralized feeds uh we were securing 10 million right now we are up to 400 and probably reaching billions very soon soon uh what do you guys think our Revenue made in the last 6 months from 10 million to now 400 any estimates you yeah basically uh no Oracle on this list they could all 5x how much they're securing they're making zero money uh so so what is the meta if you're providing prices but you make actually no no money
doing so and the current Oracle matter is literally you climb up the corporate ladder which is the defil Lama TVs dashboard uh a lot of times you often see projects quite literally bribing people with tokens uh to achieve Integrations uh then you heavily Market how much you're securing uh look so many people are using us we're securing billions uh the fact at this point that you bribed people to use you or that you're generating zero money actually does not matter at all and then step three is you sell your token like that is the game plan of every Oracle uh which leads me to like kind of a summary of the current Oracle space so nobody makes money everybody dumps on you from a d perspective especially
during bull markets uh they see no difference uh I purposefully did not go into centralization or decentralization because in Bull markets people just want price they care absolutely zero about security implications and because of that a lot of oracles simply have no Competitive Edge and business development is literally promising people tokens to integrate uh obviously this is a game that uh we don't want to play we don't want to build our business on top of uh token dumps so if everybody does prices what else can you do to essentially generate a Competitive Edge and we spent the last year looking into Oracle extractable value Oracle extractable value is a subset of MV so
similar how your transactions on chain can create me for instance you can get sandwich on Unis swap uh protocols utilizing oracles Oracle transactions or if no Oracle transactions happen can generate me on a specific protocol I'll give you a very simple example that is super easy to understand uh GMX uh I hope everyone knows GMX here it's a derivatives platform so you can go 50x long uh what makes GMX special is they don't they don't have an order book like centralized exchanges what they do is you take that trade on the basis of an oracle price so effectively if eth is 3,000 now uh you can go 50x long with 500k directly at that price there's no
slippage nothing so what that creates is a very big problem because when an oracle updates the Oracle determines when your position is in profit or not like let's say the price goes up to 350 so roughly 1. 66% and your 50 X long that's almost 80% profit but the problem with it being reliant on oracles is you see the Oracle transaction in the M Pool so what you can very easily do and what happened with GMX as you can see on the Chain side tweet on the right side you wait you see the price update coming from 3,000 to 3050 you go 50x long before the Oracle update and Clos
directly after and you're always on profit and there's nothing GMX can do to stop you from this because you just read you place your first trade before the Oracle the second trade after the Oracle close this has been going on for 40 days uh late 2020 on GMX and uh Bots were able to extract 10% of all GMX profits across those days which amounted to like a quarter million obviously now you're saying a quarter million over 40 days that doesn't seem like quite a lot uh but actually uh the industry is quite significant uh if you look at protocols like compound or Venus uh over the last four years each of them has lost over 100 million each to oev uh and now the
question would be how so uh Landing protocols rely on oracles to determine essentially what collateral is worth let's say you want to you deposit some eth and um take a loan against that uh at some point uh your collateral because eth is dropping might not be worth sufficient so your health Factor drops below one that is kind of the magic number or the definition in lending protocols and at that point your position becomes liquidable uh in order to essentially uh make sure that these positions also get liquidated these protocols typically give out a bonus of 5 to 10% of your collateral to anyone willing to
liquidate you and that is effectively these hundreds of millions that a and others are losing and we're saying losing because essentially users are being overcharged in order to incentivize timely liquidations just to give you uh the proper flow of how a Liquidation on a landing protocol would happen so the first thing that happens is an oracle updates that determines if your health factor is above or below one if it is below one now a bunch of Searchers essentially see oh there's a position that I can liquidate and make these 5 to 10% off and if we're talking like a million dooll position those 5 to 10% can be 50,000 to 100,000 of potential profit for you just for liquidating that
position but because it is so easy typically a lot of people are looking out for that so there's competition on the Block Space level in order to be allowed to liquidate you so people essentially bribe block builders in order to be allowed to be the first to liquidate you and what then happens is that uh one Searcher wins uh they get the profits of the liquidation and pay the Val validator the bribe uh any guesses here how much that bribe amounts to just raise your hands and say any number that you want let's say let's say 10% 95% 95% any other guesses okay uh 95 was pretty close uh essentially Searchers uh liquidations
are so competitive that Searchers are giving up 99.9% of potential Revenue just to walk away with something and uh on the right side you can see the biggest Liquidation on Ava in January it was for 4.2 million roughly at the revenue section you see how much are the offered for that liquidation as a bonus basically so 141,000 at the cost section you see how much the Searcher bribed the block builder in order to be allowed to execute this liquidation so 441,000 away with $60 in profit so we've established even if Ava is giving you
141,000 you end up giving away 99.9% of it and all goes to the block Builder and the hilarious thing why we're talking about this anyway is that all of this is only possible because the Oracle ignores that this value is there theoretically the Oracle could update and liquidate in the same transaction and all of this on the right side will never happen because the Oracle has the primary right to liquidation because the Oracle determines when a liquidation is even possible so why don't oracles do this uh it's because of centralization you want to keep the liquidation Market open and allow anyone to compete because if there's an unfair player like if you
have superpowers and if you can determine when a liquidation happens all the others will stop playing and if you then ever fail to liquidate the protocol ends up with bad debt so typically Oracle stay away from extracting or liquidating themselves okay so the status quo of liquidations what do we have we established uh the fees are way too high uh we established this by proving that Liquidators give away over 99% of what they're being offered and we've also established that theoretically the Oracle has all the power in the world to execute the liquidation themselves they just don't do it because of centralization risks how do we solve this uh and as I've said they all like
these Searchers take part in Block space auctions they already compete with another on the Block Space level so why don't we take these auctions that happen on the Block Space level and take them to the Oracle level so instead of competing to be the first in order to be allowed to liquidate why don't you compete for the Oracle update that allows you to liquidate because that comes before anything else and that is in fact what we've been building uh our solution is called uh the oev network uh it's a market for Oracle transactions so you in effect uh Envision Oracle noes um at the bottom left they maintain a price feed if we chosen mantle Network as a layer two here uh and the ethusd price
feed uh the important thing here to note is that uh essentially this price feed updates every 1% change but it's delayed by 15 seconds these same Oracle nodes use use uh the oev network which is our own Layer Two for auctions uh and push realtime signed data there now Searchers can compete on this layer two for Oracle updates and they effectively when they win have a 15-second advantage over anyone waiting for the regular update to happen on train and when they win essentially an update they take the signatures from all the Oracle notes they update and perform their action so essentially they win the rights to update the oracle they have 15 seconds
to execute that ride and then can update and liquidate and get all of the profits uh that are available uh just to essentially show exactly what happens on this uh Layer Two uh it's like I said auctions so for each dab and each feed that a dab uses on each chain we run a separate auction so Envision uh compound uses e USD on arbitrum that's an auction Venus uses BNB USD on BMB chain that's an auction and you can essentially bid to update price feeds for specific dabs and when you win the ride uh you get a meta transaction this meta transaction includes how much did you bid and uh on which chain did you win and which stab
did you win and then all the Oracle signatures that you need in order to uh update the onchain price and now the important part why we're actually doing this is uh the auction proceeds all of them go back to the DA so these uh 41,000 that are going to the block Builder we essentially now created an auction that just Fels it back to the dab uh and this is in effect uh the Competitive Edge compared to the other oracles um we created a mechanism that pays you for using an oracle um you could use these funds to build an insurance fund you could put it into your treasury you could distribute it to lenders to stakers you could create a buyback program for your Tok
and uh considering the amount of money we're talking here like I mentioned the three big protocols that I've shown each of them lost over 100 million in the last four years so that's 25 million a year basically uh that could be uh returned uh but my favorite solution and this is a bit of bias is to actually return it to the user because if you're a landing Market that doesn't charge a 10% penalty on liquidation you're just going to out compete everyone else like why would I use someone that penalizes me for 10% for getting already liquidated if I can use a market that minimizes that essentially entirely and this model is quite similar to uh this does anyone no this you no this perfect
uh it's essentially a me blocker uh it's a solution where you change your RPC uh to their RPC and they promise not to uh extract me from your transactions but they even go a bit further they essentially extract all possible M that is there and return 90% of that to you and they take a 10% cut and that is in effect what we also do with the oev network so we just created an oracle where an MV solution is inbuilt and all you need to do is you just change your Oracle you change one contract and you just use that Oracle and now effectively uh whenever there's an opportunity and people compete for a 4.2 million the dollar liquidation you get
paid in the process and uh that is in effect I think already it uh it's effectively more than just price feeds and we're making money by doing so one of the few projects that do and if you have questions hit me no give a round of applause woo I'd love [Applause] that very well prepared slides I just fell in love in the whole design I'm a marketing person so in case you have any question can I possibly ask a question questions please of course we're waiting for all right so two bits first is that you kind of describe something where you have an auction mechanism in a tree
where you could you don't need to be part of the root of the leaf of the tree to recognize what you need to unless you have a signature requirement that's number one what I mean by that is when a liquidation happens you could pretty much assume like you can build a graph a probabilistic graph the end of the leaf of of that node is actually the committing step so me as an observer I could actually see that and then my next step is going to the me pool and then front run that's BR you can't uh because uh the essentially um what we give you is a right to each each dab reads uh its own proxy uh data feed contract and what you win over our a layer two is the right like the um the the the the right to update is also enshrined in the meta
transaction so your specific address won the right to update and only your address can update so people can't front run you to update uh the Oracle what they can do is wait hope that you miss the 15-second window and liquidate you after liquidate the position after can I be most cynical what's the assurance that you are the mean like it's if it's an open pool you are just one of the players in the open pool yeah right what have I saying is I don't have to be in your pool to see the transaction and I could probably go in front of you can I or can I not are you talking now about the auction specifically happening on the layer two uh yeah we have collateral I specifically didn't go into it because it got too technical but on the layer
two there are uh there are collateral requirements and basically uh Searchers that don't execute get slashed like basically you give up a collateral and once you update it you uh can unlock the collateral again with the hash of proving you updated the data feed otherwise you just gave us a bunch of money yeah that that's literally what I was about to ask okay yeah thank you wow thank you so much more questions please you have some five minutes for the questions otherwise I will ask a question perfect thank you uh how do you run auctions on a layer to at a open bid auction or commit and reveal auctions it's a sealed bit essentially uh yeah uh you participants don't see what other
participants bit so uh there are many research papers out there that essentially prove why this method is the best so people essentially bid the maximum amount that they're willing to bid because they can't see what others bid and that's how you get like it is not guaranteed that you get 99.9% of the profits but seeing how similar auctions uh occur on the Block Space level on ethereum it is almost guaranteed so the only thing that you need to make sure happens on the layer two is you need enough participants and if you have enough participants it's going to strive towards the maximum value and that is like one of our core challenges like we're very confident that people are going to compete we just need the people yes one more question we see it's
coming um yeah how long is the delay in the bidding window and if a Black Swan event happens like doesn't the delay like make it worse the situation yeah so basically uh there are two methods of getting the data so the layer two has real-time data so so it is effectively a pull Oracle if you know what that is and the base feed on the network already is delayed by 15 seconds so when you get data from the from the network um there are essentially two conditions how you you win you can just in time bit where you realize the price is now there I need to make a bid I have 15 seconds then it might take a couple of seconds I
think we tested this like three for the uh auction like for the oracles to realize hey just somebody just bid and just won so you might lose 3 seconds but you still have 12 to execute and front run the regular Oracle update or you already have placed bids in advance uh which you can do because you can simply calculate at which point is a position liquidable so you just calculate a if e drops to 2,500 this position is liquidable so I'm placing a bid at 2,500 and if it hits that uh it's immediate basically because the condition is already on the Chain like the the the Oracle notes know already if it's 2,500 I'm going to post this data and this person has
won does that make sense it's it's not predicting like uh you essentially how you partake in these auctions is you place bids on this these Layer Two And if price hits if price under 2,500 uh I'm bidding so much for that update so you can pre-calculate a lot of positions like if you're if you take out a loan on a you have a liquidation point that is very easily calculable so Searchers can already in advance place bids at your liquidation point they just need to every time they recalculate check if something has changed like did this position post more collateral uh what is the new liquidation price then
cancel their bid on the layer two and place a new bid because it's very obvious like it's similar to how binance shows you what the liquidation point is this is no different on train people know where you get liquidated and here they have the chance to make bids for those points instead of waiting on the Oracle they can essentially say if 2,500 give me the price and then they will take the price and liquidate you uh there is once somebody has won uh there is essentially a 15 second block on that auction so essentially you win you have 15 seconds to uh update and if you don't update in those 15 seconds the
auction essentially picks up the next one and awards them the bit there is more than enough time to to win we we checked this with Searchers nice right it's all about timing execution users last question how many users you would like to get within the next 3 six months so you can say wow that's a success uh how many you uh I I think our goal is to to reach like it sounds it sounds stupid because I kind of trashed this TVs dashboard of defi Lama before but we created an environment where that number actually matters the more you secure the more potential liquidations the more potential money you return to the dab
the more potential money you make uh because we essentially for every dollar we make we returned $9 to the depb essentially so our goal is to have as many Integrations as possible which is kind of getting easier when you're off offering people basically free money uh that others don't so 100,000 1 million what how many users 100,000 1 million no million we're talking about uh specific protocols so like it's going to probably be like 50 to 100 so we're talking about protocols not specifically users yeah cool all right thank you thank you let's give a round of applause impressive