Economic Risks Panel

DeFi Security Summit 2023 · 15 Jul 2023 · 40:43

Tarun Chitra of Gauntlet moderates a panel on economic risk in DeFi with Alex Marx, Marijo Radman, Primoz Kordez and Yaron Velner. Each panelist starts with an incident that shaped their thinking, including Luna, the Binance Chain halt, a lending market exposed to its own collateral token and the Mango Markets manipulation. The discussion then turns to how economic risk should be defined and measured, governance attacks, attacks on block ordering assumptions, and risk controls in lending protocols such as debt ceiling rate limiters.

Speakers

Topics

From DeFi Security Summit 2023, hosted by DeFi Security Summit.

Transcript

hello everyone sorry for the delay I just got off the flight so I think it was a bit of a bit of a last man rush but uh excited to be here and to talk a little bit about economic risks with a bunch of different people who have different views on it um so maybe first to get started with our panelists maybe we'll go one by one and have you introduce yourself with sort of what you what your name is what you're working on and what your sort of favorite incident was that was a big Learning lesson for you in your the way you think about economic risks in defy can start yeah my name is Alex and I work with Bitcoin and with Dows generally for web3 Native risk so kind

of a big topic for all the web 3 native things that can go wrong these days but previously I was an analystic coinbase and my favorite exploit of the moment the thing that's on my mind a lot and I I may talk about this a little later because it's been a bit of an obsession point is governance attacks is where we see sort of new avenues of dows that are doing self-governance and doing interesting things with their funding mechanisms actually being attacked and folks coming in either through social engineering of the Dao or through like an outright token manipulation and those have been top of mind for me and hello everyone my name is Mario radman I'm the co-founder of salty Network we are building a risk infrastructure

for the centralized Finance more or less indexing the D5 ecosystem and in real-time assessing the risks including econometrical economic side of the risk I will say like my favorite economic risk would we tell Luna because this was actually actually the time when we were in a funding phase it happened at the right time that we managed to close around um but um but one I really liked was a unique one it was the binance chain stop or halt by CZ I really liked what happened then when all these liquidation events started to happen on those smaller Realtors and so on Landing protocols it was quite funny to see what can happen in D5 when a chain gets stuck

yeah thank you I I'm your own I'm the sorry founder of B protocol historically it was a lot about on-chain risk mitigation Solutions mostly for landing markets recently we also started to work about on-chain economic risk optimization optimization and Landing Market parameters I'm also contributor to the risk Dao who is also kind of giving it as a service and yeah my favorite incident maybe other than the classical Luna in other ones so we focused mostly about a landing market and stable coin risks so there was a bit of a niche attack but overall resulted with over 200 million

dollars of loss it was back in the maybe end of the defect summer days there was a platform called Larry Capital it had the lending Market uh that was actually governed by Ichi there was this thing called Ichi the short story there is that probably intentionally but maybe just negligence set up very long to Value ratio for their own native token which is as expected sort of served as an exit liquidity for token holders token obviously pumped you know like 100x or so certain point it stopped bumping and you know people lost their tens of millions

in actual money usdc die Etc and he demonstrated very well you know like both the need for risk management but also kind of all the pitfalls of all the compound folks but you know Landing markets in general and how to recover from an attacks how to uh how to actually act sorry how to actually act when attack happens Etc so yeah a lot of kind of lesson learned from there uh hey everyone my name is primo I'm founder of block analytica we do risk proposals for maker Dao but we also build Rizzo dashboards customized series dashboards and recently we also launched one side project where we tried to score borrowers in defy

my best example of economic risks probably because I'm more on the Financial Risk side is the um attack of um no yeah it actually happened on Solana so the mango markets attack later known by attacker known Avi why it was interesting for me because the the code worked as intended like he just manipulated the price with Perpetual features pumped the price 30X use collateral to borrow I think 100 million or 100 million of other assets and yeah it clearly shows the protocol was misconfigured um I'm not even sure because it's on Solana but I'm pretty sure this this probably didn't have any borrow caps Supply caps or any of those and uh yeah this clearly

shows that active management even if the protocol the protocol needs to have parameter configuration for this kind of stuff and in this case did even if it had it like it was prob improperly misconfigured configured cool so uh you know we we covered I guess a breadth of different types of attacks whether it's governance attacks Oracle attacks like the mango case or sort of bad mechanism like Rari in the sense that there was no sort of adjustment that could be made but I think maybe broadly speaking I think the the term economic risk is probably highly overloaded and has continued to become more overloaded over time as people try to bucket particular

technical risks into economic risks so that Auditors can say that it's not their job or vice versa people people in the economic or side say you know hey this is a Auditors problem or so I think a good kind of uh coming to consensus on vocabulary uh you know would it would be good to kind of hear from each of you about how you would Define economic risks and what you view as sort of the boundaries of things that count as economic risk versus not now obviously it's a fuzzy line and that line changes over time but um just like what is your sort of best unbiased estimate of the definition of economic risk

yeah first appreciate the question uh to kind of push us in our definitions as a community but uh I wouldn't necessarily want to Define D5 economic risk as distinctive of what we think about with CFI economic risk but I think there's sort of a difference in scale because you are operating you know as for the first time in a financial system where each person is assuming complete culpability and autonomy in their environment so I think you have kind of like a movement from the micro risk that can then be understood at a macro scale and whereas when we study economic risk in more centrally arbitrated areas you're going to see sort of macro influences moving to the micro scale of what an individual person or an

individual company might experience so I guess I would add that little distinguisher of just sort of starting with first principles when we think about D5 specific risk and offer that as perhaps a addendum to the traditional definition and I do appreciate also teasing apart like a technical you know contract is it broken is it malicious is there a back door for this like chain those types of pieces I think can fit into the wider economic risk to understand the sector without having to be completely conflated right sort of take it as as the The Wider Trends and the fact that complete self-custody and these new mechanisms we have for exchange

that perfect autonomy is is what's creating the the risk surface area in general I believe it's a it's working right I believe it's a very interesting question I mean when you look at the technical risks you can always see these are the trigger points often in the economic sphere of risk what happened afterwards I distinguish usually like at solity in two parts you have the first one is more of the protocol design level where you basically want to optimize your protocol that it behaves in a stable manner and the second one is more of a liquidity provision where the whole liquidity is actually interconnected and

there are consequences when some kind of triggering mechanism happening and now the question is like okay we are now in this great Zone because there are many trigger elements and how far are you going there and that's basically where we say okay let's take in the Econo economic risk sphere everything which is there which is not from the traditional Finance space there like all these stuff what they are doing like sharp issues and so on cut it there let's not go in the hardcore security audit site and everything in between is actually economic risk because device is a composite and you have to deal with it chronologically yeah so my view is that economic risk is basically what will happen to you kind of on a bad day what

will happen to your platform on a bad day we're kind of more classical cyber security is you know what will happen kind of in the presence of a malicious actor or an attacker and of course it's not mutually excluded you could have sold so-called Financial attacks but then also I think you know there is sort of a clear border where eventually economic risk is something you could take as opposed to a lot of classical security risks which is you know like a clear sort of you know no go uh in particular you know even if you take you know like the tech loan as an example in my opinion you know even listing Luna or USD

in some you know in your favorite Landing market so it is a risk you know but economic risk economics are reward you know no matter what the parameter is it could be under certain scenarios a reasonable decision uh to do you know one thing or another as opposed to the more classical risk which is you know sort of done only and you know you should never go there so yeah uh yeah for me economic risk yeah it's a subset of I mean technical risk impacts economic risk but the economic risk can also rise from governance risk or Oracle risk or any kind of risks really um what I most um closely associated with is basically misconfiguration of parameters at a particular Landing platform or even the

design of the landing platform not being properly configured designed basically the best case is probably other V2 where it doesn't have borrow caps right and we saw how this can go wrong in some ways um if it asks these parameters to limit depth ceilings on certain assets being borrowable or limit Supply caps on as it used as collateral then it's always about configuring it properly related to the Token liquidity token volatility what we also do in our risk models is we look at the borrowers how they behave for instance if we if we see the power words are managing their walls actively they

react when there's a market crash we know the loan book is safer right so it's all these attributes that kind of affect the the risk premium calculate for any Landing platform yeah I think it's interesting that the first two answers were very sort of like broad definitions and the latter two answers are sort of extremely In The Weeds on particular one particular subset which in and of itself gives you this question of like uh are there actually really good ways of formally describing economic risk I would sort of have a different definition than probably everyone uh here in that my definition would be something I can do you have some notion of the utilities or payoffs of individual users and user types you have

the notion of the joint payoff of the entire system and you want to look at where the maximum deviation between the max joint payoff and the sort of expected individual micro payoffs uh differs because that sort of controls at some level the highest risk in your system and this is something that's sort of becoming more generic as these risks are to expand and scope and one of the places where we've seen risks especially economic risks expand a lot in scope is in cross-chain assets so um you know of course Bridges have historically been the main source of cross-chain assets leading to security vulnerabilities of course as we all learned over the last week uh multi-party computation can

really mean single party computation uh As multi-chain proved um so fast forwarding you know if we look if we take a forward-looking view on this where do you see economic risks diffusing over time especially in the cross chain world where these risks are less Atomic and some of the guarantees you have even from things like debt caps may not actually be taking into account some of the remote chain behaviors and you know what do you think mitigations for those are yeah coming from a data background like to get a little bit in the Weeds on this one but I think I think it's really

important to realize that sometimes we're mapping traditional Finance modeling and I mean we the data Community is guilty of mapping traditional Finance mechanisms onto our D5 mechanisms as if that's going to be like a one-to-one and so we're using a lot of traditional methods to both project over time to do our risk models if you have automated systems that are doing any kind of risk detection or anomaly detection a lot of these things are not necessarily utilizing web 3 subject matter expertise to the extent that they should in my experience so I think really it becomes to say like where it's going to diffuse over time and sort of guess at where this is going to go I think the subject matter expertise and being close to

closer to understanding sort of even at a community level what the different chains represent what they're used for how those communities May behave distinctively and present different risk surface area we could you know do a a quick projection model and just use Maine just take everything into eth before the data gets ingested and oftentimes that is what analysts are going to do but you could also represent each chain as a signal and we understand that layer two is also as a signal is someone utilizing layer twos which layer twos are they going between sometimes that could be a anonymity preserving mechanism as we start to sort of dig into these models you can add Nuance to it when you understand and respect the difference in the way that these

Financial systems function and we're not just sort of slamming them through the the models that work really well for centralized Finance so I sort of see a a continued blossoming and Nuance with multi-chains more layer twos on the horizon more use cases and interesting communities popping up there around these different things and I see that being the onus then on data scientists and analysts to take those signals seriously and understand that any of those could help be not necessarily a fully independent signal but one that's in close relationship with your more traditional risk signals I mean I agree with you like probably the only way to deal with those kind of

risks especially in the future is going to be like big data approaches because D5 is at 24 7 business and only way to automatically be able to assess what's happening is a real-time assessment through Big Data approaches now the question is like how far are you going there because the main problem like when you go in this direction and virtuality are going in this direction you realize like there are so many of those trigger points so many so much deepness you can reach and the complexity gets so high the question is like what is the meaningfulness out of it and I guess there is no way around besides this preventive security related

Solutions which are there when they're when they see something's happening dedic is this at the stop um I believe the best way or the safest way is going to be once we reach a point where we indexed or whatever the whole ecosystem we have most of the eligibility captured and we understand the interconnectedness there that we can kind of build risk models what could happen like because the problem is now D5 small constantly new Protocols are arriving they are getting from zero to like almost billions in liquidity very fast it's kind of hard to integrate those protocols make it like get holistically what's happening but with

time D5 will get more stable molecuity will be there I guess most of the liquidity will be like with top 50 top 100 protocols and then all these big data will make approaches will make a lot of sense you will be able to capture the equilibrium of stability I would say like in the space yeah yeah so other than potential Bridge hacks and you know getting wrecked which is really like a hard problem and you know also very hard to analyze and also to predict we also see you know some other phenomenas and there there are actually things to do it used to be very common you know like for a new L1 to come and just for

compound and have a and then list like completely standard assets such as is Bitcoin some kind of stablecoin and then comes you know come and say okay we have exactly the same assets as compound and other on mainnet so let's set you know the same risk parameters Etc so I think even at that level and this is you know something that you know projects can actually operate there so understanding that even in the financial setup you know the liquidity is very different on all chains liquidations especially big liquidations might might take a much longer time to execute because the liquidity is fragmented and you know it's passed

around and mostly on mainnet and these are things that can be modeled and you know and we do model but it's also important to have some awareness there also it's mostly best practice you know kind of on a technical level if you set up a new Landing Market on a different chain so more often than you know so okay you kind of make changing a lot and eventually they do deploy some blog some Oracle there but very often the oracles actually quote not what you think they quote they quote the price on mainnet not the price on your chain uh and then okay you know so people maybe enjoy kind of mocking you know

this Landing markets after the attack but there's no really a way around it you know uh typically they are forced to do it uh but there could be you know some monitoring steps there that could you know act in some near real-time manner at least to mitigate this so it's a you know like Oracle Integrity decks liquidity these are the things that maybe you could handle as a question protocol and then for Bridges you know mostly pray that the bridge won't be attacked yeah at the maker we have this incredible hard task right now to actually quantify to calculate risk premium of of certain exposure to to different l2s through certain Bridges and if you think about it like that's incredibly hard like these are

low probability high impact events right it's like uh I don't know insuring a house against earthquake um but we have like three years of data and um yeah it's going to be really hard luckily we have L2 beats supporting us um who are probably the best in space with the risk framework um so there is a benchmarking approach to it where we could actually identify um and the the risk scale of certain Bridges and l2s but again yeah coming up with a with a final number we actually need for this new reformed maker system where allocator Towers will be charged to deploy Capital um it's it's not going to be easy for sure yeah I think I think Iran's point about

um you know oracle Integrity across chains is probably one of the biggest things that we've seen as the source of loss on on some of the the third sort of like lower liquidity chains um but I think it's not even necessarily just strictly the bridge risk as much as there's also a people starting to do slightly new mechanisms that you know interact with consensus more or like take advantage of particular sequence or guarantees which don't Exist Elsewhere and then they don't realize they redeployed the you know a forked contract that makes particular assumptions about the ordering behavior on mainnet versus the ordering behavior on a particular L2 um and those types of things have

started to really been sort of blossoming over time I think we saw the first ever real consensus instability causing huge defy loss attack in April of this year when um you know malicious eth2 proposer uh was able to get the contents of a block before sandwich everyone and then kind of cause some kind of long-scale attacks now this is probably the most sophisticated attack we've ever seen uh so far in terms of the amount of sophistication of someone having to run a validator having to probabilistically know roughly what time they would would be chosen as a proposer than based on being chosen as a proposer injecting a bunch of

fake transactions and fake fake blocks at the right time to cause a fork to to lead to Big laws so you know as these types of things start to become much more plausible and doable in a fragmented L2 world how do you how do you think about these interactions between defy and Mev and you know how that's going to change protocol design over the next cycle yeah so Mev is actually a really great example of when because there was this economic incentive the community really hurried up and built some products that are extremely sophisticated they operate in real time the the amount of scanning that they're doing with available chains is super impressive and the development

of that over the last two years is pretty incredible so I think we need to do something like that for anomaly detection as a community and this does get a little bit more gray because this turns more into the realm of sort of the whole Community taking Mutual responsibility and also those best practices being shared in an accelerated Rapid Way so I think I really like that uh Mario brought up like the need for indexing and index versus data products like almost as a public good making this like clean data available making contracts transparent uh commenting things out in reasonable ways that sort of allow that increased level of transparency these kinds of like layer zero level practices and sort of like layer zero level cultural tenets that the D5 Community can continue to cultivate or maybe begin

to cultivate in many cases will create the more secure systems that we need because then you do have data scientists and and individual auditing groups all the way to the level of the protocol being able to develop sophisticated near real time if not real time monitoring for anomaly detection and at that point when you've described what your expected behavior is in your system then you can imagine that even being moved to the contract level if we understand the expected behavior when the expected behavior is is triggering some kind of um you know alarm Bells we could over time begin to move that even to the way that the chain itself is deployed or other mechanisms not yet really experimented with

so I think it again sort of data nerd answer but I see a lot of this coming down to how are we going to think about the community's responsibility and expectations to sort of front run the exploits that are continuing to manifest and even the breakage that's not necessarily coming from a malicious place but the breakage that can potentially happen when we're in such a highly experimental Realm I personally believe it's a really tricky topic um the problem is like when we are talking about Mev it's a very short-term event to say it like in this way and what

the the problem is like I talked with many of those mmv strategies who are running around and I learned from them they are now building MAV strategies for Mev strategies so basically then try trying to trick Mev guys who are doing mmv strategies and then the question is okay if everything is happening like instantly like you are fighting on the maple side how fast how are you able to react immediately on that side I mean it's we are not anymore talking here or not that you have few blocks that you can react or something like you you have to be able to immediately detect and do something around that and the question is like are you able to detect and then what to do like how are able to do that instantly first question

um I believe like probably from the protocol design I mean there are solutions who are trying to make the mempool private and so on who are going to change a bit a little bit protocol could be the way forward but I'm not sure this is going to be mainstream so I have a kind of pessimistic view on that side yeah so I personally think that mbv you know might just become another tax on blockchain but but I think definitely I don't know maybe again layer and risk taking solution maybe could impose a so-called of you know some sort of consensus attack driven by you know external incentives a second General the problem of having something which is incentive compatible

and relying only on economic incentives is pretty you know then long-standing open questions in my view even Bitcoin is not necessarily immune you know from this stuff Bitcoin is only sort of proven to you know act correctly when you have honest majority not when you have potentially like a rational or incentive driven majority and okay this is kind of debatable but you know at least one approach on a technical level I know maybe some ZK magic couldn't solve that if you know you will be able to somehow successfully separate the execution layer from the uh the way you build blocks in which consensus but yeah I don't know much about it

yeah I'm certainly not an MVP expert and uh you know these things are going to happen um the most boring cancer would be that it makes the space more robust um I know the fix was deployed in this case but uh I also think you know mailbox get a lesson you know it's okay in some parts sometimes but I'm more Curious what's your take turn because I know this is your is your area of expertise um I think it's actually interesting because these types of attacks have been people been talking about them for almost five or six years like the first feather forking paper I think was like Andrew Miller wrote in 2014 the first sort of like Time Bandit kind of analysis of like this was probably 2017

or 2018. so people talked about this but there was never any real incentive for the validators to ever do it because it's quite technically risky like you you're slashing you could get slash for more than what you're trying to earn uh you also have to do a lot of timing attacks of like ensuring that your position in the network is sufficient that when you're competing with another proposed block that yours is able to reach the network efficiently uh but I do think the interesting thing about layer twos is that having single sequencers makes this a lot easier to do these types of attacks so from my perspective the fact that someone was able to execute man now of course there's a fix and you can argue that oh like the relays should not have been able to send invalid blocks and to the

whole network but that's sort of more a problem of like the the design was sort of had some centralization feature uh and that feature was exploited and now it was sort of made harder to exploit it but it's actually not still impossible to do the same attack right now so that's sort of there's sort of this this interesting surface area and I think in l2s this is going to be a much bigger deal because there's really only one sequencer in a lot of places and you know of course right now the sequencer is your wink wink nudge nudge best friend like good guy won't do anything wrong right but uh obviously that's not gonna last and I'm sure there's going to be a malicious all two sequencer that I think the l2s are going to have way more of

these issues than than we give them credit for that was my my bully pulpit on that but another kind of thing that's kind of become really interesting in this vein is that some of these technical risks of how contract execution works and um how people have implemented particular mechanisms uh affect economic risk now the Oracle case is the simplest one right of like where you inject Oracle data how you use Oracle data what Oracle how staled Oracle data is ETC or how synchronized it is to your environment but we've also started to see a lot of other technical changes to markets impact their

efficiency versus risk trade-off and I think for instance examples of this are people working on on Oracle free style lending protocols or risk protocols um so I was curious from from your perspective which kind of technical changes have people been making that have in your mind been better for both risk management and risk control and or have been worse it could it could be you know it could go both ways of course the simplest example is of course the oracles but I think people can start pretty much because I know you've spent some time on the or free part of the world um yeah I mean I could start with maker there are two maybe three features um so one thing that's kind of

interesting to me and maybe only maker has I'm not sure is this concept of rate limiter on the depth ceiling part right so even though the depth ceiling is really high you allow just a certain increase in time right um of course this imposes two new parameters some governance overhead it could also curtail growth right because it happened during bull market when the institutions were meaning like crazy and you know the dab silic was kept for 12 hours and they couldn't mint more even though you know we would allow a higher exposure but there's this rate limiter for a reason because if there would be an exploit it actually protects you right another one are circuit breakers for auctions right um you could make a circuit breaker and there is one at maker where again you need to specify parameter when you say

at certain price drop for certain collateral um you know let's say Define it at 70 percent you say for certain token you say yeah it's more likely the oracles are manipulated then the Market's actually falling and to stop auctions in such case right so there's this parameter that's that's also there um but yeah regarding corticals um again maker is quite specific because you it has this one hour delay um because of this delay um oracles are safer I mean technical risks are lower because oracles can be actually Frozen during that hour but then you start affecting you start making trade-offs right because Oracle is is delayed um auctions need to be different so

there are Dutch auctions the Dutch auctions are slower because the auctions are slower there's a bigger Market risk because there's bigger bigger Market risk we needed to compensate it with slightly higher liquidation ratios right so if you look at maker versus other compound it has slightly higher liquidation ratio for for that particular reason um and yeah you could even say this again curtail is your competitiveness right so you always keep making this these trade-offs last thing I mentioned I'll mention regarding co-workers um yeah there are now new designs oracles or a class Landing markets such as ajna that was launched I think yesterday um and yeah I looked into the design it's uh you know because there's no

oracles it gets really complex on the on the auction side right um there's a whole new complex mechanism of how you kick auction how system penalizes somebody who kicks auctions but it shouldn't because the market prices is still okay I mean the ultimate ratio is still fine um so we start imposing you start making trade-offs basically that's that's the TL there yeah so I I think out of historically a lot of the lending best practices sort of started From compound you know back in the early 2090 or 2020 you know most of other first features or also following compound and I think yeah like one nice trend is that we kind of see even compound itself you know kind

of evolving uh and kind of self-learning and trying to change parameters there so obviously you know even compounds started without any ball caps and Supply cups and now it's becoming you know sort of best practice and it's much easier to one minute risk management in such way compound V3 is also going to the direction of mostly segregated markets where you have one debt asset and maybe one collateral or multiple collateral but still segregated I think liquidy sort of solved the problem uh there was a huge you know kind of Gap or even bug about not socializing bad depth so I think liquidity will the first one to do it uh maybe I will end with you know maybe

a more concerning Trends I think there's sort of a trend now trying to improve the liquidation mechanism towards you know sort of auction or variable fees in order to save Mev I think for example this there's also downsides okay so the evolution is not only mixing easier but also sometimes have downsides I know we uh we just got our one minute so I want to give everyone one last concluding thought so what what thing are you most excited about in that related economic risk that's either going online or just came out in the last you know for the next year like what are you looking forward to over the coming year I believe what's going to be interesting is to see like these Risk Solutions that are

coming like more and more in the space more competition is there um and that will lead also to more stability in the space and hopefully also when we look at the middleware Innovation site we will end up in a situation to have something like a data driven smart contracts they are going to be smarter more adaptive and this is like exciting to see like it's a huge risk of course although it's a double-sided sword but it could also help on many topics we have at the moment yeah sort of being able to make good use of some recent gains in distributed computing and this is everything from like consensus layer attack strengthening like perhaps we get used to seeing what the minimum viable right

number of nodes is and what the mathematic principle is that describes the strength of a chain before we even like inform adoption or inform that rollout I don't personally think I don't want to speak here but I don't think any of the layer twos are even close to meeting those needs right now just from a technical specifications point so I'm excited for for web3 to kind of be in mutual dialogue at a few different levels like synthetic data AI guided has been really prominent in web 2 progressively more and we could do that with you know synthetic on-chain data to sort of begin to test principles stress test them and see them in practice in a more pragmatic and grounded way then let's ship it and hope for the best yeah so I'm most excited about the

naturally I work a lot about is trying to sort of replace a lot of the risk mitigation logic and replace Risk Managers end out Decisions by smart contacts and I'm also giving a talk about it in the evening session so yeah come hear it out um mostly probably excited about this permissionless pulls for landing such as the sergeant case not necessarily quarter class style but just like uni swap style blending right where I think fuse was close to it right where anybody can deploy pools so and different LTV ratios right so we have full flexibility and you know the most Capital efficient markets actually would come from this kind of New Primitives

cool well thanks everyone for for your thoughts and uh give a round of applause for our panel [Applause]