Decentralized Finance (DeFi), which primarily consists of blockchain-based lending and borrowing, had been one of the most rapidly growing crypto space sectors until the cryptocurrency price crash this past week. Lots of damage was caused across the DeFi sector due to the price of Ethereum (ETH) falling faster than anyone expected, from roughly $200 to less than $100 in less than 24 hours. This article will describe what went wrong, and what the DeFi sector needs to learn from this event going forward.

Before explaining what happened this past week, here is an explanation about how DeFi borrowing typically works, based on the MakerDAO protocol, which is the biggest player in the DeFi space. If someone wants to take out a loan, they have to put up Ethereum (ETH) as collateral, and in return they will receive the Dai stablecoin which is pegged to the USD.

For example, if someone wants to take out a loan of $600 Dai they can put up $1,000 of Ethereum (ETH) as collateral. MakerDAO has a requirement that the collateral must be at least 150% of the size of the loan, in order to prevent a situation where the value of the collateral falls below the value of the loan, which could put MakerDAO in debt.

In order to avoid the value of the collateral from falling below the size of the loan, some users even use a ratio of 400%, meaning if they put $1,000 of Ethereum (ETH) up as collateral, they only receive $250 of DAI.

This brings up the question, why would anyone choose to take out a crypto loan and only receive a fraction of the value of their Ethereum (ETH), rather than just selling their Ethereum (ETH) for 100% of its value? The idea is that users can access some of the value of their Ethereum (ETH), but simultaneously will have the right to buy back their Ethereum (ETH) in the future.

Basically, loans from MakerDAO allow crypto HODLERS to keep HODLING while being able to access some of the crypto’s value.

Loans from MakerDAO make alot of sense if the crypto market is rising long term, but the events of this past week illustrate that DeFi loans are a bad bet if the crypto market falls significantly. Basically, if the crypto market goes down significantly, it would have been better for someone to outright sell their Ethereum (ETH) rather than to access a fraction of its value with a MakerDAO loan.

That being said, true HODLERS can handle a price decrease, and will still expect their crypto holdings to rise in the long run. However, this past week collateral was forcibly ripped away from an untold number of DeFi users, especially on MakerDAO.

Essentially, if the value of someone’s collateral is falling, then a MakerDAO user should take steps ahead of time to increase the size of their collateral position, since as soon as the collateral’s value falls below 150% of the loan value, then the collateral will be automatically liquidated by the system.

However, the Ethereum (ETH) market fell so fast this past week that there was practically no time to increase the size of collateral positions. This was exacerbated by the fact that the Ethereum (ETH) network had severe scalability issues during the price crash, with transactions taking as long as 44 minutes.

In other words, MakerDAO users were blindsided by the speed of the crypto price crash, and there was little to no opportunity to add more collateral to prevent a forced liquidation due to the Ethereum (ETH) network grinding to a crawl.

It is unknown how many people suffered due to forced liquidations on MakerDAO, but the price crash combined with collateral liquidations wiped out roughly $200 million of assets on MakerDAO, and $450 million of assets in the DeFi sector in total in just a few days, which was 50% of all of the assets in the DeFi industry.

It gets worse. Not only did borrowers get rekt by system inefficiencies, MakerDAO itself had a serious flaw when liquidating collateral. Essentially, when Ethereum (ETH) collateral is liquidated it is put up for an automatic auction in order to replenish the platform with Dai in order to cover its loans.

However, the Ethereum (ETH) network freezing up in combination with rapidly rising gas fees caused the liquidator bots on MakerDAO to fail. Essentially, bots typically bid on collateral liquidations, but the bots were not programmed to handle an event like this and were not able to place any bids.

Someone who was quite savvy stepped in and placed $0 bids for the collateral, and since no one else could bid they won, and they walked away with $4 million of collateral for free, putting MakerDAO in $4 million of debt. Even after it was first reported that someone got $4 million of collateral for free, it apparently kept happening and overall MakerDAO sold $5.7 million of collateral for $0 due to the failure of its auction mechanism.

There was even talk that all of MakerDAO would shutdown due to the millions of dollars of debt, and the decision was put up to a vote. The vote did not pass, and instead MakerDAO will resort to printing Maker (MKR) and auctioning it off in 50,000 DAI increments in order to cover the debt and bring the system back to balance.

As of this writing MakerDAO remains $5.7 million in debt, and in the coming days as the debt is covered by Maker (MKR) printing, the price of Maker (MKR) will likely drop significantly, while the price of DAI returns to peg. At this time the price of Dai is at $1.05 rather than being pegged to $1 due to the system imbalance, and apparently at one point Dai was as high as $1.22. Although this sounds like a potential windfall for anyone holding Dai, it is not good for a stablecoin to become so unpegged.

Overall, the events of this past week have revealed that the DeFi industry is not ready for prime time, and some serious fixes have to be made. MakerDAO needs to ensure that borrowers at least have a chance to shore up their collateral positions in the event of a rapid crypto price crash, especially if the underlying Ethereum (ETH) network slows to a crawl, rather than proceeding with forced liquidations instantly. Further, MakerDAO needs to make sure that no one can ever bid little to nothing during a collateral liquidation auction and actually win.

Indeed, a simple line or two of code could have made it so that no one can win a collateral auction unless they pay 90% or more of the value of the Ethereum (ETH) being auctioned, and it is particularly nonsensical that there was no code to prevent bids of zero.

Further, DeFi users should also take an important lesson from these events. DeFi loans are a good idea if the crypto market is rising long term, but DeFi users should consider that in the event of a violent crypto price crash they could lose their collateral. Therefore, DeFi users should carefully think about whether simply selling off their crypto is a better idea than taking out a loan where they only get 60% or less of the crypto’s value, since the events of this past week reveals that situations can happen where collateral is forcibly ripped away.