#DappCon22: Day 1 - Data Extrapolation Framework For Risk Assessment Of DeFi Lending Platforms

DappCon 2022 · September 2022 · 26:40

This DappCon 2022 talk presents a data extrapolation framework for assessing risk in DeFi lending platforms. It covers how limited historical data can be used to model liquidation risk and protocol solvency for lending markets still early in their track record.

Topics

From DappCon 2022, hosted by Dappcon Berlin.

Transcript

uh thank you both very much uh next up we have yaron vellner from B protocol and he will be speaking on a data extrapolation framework for risk assessment so take it away thank you yeah hi everyone let's see if I know how to turn it on foreign yeah

yeah hi uh good afternoon everyone yes I yeah I'm yeah protocol also a contributor to the risk now and this talk is mainly aimed so if you're a lending Market operator or on L2 on some alt chains or just run any low liquidity Market on blockchain so this talk is mostly to you it's about how risk assessment is currently done only on these l2s and R chains uh how risk assessment can be done better

and also how risk can be improved in general so yes so this stock will be a bit technical we started by trying to at least explain how risk analysis is done will explain why the risk analysis that is done today doesn't really work or not work as smoothly also for all chains and air too will show our risk model how our risk model can help to Monitor and set risk parameters for landing markets that suffer from low liquidity

and in addition we not only analyze risk for learning markets we also have a tool a backstop tool that can actually improve the status of the risk of these markets and we'll show how it works uh so yeah so the bottom line is that kind of the golden standout or the bed golden standards in Risk analysis these days so you folk a compound code or other code you launch it on some other blockchain the code will work as is perfectly well you know typically you even have maybe almost the same assets so inside of usdc you have your

no local blockchain usdc you have your local if Etc so you might as well just copy you know the risk parameters from Avion mainnet but this is this is of course one uh and this is wrong because if you do it in such way liquidations will might not be able to save you when Market goes down and liquidations are the backbone of any Landing markets that wants to avoid that depth and further so the all the left all the defile liquidation mechanism or kind of tailor to L1 on mainnet with high

liquidity they are these days especially you know we recently have a huge liquidity crunch after the lunar collapsing and the bear Market in general this will completely break on most l2s and on many l1s so we show how to analyze these tricks so okay so as a landing owner Landing platform owner you need a better risk assessment and if you want not only to be aware of the race but also to take actions to mitigate it so a backstop is what you need a yeah okay so now we dive into the technical details

so basically how is risk analysis done these days and you have you know like very reputable and very strong teams uh such as make a risk team you have Gauntlet or doing risk analysis for compound and other you have the Euler Landing Market risk team a basically they all take the approach of okay let's see you know what historical prices for how much volatility there were we look at crashes we try to predict how users will behave uh when you know markets move the way they moved in the past

and then let's you know let's try from that to with and if liquidation Bots will actually be able to facilitate the liquidation where the outcome and the end goal of all of this analysis is eventually to set uh your LTV loan to value or collateral factor which basically means how much you can borrow against every collateral asset of course there are also additional parameters such as interstate curve collateral caps borrow caps Etc but in this talk we mostly focus on the LTV so historical prices so you basically just take you know price trajectory from

your favorite Exchange and of course the more volatile the asset is the more conservative the risk parameters are because Flash caches are more likely to happen and in return liquidations are harder to execute now this is basically the only point where if you do it for mainnet or for L2 or L chain you know this is exactly the same analysis the price of Ease on arbitrome and on mainnet is exactly the same at least the historical one the price of usdc amino of Bitcoin is the same so prices are all the same however okay so this is these are now

the prices and now kind of the core analysis trying to predict okay now what if tomorrow price will go down by 20 how many liquidations will I have and how how well they will get executed so here is where the black magic begin and there's a lot of work about so-called agent simulation uh where gunplan maker though and the others really try to predict and say okay if Market will go down by 20 so with some probability x amount of users will recoilateralize their account prepaid

their debt and more collateral so already on ethereum this is based on various sparse data it's it's an educated guess but still mostly I guess uh but still you can argue that compound have a maker or they all have you know kind of a long history and maybe these platform's already kind of know their customers know their whales their big actors so they can fine tune the model to act accordingly but of course if now you folk you have your you know your lunch you have a full compound Fork on some L2 so you have really no idea you know how

your new platform how your new users will behave and it will actually take you years you know to calibrate add this parameters to the new Behavior uh moreover even if you say okay maybe I will just observe compound past you know user history and we'll try to extrapolate it somehow so because liquidity on other chains is somewhat fragmented and you need to have Bridges which you know in turn introduce some delay in the flow of the capital so this of course also affect on the user Behavior which make the agent simulation model much more of a guess uh then a robust analysis

and finally okay so from the price history and from the user Behavior you now say okay so these are the amount of liquidations I will have and of course all of Defy is currently based on liquidation boats we just take a flash loan we pay the debt and try and repay the user depth and then just close the position under favorite exchange the centralized exchange and this is all done in a single transaction with a flash loan without any Capital but also without any risk from the liquidation bot size and this is the most obvious thing that

breaks when you go to L2 or other alt chains because if you see ethereum liquidity unit swap liquidity you can see Millions tens of Millions a liquidity for ease for dye for update Bitcoin but when when you go you know for this all chains or l2s so all of a sudden if you take a token like link which is relatively well liquid on magnet and you know you can dump millions of it in a single transaction so now if you go to some Layer Two all of a sudden you see on the right hand side even if you only want to buy ninety

thousand dollar or say 90 000 of Link uh on this chain you will already hit 12 slippage for a Bitcoin I think for a Bitcoin this is on a roller chain so you cannot even sell 12 Bitcoin with a reasonable slippage and spell okay maybe spell is now also a liquid on Main it but you know definitely on phantom for example Phantom has huge liquidity crisis uh so you can no longer seamlessly rely on these flashbots to execute your liquidation and yeah okay so this is an example for

Moonbeam so is is very liquid on mainnet on mainnet you know you can probably even liquidate 20 million dollars in a single transaction with maybe two to three percent slippage on Moonbeam and this was before The Nomad hack you know you couldn't even sell two hundred thousand dollars with a reasonable slippage which means you you could not have liquidate over two hundred thousand dollars markets there with you know over 30 million dollars is collateral thank you so so yeah so these are the challenges and difficulties so the first step and this is what we offer in the risk now framework is

actually how to better analyze the risk of your Landing Market and how to set your liquidation LTV and collateral factor for you know like a given Market condition and then in the last part of the section we'll also present A backstop solution that not only helps analyze the risk but also proactively helps you mitigate the risk yeah so yeah so the rest now takes a bit of a different approach which is very much appealing to early stage platforms which are typically L2 or all chains but also you know if you have other low liquidity platforms such

as nft lending markets Etc so in the traditional Market what you do is you try to learn the user Behavior based on I don't know so maybe you have compound or maker user behavior and you know they're very there are thousands of users but you know that's quite low for you know like serious machine learning algorithms but once you learn the user behavior and you know you already have the historical prices and then you can build a model on you know how many liquidations will happen when they will happen and then how Market will respond to them in their risk now framework we take a bit of a different approach so here we

actually try to learn or predict the liquidation sizes and this is something where data is much more available because here we can use data also from standard Futures exchanges such as centralized Futures exchanges such as binance FTX and others the problem there is that you have a lot of liquidations mostly for you know very popular assets such as ethereum and Bitcoin so what we do is that we take this data and try to extrapolate it to the more exotic assets uh so basically instead of guessing the user Behavior or learning it we are running the liquidation data and then

just extrapolating the price trajectory which in turn has much fewer assumptions on user Behavior which you know like in defy eventually there are very few ways that you know like count for most of every most of the activity so this is from analyzing you know this is how we handle spells user data a further to take into consideration the fact that there is low liquidity on l2s so the thing is with l2s that you have very low liquidity you know if you take I don't know what Bitcoin liquidity on say arbitome but you know especially

on Phantom and more exotic chains so the liquidity is low but eventually the price is not affected thereby liquidations so if there is an Arbitrage opportunity eventually someone will come and take it but it will take time because this guy will have two Bridges is a Bitcoin you know for with apt Bitcoin from ethereum to Phantom or arbit room and and this will take time uh so in this in in our framework we know how to model the the Dex liquidity we have assumptions which you know uh we learned over the time on how much time it will take to actually Bridge it and then we get you know this simulation

model where actually okay if liquidation is being delayed now so price is not affected but if price goes down then the depth will be accumulated uh and this is for the best of our knowledge you know so right now this is the only model that actually takes into account this flow of capital and the delay and the delays that it introduces and yeah and and finally there is the offer this risk dashboards uh with stress testing and recommendations for collateral factors and other parameters as a service to Landing markets

out there so yeah so this is the risk Dao and oh okay so now is there is now you know we might be able to tell you okay because you are on L2 you're not on Main net you have to be more conservative resource risk assessment you have to lower the LTV that you offer and basically you have to kind of damage or make the user experience of your users a less appealing but what if oh okay so so this is already this is not revealed to say and you know as we saw it's based on new mathematical models that captures more accurately

uh the dynamic of the systems but now let's say uh okay so now you're more aware of your risk you know you have to be conservative but now maybe you want to improve your risk parameters and eventually offer a better Capital efficiency to your users so this is where B protocol steps in uh so in B protocol so we call the main issue with L2 liquidations is the tax liquidity is much more spouse however the prices themselves you know behave the same as on mainnet so people don't call Design is actually

to create a buffer and to pull you to pull user funds into a buffer that serves as a backstop to these liquidations so now if there is a liquidation The Landing Market no longer rely on flashboards and on the local uni swap or social swap a fog liquidity but actually it takes the liquidity directly from the backstop so this is more appealing because this desktop has zero slippage so it only it only charged with a liquidation penalty which is flat independent of the amount of funds you want to liquidate so now a learning platform can take the

liquidity it needs for liquidation from the backstop it executed the backstory the liquidation and then you know so we started with usdc now you ended up with some cyst collateral in this example in the form of if and here comes here where the core liquidity of B protocol kicks in where we actually have a formula which is completely uh you know human free from Human Interventional intervention so it's not even operated by a boat it's a simple smart contact formula that now offers the ease for sale uh well intuitively it is based on some

adaptation of care Finance formula for stable coins only now we have East and usdc so we simply normalize his price to the stable coin price and and then kill formula actually kind of dictates a discount that one has to give when you are imbalanced so the more East we have the more anxious we are to get rid of it so we'll give higher discount with respect to the market market price which we can take from chain link or more generally from the underlying Landing Market uh and then whenever this is being sold to the market and typically it will be

taken by some Arbitrage boards it is being deposited again and now the usdc is ready for further liquidations now what we actually benefited from here we still rely on the tech on the debt liquidity but now with this buffer so all the risk moves from The Landing Market to the backstop but but of course also profits are also shifted to the backstop as opposed to so right now in landing markets they take all the risks from failing liquidation but don't get any of the profits of successful one okay so here we shift the equation and now we have liquidity providers who

are willing to provide a backstop liquidity take the liquidation risk but also take the liquidation profits so yeah so it's that slide I will conclude uh be happy to answer questions and also you're welcome to reach out to us either in the risk down framework for the B protocol yeah so yeah thank you very much [Applause] foreign because my impression was that these

lending platforms on layer twos have um I mean have high Capital at stake because they subsidize the interests so isn't it a bit a bit strange of a solution that they could actually diminish their Risk by lowering their subsidies instead of coming up with really complicated systems to to mitigate the risk that they themselves cause yeah so so basically what you say that okay maybe the solution is that they should you know like limit their deposits or you know just manage fewer funds this is what you're asking well from what I understand that the the

the way the reason that these uh numbers are so high is that people are farming the governance tokens yeah yeah okay so like in other words you say you know maybe right now they are less risky because no one actually borrowing anything they just deposit or maybe Loop their assets yeah okay that might you know very well be the case but you know like eventually if you want to have like a real Landing markets on these ltos you will have to have a real activity there with borrowing right and you know like real deposits so so or maybe another thing you say that okay right now there's not a lot of risk because the activity there is not real in some sense but yeah okay still you know if you want to have a real activity in a

relenting market you know you need to be aware of these things and take actions foreign thanks for the presentation so it seems like you are more taking or you're relying on third parties of like arbitrages and so on to execute the liquidations instead of doing it yourself I mean you could even do it like cross chain if you have like a landing on one chain that USB Pro would then execute on another chain and then you wouldn't need a delay

could you maybe explain uh your reasoning uh is it because they are centralized setups are more efficient in executing or it's just some other reason yeah so okay so this slide is not very detailed but this is not really a centralized setup so here you know so so we have a backstop for example in also like one integration we have is with you know liquidy LUSD which is actually on mainnet but there they are you know like right now of around 15 million dollars in user deposits it's completely centralized in the sense that we don't control any of it you know all users are afraid to to deposits you know none of the 50 million dollars there is our

money and it's executed seamlessly without our intervention and actually the question for the course you know doing some cross chain or bridging of liquidity is very much in place we are working and trying to find design partners for some cost chain desktop and cost chain liquidity and this this is definitely one of the missing pieces in defy but right now yeah I mean right now such primitive doesn't exist but it's definitely something we try to work on so is the relying on arbitrage's temporary okay okay no no so here actually Arbitrage is okay sorry I

didn't answer that no this is actually relying on Arbitrage So eventually if the backstop is in Balance then you know when anyone can come and rebalance it anyone you know so we started with usdc now we have is anyone can come and buy from it and actually like we did a few millions of dollars that were rebalanced simply because we offer the best price and not because of a pure Arbitrage that's also happen so so yeah like the the first step is okay just offer the best price or just of the market price right and then if it's very liquid assets on very active Network eventually someone will take it but of course if you get more imbalanced then you have to you know you're more anxious to sell then you will offer a lower

price and then eventually it will be taken by arbitage Bots uh but but like the main difference here now is that it's okay if arbitage Bots will take it in steps maybe it even will take them hours uh to Arbitrage I mean for example we had gohm on uh on arbit room which took more than a day to rebalance uh but yeah so it doesn't have to be Arbitrage anyone can come and buy but you know when the discount is low it will be organic a kind of organic flow but when the discount as the discount goes higher than you know then yeah arbitage Bots will take it that's all yeah okay thank you thanks

everyone [Applause]