Oracles Reimagined: How L2 State Diffs Change Game
EthPrague 2024 · 1 Jun 2024 · 23:03
Filip Rogalski looks at how layer 2 state diffs change the design of push oracles. Some L2s submit only the resulting state changes to Ethereum rather than the data of every transaction, so an oracle can update the same storage slot many times within one L2 block while paying gas for it only once. The EthPrague 2024 talk presents this as a way to reimagine push oracles.
Speakers
Topics
From EthPrague 2024, hosted by ETHPrague.
Holešovice Market
Transcript
[Music] good morning everyone uh thanks for getting out of bed uh to join us we're going to get started our first speaker is Philip rolski who does BD for Redstone defi um with his talk on oracles reimagined how L2 State diffs change the game [Applause] hi everyone my name is Philip uh I'm BD and defi de At Redstone oracles and and
today I want to tell you a little bit more oh sorry about roll up as a service product and oracles and what's the intersection between them so to kick things off for those of you that are not familiar with redstone and I want to give you like a short introduction so basically we launched our main net product back in 2022 uh and then we announced our sidron with um VCS like Maven 11 coinbase or l c on the deck then in 2023 we announced our Angel round uh with prominent Builders like for example
stand deep from polygon Alex goosi from Zing or Aman A founder of avalanche on the deck and as you can notice a lot of these people are actually like L1 L2 ecosystem leaders that's because they understand what's the importance of diversity of oracles within your ecosystem then again 2023 we launched also our research arm uh we did like very good deep Dives uh into a couple of uh topics for example AWA stable coins liquid staking report and the last liquid reaking report had 120k views and we are still like very Le team
for what we do around 20 people most of us live in waro Poland and almost whole team is seasoned Engineers I'm one of the few that is not technical person and like a kind of like a short brag about us and we launched we first client utilizing our price feed on mayet in January last year and yesterday evening we hit $4 billion of total value secured so that's the amount of money that's currently relying on our price fits now why do you need an oracle so basically what Oracle does is it delivers data uh into blockchains for it
to be used further in smart contracts I really like this explanation especially for like non- Crypton people uh where when someone ask me hey what does your company actually do I'm like if you imagine blockchain being as a computer that can do some kind of computation like do some kind of calculations whatever Oracle is the internet plug that connects this computer to external data and it allows it to like use this external data father so oracles deliver um data and in theory it could be any kind of data so you could have weather you could have election data you could have sports data um but in practice
since like we all know how does the current landscape of crypto look like and like it's very speculative right now uh naturally oracles have mostly demand for Market data and right now around 95% uh of the data delivered to blockchains are simply PR data solely for um crypto asset pricing and the question to you guys do you know what's currently the most utilized price feed in defi no no uh not the Oracle uh the price fit so like for example BTC USD or like yeah obviously um it's if USD that's because like if is like very
broad ecosystem and uh it's like a broad Peak asset but also there is uh more and more assets that are denominated in if so all the liquid stake tokens or liquid restake tokens they're usually denominated if so if the protocol needs their pricing it usually queries both the price fit of LRT and the price of e now what are the Oracle use cases so oracles will be broadly used in web free ecosystem but for now they are mostly the backbone of defi so almost every type of defi protocols requires or orles to function and now just to mention a few uh the protocols that use oracles or rely on oracles are for example lending
markets like AA or Venus protocol uh CDP stable coins like liquid or Prisma leverage protocols gearbox Delta Prime um derivative protocols GMX or synthetics yel protocols soar on enzyme finance and algorithmic stable coins like for example fra or M now I have a question can you come up with two D protocol types that doesn't need oracles it's pretty simple if you think about it yeah that's great example and usually people tell it so it's a good example
because de centralized exchanges like amm for example Unis swap not only don't need oracles they are also very of data source for Oracle so whenever there is like an onchain native asset usually Unis swap delivers data uh for Oracle to push it cover um another example I really like is um not sure if you guys are familiar with blur blend uh blur is a NF Marketplace and blue blend is like P2P Landing uh for nfts and what's different about it is it has tons of liquidity even though it's on nfts and it doesn't have like Oracle uh within this ecosystem I think it's because of the points uh so you earn a lot of points while giving bits uh into
the um into the protocol but what I'm trying to say is basically if you can build your protocol Oracle less then you probably should uh because it's always like another point of attack or another potential point of manipulation for your protocol but currently if you want to maintain Capital efficiency it's almost impossible uh to build your protocol oraculus that's why almost the whole defi is relying on oracles now why does it matter so much for rollup as a service product so with roll up as a service the time to spin up your own chain went from like months or years uh to weeks or days um and now if you create your new rollup and want to
have defi there you need to have an oracle now what can you do you can go to chaining and and say hey guys yesterday I created a new rollup would you mind deploying there uh but they probably be like hey come on like let's Circle back in a couple years time whenever you grow or have like any kind of resources whatsoever um I mean don't get me wrong uh we're truly thankful for what chaining did for the industry and we believe like we wouldn't be here without them it's just that they're currently focused on a little bit different things different products and like different scope of um what they focusing on um and they simply don't care about these new ecosystems or like new chains or new
assets that are needed and the question to the audience I have you can just make a guess how many chain chains does currently chain link support 13 uh currenty chain supports 13 chains to give you kind of like a benchmark um we for example right now are present on like 40 plus pretty active chains and probably like 50 60 counting like you know all the test Nets whatsoever and with current rollup as a service product uh we estimate to be on a new chain probably every new week or every like two weeks now why isn't changing on all the chains
so the key bottleneck is onchain data storage cost and monitoring infrastructure cost now what you need to do if you Deploy on new chain you need in train Ling model you need to set up update conditions and like count the cost of every single update for the asset and now there are two key implementations of oracles and that's important so I'll try to explain it as good as I can uh there are push and pull oracles so basically push Oracle uh is a currently most utilized model in defi it was introduced by chaining back in 2019 2020 um it's a model where you set set up Rel infrastructure uh you set up
update conditions and based on these conditions you constantly push the data on chain whenever the update conditions are met so for example for if USD you set up 0.5% deviation 24-hour heartbeat and every 0.5% deviation you push the price to the Target chain um what's good and wrong about this model So within push model um the gas is being paid either by the Oracle or by prot that is consuming data or by protocol that is like asset issuer and wants to have data Feit created for themselves so for example we cooperate with eeri they want to have data Feit for they restak e so they pay us for all the gas cost and like all the setup and everything
because they want to have more D defi Integrations in place the other model is pool or as we call it on demand model is basically a model where data is being injected on chain only when needed what's about it the data is being stored in the middle layer H we like to call it like offchain decentralized stream of nodes and and it's being injected on Chain by user transactions so whenever user interacts with a protocol he pays a little bit more in gas for example 5 10% more in gas and it's his transaction that makes the price go on chain so basically there is no gas cost recurring either on our end or on protocol consuming data end and the data is not
being constantly pushed on chain it's being pushed on chain only when it's actually needed uh or like another example user gets liquidated it's liquidation B that pushes the price on chain in this transaction so another difference push model is not that scalable because you need to set up separate reli infrastructure for every separate asset um pool model is much more scalable in terms of chains and in terms of number of assets you can deploy now how the standard push Oracle works so you got node operators aggregating data from data sources like coino taxes like binance or taxes like Unis Swap and then they aggregate that
data and push it to Smart contracts on target chains um and then from there it's being cre by D smart contract we really like to refer to the push model as to like oh and as you can see like it it's not scalable in terms of of chains and assets and we really like to refer to push model as like an email so email was one of the first um options to like communicate and like it's here to stay we still use email for and it's for some use cases it's very like working very well but currently you got tons of other Communications like telegram Instagram Facebook whatever you use uh which are different and are getting more in
popularity and we do think the pool model will be getting more and more popular uh in the coming months so with pool model the flow goes that way the beginning is similar so like data provider nodes aggregate uh data from different data sources uh but then the signed data packages go to the middle layer I already mentioned uh in our example we call it data distribution layer for example for piff it's piffet which is like a salana fork where they own 100% of Supply so it's like super cheap to push the data on there and then the data from the middle layer is being injected on Chain by user transaction so for example for pi they do it through
bridge to the targeted chain for Wormhole um for us it's usually either Liquidator that is pushing the price from the middle layer into the targeted chain or we piggy back user transaction so whenever user interacts with the protocol we push the price on chain from the middle layer into his transaction call data so for example he deposits into the Vault or he withdraws or whatever he does the data is is being injected on at that moment uh and you can go to showroom. redstone. finance uh to see like tons of different chains Integrations we've done uh with that model now uh why does it matter so much for rollups and like um how you should choose your oracles for your new
ecosystems so key outside considerations are waiting time so how long does it take for an oracle to deploy on your ecosystem and here like it's clear pool model is a winner uh where you can deploy it usually day one main net uh and be life like very fast on new chain uh cost of the Oracle so in push model the cost is way higher because not only you need to pay gas which can be not that high on l2s but you also need to maintain like reli infrastructure uh which is additional developer costs and like time costs and then types of application that you want to bring because being transparent almost whole defi used to consuming data in the push
model uh that's usually especially true for Blue Chips so for example protocols like Mor for Venus Pendle they all use us in the push model does because they are used to chaining on all other assets or all other chains and whenever they deploy to new one they don't really want to change their code just to consume our price feed or like just to be a little bit more gas efficient uh they want to use they already like AIT the smart contracts and have a plug-and place solution so it also depends on types of applications you want to have within your ecosystem now a couple of case studies about rollup as a service um so Manta Pacific it's a rollup that was spin up using polygon zika evm stack and Caldera and they did like incredible job
especially at the beginning with the incentive program where they attracted like almost two billions of liquidity um and like during Manta Pacific C almost all protocols switched out price feeds uh they currently do have some problems because the incentives ended and the liquidity is flying out to other ecosystem so it was not that sticky uh but still like I think they will manage it and like it's a great use case of rap as a service another example we all know like Dino l1s like maybe you still remember Lisk back from another bull markets um it's a chain that currently like lacks narrative and doesn't really have any users so what they could do is basically utilize their resources and Lisk is
going to for example go with gelato and opack and that's the own L2 just to attract more users and get some traction another examples is ceilo going to ZM stock or Canto switching to L2 on Z KVM now what are key parameters to keep in mind when choosing Oracle provider for your new ecosystem so customizability uh so can you decide which data providers exactly you want to trust and which data sources you want to utilize for particular price fit redundancy so what has to fail for the Oracle to go down uh and if you like use any external solution for example bridge to push the price on chain how reliable
is that bridge L1 L2 Ras compatibility so is it compatible with your rollup and is like the security between different chains fully shared number and types of data feits available so how easy it is to add a new price feed but also like if you integrate with particular chain are all your price feeds available on that chain and that's the case with us for example so whenever we integrate within eurap all our price feeds are available there in the pool model onchain and offchain price sources that's interesting so can I have for example data feed for LST or rrt and now the thing is these are very onchain native assets they have tons of liquidity but all this liquidity is onchain in Unis
swap Sushi swap like dexes different dexes curve for example and now can the Oracle provider properly aggregate that data uh from this onchain sources and also from the onchain sources from different ecosystems and different Els another uh thing to keep in mind is price aggregation methodology so is it robust against for example wash trading and now a lot of providers choose to utilize like aggregate data based on volume uh which is not the best solution H we believe it's much better to aggregate the data especially for onchain Native assets based on liquidity so you check how much liquidity there is in particular po of course you add proper like slippy checks in place and
you monitor that liquidity uh because it's the wash trading is like and the volume based aggregation is much more prone to manipulation uh historical mispricing in manipulation so has the Oracle failed in the past and how uh do you have any kind of guarantee if the Oracle provides the wrong data how much does it cost for the Oracle to deploy and fundamentals like governance economics and Audits and probably like 100 other different topics you should keep in mind when choosing the Oracle provider now uh to wrap it up uh I wanted uh to show you guys if foro a little uh because we're in warso we are like very
involved in organizing this one it's happening every September it's like a small very deaf focused conference so if you are looking for a good excuse to visit warso I invite you all uh second till 9 September this year uh you can come and join um it's going to be very interesting uh and that's pretty much it if you have any questions feel free to shoot me here or I'll be around the thanel for the whole [Applause] day thank you philli we do have time for like a question if anybody has one and if not then we'll wrap there oh wait no there's one there's one okay still
thinking way from the speaker feedb there uh so how do you see ideal Oracle in 2024 2024 like yeah today I think the question should be how the data should be consumed in idal Way by protocols because I think like the idal Oracle almost exists I would say we are pretty good but uh the thing is like Protocols are not used to consume data in the pool model so the best solution would probably be to do your protocol as Oracle agnostic as possible and also being able to consume data in all of the ways I think
synthetics did it in the newest implementations so now they can consume push model Oracle but they can also consume pool model Oracle so whenever they want to add new assets they can basically choose hey all right this is push model for this price feed and for this for this concrete asset we don't have any push Oracle so we can consume pool model uh right so it's then it's like much more versatile both in terms of asset available but also like in terms of providers that you can utilize right so I think that's the ideal model going forward so does it mean that you're okay with the fact that protocol can use several Oracle providers or you're even maybe up to it yeah for sure I mean there is more and more protocols
using like main Oracle and then also fallbacks which is probably a good idea because like Oracle can always get manipulated we didn't have any kind of manipulation but almost every Oracle provider at least had one incident right or a couple of incidents and if you have like checks in place and like different solutions and like fallbacks then you're usually at least a little bit more safer right on that front so it's always better to have more if I may add oracles are maybe the main goal and target for Bad actors yeah tot and if we visit R anti leaderboard um top five positions there would be like 30% Oracle
projects uh sorry like U I'm saying that one of the biggest hacks in web 3 yeah would be associated with oracles yeah yeah for sure this is like very manipulative aspect for def so yeah sorry I have a question probably is very basic but the the pool oracles it's probably more attractive to be vulnerable to Meb or [Music] something I'm not sure like for me researchers or me Bots like uh Arbitrage uh sandwich attack yeah there are oracles that focus on that
uh but we we don't even like dive into that aspect so our pool model is totally not uh I would say not optimized or the I think API 3 is solely focused on uh me and like that's the main focus for them right now thank you all right thank you Phillip thank you love to see that Oracle ecosystem expanding we need that we're going to break for a few minutes we'll be back at 10:30 with our next speaker