Curve Hack Explained | Roundup

4 Aug 2023 · 1:01:52

Empire's Roundup brings on Blockworks research analyst Ren and lead data reporter Andrew Thurman to break down the $70 million exploit of Curve Finance. They walk through how a Vyper compiler vulnerability was exploited, which Curve liquidity pools were impacted, and the MEV bots and white hat efforts that raced to recover funds. The conversation also covers founder Michael Egorov's liquidation risk across DeFi lending markets and the resulting OTC deals to stabilize his positions.

Speakers

Topics

Transcript

all right everyone welcome back to another episode of Empire you have Ren and uh Andrew Thurman who recently joined uh blockworks uh as our lead data reporter uh building out the the data reporting side of the business so Andrew pumped to have you not only on the podcast but a blockworks man yeah no good to be here yeah fun to have you here and ren welcome back to the show man thank you it's editing back all right guys biggest news of the week by far was uh was was curve um curve uh curve got hacked this week couple couple big pools impacted had a lot of second order impacts both on the founders positions which have started to get hunted as well as just on kind of the rest of defy I would say there's other things happening in the industry right now too but the curve hack was Far

and Away the most important thing and it's almost unfair of me to call it the curve hack because it really wasn't almost on curve actually it was on viper but maybe we can actually start a really high level for for folks who don't know what curve is I know this might half the audience is going to be frustrated that we're digging into Curt like what is what is curve here but Ren maybe you can kick it off with just like quick refresher on on what is curve and why why is it so important to defy yeah sure so curve is a decks it's one of the largest dexes in the Divine ecosystem along with unisob it lives primarily on ethereum Main net it was one of the first pioneers of ve tokenomics where someone could lock up the native token and then they could basically use their

voting power to direct admissions towards their liquidity boost for their tokens or their products and basically that solved a few problems for D5 rather than emitting your own native token and diluting your own token holders you're able to use curved emissions because for example curve has a much larger market cap emissions there are a lot more effective and there's sort of like the whole ecosystem built out around curve you know you have curved convex you're in staked out there was this thing that was known as The Curve Wars because as we all know liquidity is so important and whoever had the largest treasury or War chest of Curves tokens were able to direct the most admissions to the liquidity cruise and whoever had the most liquidity in their liquidity boost

more often than not had the best product to offer to use it so curve by far at large has been a staple within the D5 ecosystem for a good two three years now to be honest a lot of protocols use them for admissions a lot of Protocols are deeply into interconnected into their ecosystem and I think a lot of people consider it to be one of the D5 Blue Chips along with the likes of unisoft synthetics or D5 1.0 whatever term you want to use anything that Ryan missed there uh I just add um that was a very good intro um they sort of have their Niche with stable swaps in particular um they're ideal they're an ideal venue and arguably the most important source

of liquidity for you know swapping your Stables like your usdc for your usdt um this is also you know this is the developers protocol too the these Michael eagerov the founder uh when I talked to actual Geniuses they're he's the guy they all say oh he's the genius and also um you know this is technology that's been adopted uh by state level actors there's a couple cbdc proposals that are going to use forked or modified versions of curve so this is you know in addition to being I think the second largest decks systemically important for very particular types of swaps and um you know this was a really good team this wasn't just some forked crappy

project that got hacked here yeah so for folks who haven't used curve but might be familiar with uniswap if you go to uniswap to trade kind of the long tail of tokens you're going to curve to swap stables and that's why it's really important to defy Andrew can you maybe walk us through what happened earlier this week what what happened here start at the beginning sure so um was throughout the day on Sunday uh starting at around 8 A.M um it was discovered that there was a flaw with um a Viper compiler for um a select number of curve pools that use this compiler um this version of the compiler uh what this means in practicality is that uh um

a particular curve pool jpegs uh nft lending profile uh p e slash eath pool where you could swap this um nft loan back derivative for ether um that was exploited for about 11 million uh in peace and eth um initially uh sort of funnily enough in a sense deleted tweet curves seem to imply that this was a flaw with the jpeg protocol and um a few minutes later it came out that it was actually um these curve certain select curve pools that were at risk what happened throughout the rest of the day was a foot race I think it's the best way to call it

um there were black hat hackers uh what appears to be multiple different ones usually in an exploit there's just one guy who found a flaw and went after it um but as the knowledge about this particular exploit and attack Vector uh spread multiple people uh decided to uh you know sort of try out uh stealing some money from these curve pools uh simultaneously to all of these black hat hackers figuring out that there was this exploit uh um underway and one that was possible uh White hack teams uh you know various War rooms from around the community they were attempting to execute um uh these um you know sort of bailout

transactions they would drain these vulnerable pools before the black hats could uh thus saving the user funds um and finally there was a very very interesting third party who was involved in the race uh which was a couple of generalized Front Runners which are a type of Mev Searcher that um sees profitable transactions and steps in to execute them themselves um and there's pretty good evidence that uh you know somebody might have saved a great great deal of funds a huge amount of ether um while they were sleeping because their bot just executed these transactions for them um but we can talk about that a little bit more later but uh throughout the day Sunday I think it was a total of four affected pools and eight different

transactions um some of them white hats some of them black hat ultimately drained about 70 million in funds from these pools uh 50 of 50 million of which um we now believe roughly 50 million was uh black hat exploiters who managed to get away with the money great summary what kind of attack was this how did how did this actually happen I can uh touch on this so basically what happened is a reagency attack uh the agency attack is when a function makes an external external call to another untrusted function then this untrusted functional contract basically makes a recursive call back to the original

function in an attempt to drain funds where things kind of go wrong during a re-engines attack is when the original contract fails to update its state before sending funds so in layman's terms I'm able to withdraw say one if data deposited but the contract does not update my balance to minus one if and I'm able to just continuously call that withdrawal function again and again until I withdraw that entire pool specifically for this curve exploit what happened was the code itself was fine it was written in Viper vipers like a python mic programming language for evm chains but the compounder basically has

a compounded code and within that there was something that caused the vipc card to fail so it's kind of interesting I don't have a technical background but the code you write is fine but basically when you make it production grade compile it into a smart contract then things go out of whack um and so actually this bug has been around for quite some time you know this Vlog was first discovered in oh was first pushed to Viper in July 2021 it was subsequently fixed in August 2021 and another update to Viper but because curve did not upgrade their smart contacts they compounded once in 2021 and it's been the same spot contract ever since there's been that potential exploit Vector there for a good two

years now to be honest yeah it's uh it's kind of wild to see this re-entrancy attack because I think this was the same attack that was used in the the Dow hack back in 20 whatever that was 2016. I think they're like the original Dow that ended up forking ethereum and uh into ethereum classic as well so it's kind of crazy to see this so what were the pools that were impacted here Ren or or Andrew whoever wants to take that sure I can discuss that one so it was a lot of um ether and ether derivative pools and then one uh structurally important uh curve CRV the governance token for the curve protocol ether pool so there's the

jpeg peath pool the metronome um Ms eth pool the alchemics pool arguably the the hardest hit um Al eth and ether and then uh curve ether so the only one that wasn't the only pool that wasn't for swapping between ether and what was supposed to be a like asset why is the I would say one of those pools is more important than the other um CRV eth let's let's dig into that a little bit more so why is that such an important pool so this is going to be a whole discussion later but basically curve with that prawn curve is the main anti-in liquidity source for curve the token which means anyone

wanting to swap in and out of curve and Eve has to be routed to that proof if you want like any semblance of liquidity if I'm not wrong I think around like 20 million of strain from that pool um so in and of itself like sure it doesn't really that much but there's a few important factors here first is that if all of the curve and Eve is drained out of that blue the curve token price goes down by a lot at least on chain maybe it doesn't go down that much on centralized exchanges but if I'm not wrong on that Sunday the curve price for that to reach something like 15 cents while the price was still like 60 or 55 cents on a centralized exchange and so a lot of protocols that depend on it for emissions like your admissions basically

de facto just went down by like 75 one dollar value perspective and also with those admissions whoever receives those admissions can like sell those submissions right actually like US dollars or like um the second and more important thing is that there is a lot of Curves that's collateral lending protocols by cos founder Michael eggerov um and basically if you want to liquidate that you have to go through that liquidity pool on chain at least um and if that liquidity doesn't exist anymore and you can't really liquidate someone's loan and when you can't liquidate someone's known as a collateral value it goes down then you kind of get like a big financial crisis so here's my understanding of how this went down and I'm going to try to

try to draw an analogy to non-cryptoland to almost uh to try to make this more understandable basically so the curve eth pool or west pool my understanding of how this happened is there were two different attacks one of them was the the first one I think was the exploiter opened a 10 000 West flash loan from balancer unwrapped it to eth they then provided 400 eth as liquidity to the curve uh to the CRV eat pool received like roughly 10 000 CRV LP tokens swapped 500 eth for like a million CRV withdrew that CRV and eat from the pool burn some of the tokens withdrew the CRV burn more tokens swap CRV for eth and then repeated the process until

basically the CRV had been drained from the pool my almost like dumbed down version of like this in non-crypto terms and like what a re-entrancy attack is I'm going to try this and you guys tell me if I'm wrong here but imagine imagine you have a bank right and you have a customer let's call him Bob walks up to the bank teller uh asked to withdraw the money so the bank teller first hands out the money and then records the withdrawal in the bank's Ledger which reduces Bob's balance but then suppose that there's this like mischievous person that also walks in the bank let's call them Sally right and Sally wants to try to exploit this system so Sally walks up to the teller requests a withdrawal tell her hands over the money but before the teller can record the withdrawal Sally interrupts like it distracts them asks a

question or comments or something and the teller you know starts talking to Sally forgets to record the withdrawal so while the teller is distracted uh uh uh Sally then asked for another withdrawal the teller forgets kind of like almost doesn't realize what happens forgets what happens because the first draw hasn't been recorded in The Ledger hands over more money to Sally and the process repeats allowing Sally to withdraw far more money than she actually has in her account uh and and here the bank would be the smart contract salary is the malicious attacker and the tellers process of giving out the money before recording the transaction is kind of like the vulnerable contract code which sends funds before updating its state Fair analogy not a fair analogy Andrew

what do you think I'm trying to look it up it's this classic uh old-timey movie but uh I think that's a good breakdown um maybe a simpler one would be uh it's it's this scam artist who ends up adopting a little girl and he teaches her how to do this funny trick that you can do with certain people when they're giving you change where you just keep swapping money back and forth and they get confused and end up giving you way too much um I I think that uh it's it's hard to analogize because it's so complex but no that's that's a good swing what do you think right I think that's a pretty good explanation too I mean I think in crypto terms too it's like uh this is I read the summary somewhere and I wrote it down but I

forget where I pulled this from so sorry for not citing it but the um I'll just read it the re-entrancy occurred between the remove liquidity and AD liquidity actions or pool depositor should ordinarily be entitled to pool tokens equal to the product of the total pool token Supply and the fraction of the depositor supplied liquid liquidity however due to the reentrancy bug the AL the allotted pool tokens were calculated with the pre-burn balances which then allows the exploit to kind of infinite mint pool tokens to create this fraudulent claim on the entire contents of the pool so um Andrew any other thoughts on like renan I know Ren just commented this but any other thoughts on like why this CRV eat

pool is so important or just like how this happened or details on this yeah CRV East doesn't have a ton of uh on-chain liquidity um and that curve youth pool was arguably the largest one you know um 10 million 12 million or so of ether and so if these loan positions which we'll talk about a little bit ever did uh get liquidated that was really where a lot of people expected to be able to do it and do it safely um and so suddenly you know these D5 protocols which had already started making noise about uh curve founder Michael egorov's positions um you know there was uh some talk in

the Ave governance forms even just a few months ago um discussing how they might pose a little bit of risk they had simply gotten too large and the collateral backing didn't have enough liquidity if there ever had to be a liquidation it all looked much much worse after that uh curve eth pool went down yeah why is this um all right so this wasn't actually curve that got hacked it was it was a bug in Viper is that a fair thing to say I think curve was still the end Target of what guy got hacked but Viper was sort of like the means of how they got attacked I think that's how I would put it I think that like language diversity and ethereum is a good thing we shouldn't

write everything in in solidity um and Viper is this sort of famously underfunded project that a lot of really crunchy developers like to use um and so it's a little heartbreaking that they're they've sort of become the scapegoat for this um and it's also worth noting that um curve is a really important patron of the language they um funded it with some git coin grants and payments out of um governance uh and I believe uh I saw somebody on Twitter I didn't verify this myself but the person who approved the um uh uh the commit the push to that the uh re-entrancy attack actually used was

in fact a curve developer they are um maintainers of the language and so it's it's really tough to say it's one team and not another team and I understand the instinct to do that but um you know these These Things Are structures that are built on top of each other right and so you you just assume that uh somebody's smarter than you has done the legwork to make sure that everything is good with the compiler and you know who's really at fault at the end of the day is I think a much more complicated question um but ultimately I it's it do you call it a flaw and curve or do you call it a flaw on viper it's

it's I guess the I guess the important question is like not the semantics right the important question is if this was a an issue with curve then the the the um the problem you could you would think that the problem is siled to curve but if this is a problem with Viper which is what a lot of folks use then my immediate I know everyone's focuses on uh Michael's CRV uh position and the potential CRV uh you know it's potential liquidations but I feel like that is the wrong place to focus I feel like the real focus is on like you know if everyone I'm sure the bug has already been fixed in Viper I'm sure that's like not a big deal but if everyone's using the same smart Contracting uh language here and and uh compiler with Viper and stuff like that then like

I don't know my thought goes to other protocols is this a concern of you guys or not really I I definitely think so I think it's more of a viper problem but I want to go one step further actually um after this exploit happened people started pointing out that okay we all know somebody's probably the most used smart contract programming language within the evm ecosystem um and solidity also has the ability for devs to sort of like Auto do these optimizations when they're compiling their code and actually in a recent child of its audit report for like a new lending protocol called Finance the audit report basically told us that there has been several optimization bugs

with solidities optional compiler optimization and you know if you're a Dev chances are this is a box you check because you want to like optimize your smart contract you trust solidity but over the years starting all the way from late 2018 there's been like a significant number of High severity bugs in that solidity home powder so for all we know there's like one super big bug in the solidity Optimizer doing compound that a lot of smart contracts are random watches just you know like sometimes it's a bit of luck and no one knows what's out there and I think that's also a problem with crypto right like it's really really really hard to write perfect code like even apple or like the best big tech

companies in the world with the most developed like the software engineering environments do you see like a zero day exploit pop-up like every other month to be honest and like sure they patch it pretty soon but still like the fact that is you're the expert can exist for Apple like it's pretty scary and I think the same probably is the case for uh like any smart contract programming language hey everyone we'll get back to Empire in just a minute but before we do that I want to let you know that we have permissionless coming up permissionless is Big conference that block works and Bank lists put on together it is the biggest the best D5 conference in crypto this year it is in Austin Texas September 11th through 13th if you've

been in crypto for a while you know that bear Market conferences are the best kind of conferences we have a phenomenal lineup of speakers a lot of the guests that you hear on Empire are both going to be speaking there you will have the opportunity to meet them there and a lot of the topics that we cover on Empire ZK attack roll ups account abstraction Mev app chain thesis a lot of that kind of stuff that will all be discussed at permissionless this year so because you are a listener of Empire you get a special discount that's right Santi and I negotiated with our marketing team you get 30 off if you go to blockworks.com forward slash permissionless Empire 30 is going to get you 30 off your ticket today when I'm recording this that's

about 300 off your ticket so type in Empire 30 when buying your permissionless ticket you get about 300 bucks off click the link at the bottom of this episode it's in the show notes do it quickly because prices go up all the time and if you are going to permissionless hit me up let me know shoot me a DM on Twitter I would love to meet up with you there yeah this just spooked me because the curve team is I think Andrew was saying this earlier like is one of the best teams in the world at writing new code and building unique stuff in defy so you know if they can be vulnerable to this I don't know it kind of Spooks me yeah no I think there's another important thing that uh we should talk about there's been a fair bit of community discussion

discussed on Sunday morning um when the first I think alchemics was the first food that got exploited Peck Shield if I'm not wrong like tweet it out uh saying like hey uh at uh Alpha mix you should probably check this transaction I don't know it was uh jpeg um they basically added the jpegs for jpeg protocol on Twitter saying hey you should check out this transaction and this is something they do pretty often when there's a hack going they'll tag the team on a team and they'll put like a screenshot of the transaction showing there's like a large amount of funds um even your protocol I think on the day there wasn't so much attention paid to it but in the past few days I've seen a lot of discussion on Twitter you know did Peck Shield or I think block SEC

also posted about the export or like their vulnerability should they have posted about that exploit on Twitter before like getting in touch with like white hat hackers or curvy cells I I think it was like a few slides to what happened apparently they tried contacting the curve team but they didn't get a response from them and so they had to resort to Twitter etc etc but there is like a certain moral discussion to have what is the best 70 Avenue to let someone know of like an ongoing exploit should crypto have sort of like centralized War rooms at like a group of white hat hackers that are always ready on standby to respond to like and exploit and yeah sort of like who is really to blame with the exploit or the magnitude of the

expert have been so large had they not posted that on Twitter because my gut feeling is that hackers like the original hackers themselves not like generalized fund running mvpots those people are fairly unsophisticated I want to say sometimes it's just they find like an interesting quirk in the protocol and you know half the time you've read about you read about hackers like they haven't figured out how to launder the money like the order financing like that guy had zero plan with what to do with the funds um and so perhaps he didn't have a idea or other people didn't have this idea of using this reagency um attack Vector but it's only because boxing or pekko or whoever posted about on Twitter then they were made aware of it and that sort of exacerbated the

effects of the exploit can't have your cake and eat it too like I don't think you can have a fully transparent industry where everything is on chain and um and not have this stuff happen right and so well I mean I I'm sympathetic to that to the extent that a sufficiently sophisticated black hat could have looked at these exploit transactions and sort of reverse engineered how it came about um but I think yesterday was a really unique situation and that there was this foot race underway um between the white hats and the black hats and um you know Richard Chen over at ottersec wrote a great blog post about these two failed white hat transactions that didn't work because

they were um they were uh uh they didn't do it in time by a matter of minutes by a matter of seconds like you know the the exploits the black hats beat them by a few blocks um and so and I think in a situation like that um you know Peck Shield sort of laying out and later in the day block SEC doing the same laying out exactly how to execute these malicious transactions I I mean it rises above a moral question it might open them up to Legal liability um you know that's that it was a unique situation and usually pexfield does like I think of them as a public good when they tweet out you know hey there's an

exploit underway um but when there was still vulnerability and there were people you know engaged in this Race Against Time to try and save user funds that's a dicey situation yeah maybe before getting into the uh like how much got hacked I I was going to shift uh into Michael's position liquidations but maybe before that we can talk about these Mev um Bots and kind of this battle between there so there are three groups that got money out of this there are the black hat hacker they're the hackers right the the bad guys basically then they're the white hat hackers um who are hacking it but kind of siphoning off money into these safe pools with the aim to keep it safe over here and then send it

back and then there are the Mev Bots which adds a really interesting third party here so Andrew can you walk us through these three groups but maybe focus on the Mev Bots because that's this like new group that isn't you there's usually two groups here white hat and black hat and there's now we now have a third third party here uh I think it was coffee babe was the biggest yeah my new personal hero coffee babe yeah truly so yeah give us some details on these MVP Bots um yeah how to explain it in layman's terms so I think to sort of add to your um you know somebody's sort of playing a trick on the bank teller uh scenario imagine that they successfully do that but right as they're walking out of the

bank somebody walks up and takes the money from them instead and they're the ones who actually leave the bank with the money in hand um so uh there's a type of Mev Searcher usually Mev Bots um nine times out of ten they're just arbitragers they identify price discrepancies between different trading venues and they execute these incredibly high efficiency incredibly quick trades in order to make little slivers of profit there are also these types of Mev Searchers known as generalized Front Runners where they will identify profitable transactions and uh seek to execute them before the person who's actually identified them um coffeebabe.eath is um a really well-known Mev uh bought an

address um you know throughout the day yesterday uh in addition to executing uh two different exploit transactions that somebody else had designed they simply used uh generalized front running to identify it in the mempool and execute that transaction before the other people could um they were they were doing meme coin trades all day this address like in addition to rescuing these funds was trading like Harry Potter Obama Sonic emu um for fractions of a cent it's just an incredibly well designed bot and it's worth mentioning that this address had done this in the past there was a sushi exploit that they front ran and ended up returning the funds so later in the day when this poster woke up and realized

they had about 4 000 East more than they should in this bot um you know can you imagine waking up and figuring that out um and uh got in touch with the affected teams and from what I understand um has returned almost all of it they had a little bit of MPE and the uh they also um front ran a second exploit of the curve eat pool that got 2800 each um and I believe they've returned all of it there might still be a little bit more MPE that they're holding but um this is somebody who's done this in the past and uh like like if if anyone ever kidnaps me just send like a single incredibly cracked Slavic Mev guy after that me like I

that's the person I want in my corner like they're they're just an incredible force it was it was wild watching this in real time I mean you're watching like a hacker like you're you're watching in real time as a hacker like identifies the vulnerability tries to steal I think I the one I was watching was like it was worth like five million bucks and then uh you know coffee babe basically just you know scanned it saw the trade bid some higher gas and replicated the transaction outbid them secured the funds and yeah they're returning the stolenath to curve so it's awesome to see I love it I think it's exciting um Ryan anything else on the white hat black hat Mev I want to say

the most interesting angle for like a lot of these attacks actually not just the curve pack is the ego angle like if if I'm running a generalized fun Runner bot uh and I don't really have control over the bot it's just like looking at transactions um but then I'm copying a malicious transaction that's exported some protocol am I on the hook for this um and then similarly like across the whole Mev supply chain you know from circus to builders to proposers like all of them get some processes for like bits that are placed throughout the way if a hacker exported like a thousand if and he bid 50 Eve to get his uh bundle like included do I have to give that 50 Eve

that I want as a proposal back I think we've seen this play out in the past uh I think it was sushi so she swapped like for example one of the light of editors got a hefty chance of 70 Eve from that Sushi exploit and since he was like begging for it back and in the back of my mind like it's Lido really or is the proposer the one really on the hook here or should it be on the hacker to return the full amount of original sums even those used five percent of that say to pay the proposal to get this bundle included I just think it's like a really interesting great area that's gonna happen again in the game for the foreseeable future yeah I agree with you all right let's try to focus a little

bit um so the sale price all right so as this happened uh the price of Kurt so there's curve the protocol and then there's CRV the token as this was happening uh uh you started seeing a bunch of cell pressure on CRV which then shifted attention to uh Michael um the founder of uh founder of Curves CRV position turns out he had uh he had levered up basically his CRV position I think he what was the total amount of loans it was like 100 million or 80 million or something uh prior prior to the hack and he almost immediately started adjusting his positions and trying to pay down some of it he had about uh if I can recall correctly 115 million in outstanding stable coin loans okay so he had basically backed uh he

basically put like 400 million of CRV I think and taken at as collateral these are rough numbers I'm sure I'm getting them a little bit wrong but and had taken out a you know 100 115 million dollar loan and had used uh that Capital to go buy some some pretty nice mansions in I think Australia so the cell pressure on CRV kind of shifted attention to Michael's CRV position and kind of the potential of of not only his liquidations but then if he gets liquidated kind of what the cascading Liquidations in defy and specifically infraction all they would look like can one of you guys walk us through um just like almost this self-perpetuating cycle of sell-offs and people like what it means to almost like Target this kind

of vulnerable CRV position and what you guys were watching for here yeah so basically Michael or Mitch had a number of loan positions on five different lending protocols it includes Ave faxland Abracadabra and a few other societies models I think they were a silo and inverse um basically on all of them he pledged varying amounts of curve collateral and he felt I think mostly UCT or some other stable coins against it and when you borrow on a D5 lending protocol your loan has to stay above a certain liquidation ratio because everything in D5 has to be over canalized we haven't

really figured out under collateralized lending yet so as a value of curve went down then people started really really getting worried about potential liquidation from these Landing protocols and what happens during a liquidation is basically someone else comes back and pays back a portion of the debt it's not always 100 of the debt it could be 50 of the debt first and then he'll assume a certain percentage of the collateral and in an Ideal World he'll sell the collateral for a stable to basically make like a raw like Atomic profit within one bundle of transactions the problem is that you have to sell curve in order to sort of get back to like a

US dollar denominated profit and that's basically where things start going wrong because we talked about how the curve is left through on curve itself was exported for 20 million dollars worth of liquidity so if you wanted to liquidate however much curve that Niche had pledged across D5 it's just not really possible if you look at the stats after the curve was exploited a one million dollar curved cell had around 85 slippage a hundred million dollar curve cell had around 99.15 so some ridiculous numbers right I think like a 300 million Car Sales just straight up impossible and for these liquidations to

work effectively the slippage can't be like 85 or 95 because the Liquidator incentives is only say like five percent for our oven and so ideally your slippers needs to be a lot less than that if you want to incentivize anyone to liquidate and it is sort of like a game TV problem in some sense because if one product co- liquidates first then whoever liquidates after him gets a worse execution fast when trying to sell his curve and if protocols aren't able to liquidate his debt at a good enough fight then what you end up is bad debt basically the protocol has lost money on a dollar basis and they have to assume that debt themselves and different

protocols handle this differently they have insurance funds but given the amount of Mitch's loans chances are they would have had to dig in and do both their Insurance Fund and more often than not they would print their native token in order to sell that off to cover whatever bad debt they have it's just not a good position to be in Andrew what were you looking for here as you were looking at like kind of cascading liquidations you were looking at Ave you're looking at frax you were looking at maybe like the interest rate kind of exponentially increasing in the frax pool like what did you what did you focus in on well yeah there was a point I think you mentioned this earlier where his position was being actively hunted um and it had been uh sort of attacked in the past um avraham Eisenberg uh of mango markets

exploit fame um had previously attempted to um uh go after this position by taking out a massive curve short position on Ave he ended up losing I believe um 10 million dollars but during the course of the attack uh Ave itself was left with about 1.6 million in bad debt as well um and so this this is like a position that defy nerds were aware of it's arguably one of the most closely watched in all of D5 maybe there's people creeping like closer eyes on what Justin's son's up to but this was a well-known account with this massive position and opportunistic Traders had already gone after it the past and I think very much did hear as

well um the uh Frack stablecoin pool um was uh topped out and the way frax's market works is um if it is over utilized the interest rate um increases at some absurd level doubling uh every couple of hours um until uh uh either there are more depositors or until people pay back their debt um arguably a clever design because you know it the protocol forced um uh Michael urov to pay down a significant portion of his debt otherwise he would have been liquidated and it could have led to some nasty uh problems

um what I'm keeping an eye on sort of as the dust is settled we'll talk about some of these OTC deals that igorov uh you know executed in order to pay down a lot of these positions but um there are a few of these lending marketplaces now that are taking what I think are pretty Extraordinary Measures um to sort of defend themselves and prioritize themselves relative to some of these other outputs um Abracadabra is one that attempted to pass a governance proposal earlier today that would have increased the uh interest rate on um uh the curved markets by 200 percent this is obviously targeting a single user and so I think you start to get into

um questions about is this like the right ethical thing um you know is it Michael's fault for taking out a loan on a protocol where governance had the power to do this you know to what who is in the right in these kind of extraordinary situations and how do you handle the game theory aspect of it um when it's it's a lot of curve to liquidate and uh it's unclear that all of these protocols would be able to do it safely I think this the slightly more contentious point of that Abracadabra government so far as it was that not only were they going to jack up interest to 200 and the original proposal a updated one I think Tony is proposing a hundred and thirty percent but that

interest would be applied directly to the collateral itself it's not interest that's accruing on the collateral basically what this means is that a centralized multi-stig run by the Abracadabra team is saying okay chances are you're not paying this back right now to protect ourselves we are gonna slowly claw back your curved collateral which like it's not a liquidation it's like a soft and slow and grassy liquidation and then Abracadabra is going to slowly talk so that over the course of for example six months I think that was a point of contention on top of the fact that they're kind of rugging or hunting is positioned by setting the industry 200

on top of that they're just saying hey you know like we don't care we're going through like centralized multi-sake we're gonna slowly claw back your collateral without like officially liquidating are they hunting his I don't know if I'd categorize that as hunting his position by Africa like I this just feels like them protecting themselves forcing him to repay yeah repay it knowing that he has to repay there's a bunch of people he has to repay and they want to get repaid first right um that's interesting so the like summary of like his position um so if he was gonna get let me tell me if I got this right if he was going to get liquidated by fraxland all of his other depositions were going to get liquidated too which would have meant that like there would be a couple protocols that would probably die due to

bad debt like like MIM or like inverse finance and things like that and then Ave was going to get stuck with a bunch of bad debt that they would have had to sell off in the open market is that like is that kind of the second order impact of his position there or do you think it goes deeper than that I I think that that's a fair I mean it's hard to guess what would have happened right uh one thing that he does is he tends to keep his positions all at roughly the same Health level um and so I think the worst possible thing that could have happened was liquidation hit at every protocol at the same time um that would have been really ugly but um ave's safety module which is effectively their Insurance backstop

Fund um they've got about 95 million in liquidity um and they would have had to sell Ave to um uh uh cover that bad debt but they hypothetically had the liquidity waiting there um and that would have been really nasty what's that didn't they just propose to do that didn't uh didn't Zeller over at Ave propose to start buying it back or are they not doing that um they might do that this morning or at least like a governance proposal was put up very very recently to acquire some of the curve use that for their own native stablecoin goal [Music] clever but yeah no um I I think now everybody is taking these sort of half

measures but it's really curious to think about what would have happened if it had all hit it once um I think Ave where the majority of the loan outstanding loan is I think he still has about 58 million in Stables uh taken out from there um they would have hypothetically been able to handle it but only if they were the only ones getting liquidated if everybody got liquidated at the same time and the price of curve went to zero it would have gotten really really ugly um and it's tough to know exactly what that would have looked like but um it could have been much much worse than it currently is is all I'll say yeah it looks like I'm looking at Curve right now it looks like money's starting to flood back into curve a little bit um do you guys think we've seen the

worst of it behind us basically I think so if you look at the numbers curves TV I'll drop 50 in one day from I think 3.1 billion to 1.5 billion uh since slowly rebounded to 2.1 billion I would say without the OTC deals that probably like the contagion would still be spreading but I think the OTC deals has sort of calmed the storm a little bit for now and it is important to note too that Michael eagerov is a tremendously well capitalized individual he's got a vesting schedule where like 140 000 curve tokens unlocked to him every single day and so um yes that's on his D Bank profile you can look that up and

that's in addition to the curve rewards that like he's a prolific defy user he's earning farming rewards every day too and so like the longer this goes on um the healthier his positions start to look just by virtue of how he's arranged his portfolio wow that's nuts I didn't realize that we'll put a link to his debank profile I'm looking at it right here um all right tell us about these uh tell us about these OTC deals so if he had started dumping into the market that obviously would have been really bad for the market and that would have probably exacerbated this so he started doing these OTC deals that looked like kind of three to six month lock-ups at a price of 40 bucks with a call option um if uh that can be in a three to six

month lockup that can be sold if the price reaches 80 cents something along those lines but can one of you guys walk us through the details of these OTC deals sure um so it wasn't exactly Michael selling on the open market because all of this curve is locked up as collateral so you can't sell something that's locked up as collateral because removing it as collateral would immediately decrease the health of your loan so what actually happened was that he agreed to sell curve to certain parties I think other Andrew dive into all of the parties that he sold um OTC too but he agreed to sell curve to a lot of these parties and what these parties did first was that they first transferred him usdt or other stable

coins he repaid his debt and then after repaying a portion of his debt he took out his some of his curve collateral and gave it to whoever bought these curve tokens because doing it like the other way and like how a sale should be done like we just wouldn't work for him given that his positions on the learning protocols existed and he made like a bunch of OTC deals to some good some bad people just different ways of looking at the salad and if you dive into that a little bit more but who are those DWF Labs it was uh Justin Sun DCF God uh Maki uh Jeffrey Huang um yeah uh uh Michael Patron AKA zero xifu who is involved in the collapse

well he was a former executive quadrica CX one of the largest uh sort of uh old school exchange scams um you know this this is a lot of uh uh very well known individuals who have a sometimes spotty reputation um and you have to wonder you know these are the buyers of Last Resort you know uh the prolific Market maker and OTC desk wintermute the founder evgeny gave away um he said that uh because of the people who were involved in these deals they specifically declined to onboard uh Michael ekrov as a counterparty um and you know igorov is also being sued by a trio of pretty well-known

um American Venture Capital firms um and so he I can imagine I I don't know what was happening in the course of these conversations but it's not hard to imagine a world in which um he didn't have a lot of willing buyers and so he turns to these people who are very well capitalized but don't always have the greatest reputation um it's it's really interesting deal terms too he was selling curve for about 40 cents per token uh which was significant haircut to the market price about a 33 Gulf there um and additionally uh there is an option for the buyers to sell uh if the price of curve ever eclipses 80 cents

um and that's now like lots and lots of curve that's circulating that could potentially like Michael's basically just trying to extend this out as long as possible because of those the unlock schedule right the curve unlocked schedule like over the next uh next year 400 million curve gets unlocked 200 million goes to the court team 100 million goes to the to to Mitch right so it feels like he's basically just like scramble I mean this is a really good deal for them they get to buy at this what'd you say it was 33 discount and then they can I mean they can just short on purpose to cover the risk so it's kind of a no-brainer deal for them it seems like yeah I mean I if they had offered it to me I would have taken it um stepped up with your 50 million that's

right that's right back then uh D5 reporter stepping in to save all of defy um no I I I think that uh in the the other thing that could lead to some really interesting situations too is that these were handshake deals these vesting schedules are not enforced by a smart contract um from what I understand a few people including Maki interestingly enough um have sort of deposited them into um uh uh have since sort of locked them take it of their own volition but uh some of the stuff that was sold OTC was sent to binance and there's no way to have any transparency on whether or not those were sold and so it seems like in addition to these deals being made with

people who you know aren't your ideal counterparty necessarily um they it just really feels like it was done uh somebody making deals with with their back to the wall a little bit Yeah Yeah usually what happens in these situations I feel like like we saw it when you know when all the when everything was kind of collapsing whether it was with Tara or what whether it was with you know Celsius or block fi or you know FTX stuff is you kind of had these come in waves right it's like all of crypto Twitter's attention is on this for like three or four days I have a feeling in the next like two or three weeks things will quiet down but I also have a feeling this is not the last we've heard of this yeah the positions are all healthier now um You you need like the price of curve

to go down to like 28 27 cents or something like that for for these to come under Fire again but yeah I mean these it's this position has been hunted in the past it's been hunted in the last week there's no reason to think that it won't happen again yeah anything else guys that you think is interesting or important to talk about on curve I I think a good question to ask here is that how did these lending protocols end up in this position because obviously your blockchain is an open database you can pretty openly see how much liquidity there is if you want to liquidate a certain like specific collateral type A lot of these learning protocols have

employed Risk Managers in the recent years I think it's been more of like a come to the spotlight in the last year or so for example Gauntlet or KS Maps whose job is to basically help manage risk for these Landing protocols um and so yeah it really begs the question if there is barely any curved liquidity on chain and D5 why are we allowing like 427 million units worth of curve to be pledged as collateral um I I don't really blame Mitch here for what he did to be very honest I feel like a blame the landing protocols study more like if you

if you let me take out a loan against an asset that I know is kind of illiquid and you allow me to take out like a hundred million dollars to be honest I think most of us would have done the same just to retain like the equity or like token ownership in our own protocol or startup um it's the job of the lender to sort of price the liquidity of that collateral asset I think it's similar like web 2 or like chat for example is the Peloton founder right um at that Peak Patterson was worth so so much and from what I've heard he took out a loan against his Equity run to buy a private jet want to buy a yacht want to buy all the nice houses um there's a similar Trend there um and then when Patterson just started

going down and down and down you go and sex kind of came here and say Hey you have to repay your loan and then when you realize what all of this loans were deployed in like it's kind of hard to do and sell like a private jet on a whim um so yeah I think there's a few things that are also very interesting Gauntlet or a few other Risk Managers for RV have repeatedly sort of put up governance proposals to say hey I think we should like bring along the value down to zero don't let Mitch pledge any more curve collateral don't let him borrow more against his curve collateral and if I'm not wrong every step of the way the community or the dial token holders have voted against managing risk for Mitch's position which I think is a

very interesting case since like the risk is obviously there you know everyone's just kind of fingers crossed hoping that it doesn't happen and this brings me to my other point where do you Landing protocols go from here assuming that there's not much they can do about their current position a first obvious Next Step would be rather than incorporating just pure oracles to use as a liquidation price you use sort of Market Dev articles either for on-ching or off-chain markets to see hey here is this amount of liquidity that's available here's how much could you would get if you would sell x amount of this and you were sort of price interest rates or loan to values against that so that brings us to another point if for

example there's an online article right um and it shows okay every protocol or there's a liquidity prove where someone will be able to liquidate 30 million dollars worth of curve okay like they'll take a three percent of the fish not the end of the world it wouldn't leave the protocol bad debt right and so you're a lending protocol you see that 30 million dollars worth of liquidity through Oracle or something and you're like okay I'm comfortable to lend x amount right but the problem is that multiple lending Protocols are sharing that same liquidity you know like everyone will see as if they were acting in Seattle but perhaps there would be five Landing protocols out there with the exact same curve collateral the exact same position and all of them would need to liquidate

do that same liquidity food then there's also a question of basically do I want to sort of be greedy do I just assume that other people won't want to maximize their profits maximize like the LTV or sort of collateral that I'm able to purchase curve because at that point you're kind of self-limiting you know um and I think we've seen enough and divide that people don't really like self-limiting even though we're all about like decentralization managing race blah blah blah but people just don't like self-limiting the and they want to maximize their business or profit so it becomes like a bit of a contentious point there and those are just like a few thoughts on where letting protocols go from here yeah those no those are really good

points I I saw um Michael Bentley one of the Euler Founders um they're they're in the process of getting back on their feet he was talking about how I think this is a real watershed moment for governance and lending protocols um and you were touching on this a bit like when Gauntlet you know the guys over there they they've forgotten more about risk than the entire of the Ave Dao will ever know right and uh the avidao consistently votes votes against them you know that's that's a real problem um and so I do like models like Oilers uh and you're uh uh ran your idea about the liquidity depth um oracles like you can build more sophisticated more complex oracles but

maybe the solution is actually to make it simpler like I always really liked Euler's model because um you know risk parameters were defined on how much depth is there on uni swap V3 and that's it you know I think that this could significantly change how people think about lending architecture um because there is now this kind of universal recognition that we should not have allowed ourselves to get into this place and how do we prevent it in the future so really Andrew really the question that you're bringing up or I guess who said this is Michael at Euler I guess really Michael Bentley bringing up is like should lending protocols be governed by Dow governance or should you let or or is there a different model that makes more sense like should

lending protocol parameters be set by the market or by Dow members and something like Ave you know it sounds like they're voting against Gauntlet I haven't followed that too closely but like in Euler the way I think it works is like you know the lending protocol parameters are just set by the market and like by market depth basically yeah and I think um like I think Dows are good I'm a pro Dow guy like those are uh we're probably at the the absolute trough of the bear market in terms of like Dao sentiment right uh I think they're really good for a lot of things um but maybe they shouldn't be good for determining risk parameters of lending protocols hmm yeah just a few extra points there I

think two two things that I would like to see the first is that since you need liquidity to liquidate a certain collateral if it goes bad why don't Dows or sorry why don't lending protocols start as helping accepting LP tokens as collateral tokens because then you kind of guaranteed that there is liquidity or at least there should be something I did like incentivize security for a collateral that you want to accept on your lending protocol um and I think another thing that I've been sort of mulling over is the role of these risk managements right these Risk Managers do have a significance a significant amount of I'm not sure if

Powers the right word since there is still like Dow governance that can vote on their proposals but they get to set a lot of parameters you know like they get to change like interest rate functions LTV like What markets are accepted and I I don't have a good take on this on whether it's a good or bad thing that if in the future a lot of these protocols whether it's like a lending borrowing protocol or perhaps like a derivative protocol it needs to bring a team of professional Risk Managers to manage all of it because I mean it definitely should not be left you with doubts um I don't think Dow participants have a good idea of how to price it so um yeah it's just interesting to see

would have Future Good potentially go especially because the dial members rejected all of Donald's proposals to sort of reduce the risk I just think that's like a bit of like a fundamental Clash there so to say it's really interesting yeah I guess if you think about the way it works in like Trad fi it's not you're not just like there's not one one London borrow model that works for everyone right the bank is going to price the risk on a very individual basis which I guess if you applied that to D5 that could work better but you're also really fragmenting liquidity so that's an interesting yeah interesting conversation to have so Andrew Ryan good chat guys any anything else that we're missing here

I would just say one last thing still staying on the lending protocol I think there's been sort of a Revival on the talks of how to practice we've been lending protocols and people have come along with the idea of just letting lenders themselves decide the risks that they're willing to price rather than letting like a protocol decided for you and so what that kind of looks like is a central limit order book for Lending you know you say I'm willing to take this as collateral against whatever I'm willing to lend out this is the max LTV that I'm willing to charge I'm gonna decide my own like interest rate markets and I think the parallel here is that liquidity providers for

lending and volume protocols may also have to get more sophisticated like this is a trend that we've seen indexes just inactive unsophisticated LPS are completely getting wrecked like every Cur every unisoft who is dominated by like 10 lbs who make up more than 80 of the liquidity and especially with unisol V4 unisoft X Chancellor that becomes even more complicated and so we're moving we're really moving to a Reliance or a dependence or sort of like a centralizing force on these sophisticated liquidity providers and I sort of see the same thing happening for Lending and borrowing protocols um I think that's a whole other debate whether like having like large

sophisticated Equity providers and being dependent on them is a good or bad thing it's similar to like is a centralized Builder a good or bad thing for ethereum um but yeah I think that's just the point that I wanted to make yeah I just uh throw it there that um there's already a really good lead for the um PE East pool hacker um and like I I have a lot of friends who work in these War rooms and I know that they're some of the best analysts on the planet so it wouldn't surprise me if um even more of the money uh uh you know we start finding suspects and a lot of it starts coming back and so thinking about this hack and how it's going to be remembered is going to be really

interesting because ultimately this wasn't even was this a top 10 hack was this a top 20 when all said and done like the amount stolen isn't going to be that much uh when everything's been accounted for but um I think the impact it'll have and the way it's going to fundamentally change a lot of um lending Market architecture um it's it's going to be important for reasons other than the dollar amounts and that's pretty cool I like that take let's end there guys this is a great conversation I hope you guys enjoyed this hope you guys got some value and uh understand why this curve hack is so important so Ren Andrew uh thanks for the time guys thank you

[Music]