paint-brush
Fixing Toxic Liquidation Spirals in Defiby@oraclesummit
629 reads
629 reads

Fixing Toxic Liquidation Spirals in Defi

by Blockchain Oracle SummitFebruary 20th, 2023
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

AAVE v2, a lending platform on Ethereum, incurred bad debt resulting from a major liquidation event involving a single user who had borrowed close to $40M worth of CRV tokens. AAVE withstood the exploit, and the hacker was left with nearly $10m in losses. But, the protocol was left. with almost $2m in bad debt –  debt that cannot be recovered.

People Mentioned

Mention Thumbnail
featured image - Fixing Toxic Liquidation Spirals in Defi
Blockchain Oracle Summit HackerNoon profile picture


On November 22nd 2022, AAVE v2, a lending platform on Ethereum, incurred bad debt resulting from a major liquidation event involving a single user who had borrowed close to $40M worth of CRV tokens. In light of this occurrence, Daniele Pinna, Jakub Warmuz, and Amit Chaudhary released a research paper debunking the speculations surrounding the event. They introduced the concept of toxic liquidations, their prominence across many DeFi protocols, and how they can be mitigated.

What Really Happened During The Aave Exploit?

The AAVE exploit was caused by Avraham Eisenberg, who is known for exploiting Solana-based Mango Markets for more than $100 million. Last November, Eisenberg attempted to exploit AAVE in a similar fashion. Using tranches made up of tens of millions of USDC as collateral, Eisenberg borrowed millions of Curve’s native token, CRV, on AAVE before sending it to OKX – probably to sell.


Using USDC as collateral to borrow tokens and then sell them is a common method used by sophisticated players to make short positions in DeFi. While the attempted exploit caused volatility on CRV, the attack did not work. AAVE withstood the exploit, and the hacker was left with nearly $10m in losses. But, the protocol was left with almost $2m in bad debt –  debt that cannot be recovered. While Eisenberg’s true intentions are yet unknown, he successfully brought a lot of attention to bad debt and toxic liquidation spirals in DeFi.

Toxic Liquidation Spirals

Liquidation refers to a loss management process by which a smart contract sells a user’s crypto assets to cover the debt. In most cases, the protocol will allow someone else to repay the debt, at a discount, in exchange for the collateralized asset. These individuals are known as liquidators and are given a bonus, which is higher for volatile currencies, as an incentive. Loan-to-Value (LTV) ratio refers to the ratio of the loan’s value to the value of the collateral. It is used by lenders to measure the risk involved when approving a loan. Once a user’s LTV ratio exceeds a threshold set by the protocol, liquidators are called in to intervene. This model is often effective and helps to create a balanced portfolio for the borrower while protecting the lender from bad debt.


The AAVE exploits were mostly blamed on speculative price action or irresponsible portfolio positioning. However, Daniele Pinna,  head of research and investment at 0VIX, is debunking that and shedding light onto a fundamental flaw in many DeFi protocols. 0VIX is a DeFi liquidity market protocol built on Polygon, which offers next-level features like pre-mined rewards, toxicity numbers, and 24-hour liquidation probability. Learn more about 0VIX and its unique risk management features here.


In the research paper published by the team, they introduced the concept of a “toxic liquidations spiral”, where, under the right circumstances, an over-collateralized loan can become under-collateralized entirely due to the protocol’s mechanics, and guaranteeing the creation of bad debt in the process. Liquidations are considered toxic when the liquidation incentives worsen the liquidated user’s LTV and the final LTV is greater than the initial. As the LTV increases, the collateral becomes less likely to cover the cost of the loan. A toxic liquidation spiral depends mainly on the incentive given to liquidators for executing liquidations in relation to the loan-to-value of the user being liquidated. For fixed liquidation incentives such as is common on many lending markets, a threshold exists beyond which the user’s loan-to-value will be guaranteed to increase at each successive liquidation. This is represented mathematically as:





Using AAVE’s exploit as a case study, it becomes clear how AAVE’s 4.5% incentive on each liquidation drove Avi’s LTV higher after it surpassed the 95.6% mark. While this is undoubtedly a high loan-to-value for a user to hold on a lending market, it still represented an over-collateralized portfolio position.




Once the LTV became greater than 0.9569, even if asset prices were to remain static, the user’s portfolio was guaranteed to become under-collateralized entirely as a result of the liquidation incentives enforced by the protocol, thus incurring bad debt.


This is the toxic liquidation spiral that resulted in AAVE’s $1.75 million debt and is a flaw prevalent in many DeFi platforms. The team suggested two options DeFi lending platforms have to avoid bad debt incurred from toxic liquidation spirals.

Fixing The Toxic Liquidation Spiral

There are two ways AAVE and other DeFi lending protocols can prevent bad debt accrual.


The first method is quite simple. Once the LTV exceeds LTVuc (under-collateralized), the protocol should halt the trade. 0VIX’s research team simulated the results that would have occurred if this method had been adopted and found that the portfolio would have momentarily become under-collateralized (around 750k) before immediately returning to a healthy state on its own once the CRV/USDC ultimately corrected downwards. Of course, there are many statistical possibilities depending on the price action of the token and other variables. Using the market risk assessment methodology, most simulations resulted in zero bad debt accrual for AAVE just by halting liquidations.


The second method suggests a change in the liquidation logic by introducing dynamic rather than typically fixed parameters for liquidation incentives. It is important to remember that toxic liquidations occur when incentives worsen rather than improve the user’s LTV ratio. The protocol can avoid toxic liquidation spirals if these incentives are constantly adjusted to fit the formula below.





In addition, the closing factor, which limits the number of collateralized tokens that can be liquidated at once, can also be made variable. The aim is to progressively liquidate larger portions of a user’s portfolio as it comes closer to becoming under-collateralized.



By comparing the results of toxic liquidation spirals and mitigation policies, we find that there is a trade-off. There are higher chances of generating bad debt (∼ 85%) but more certainty on the size of that debt (tail mean = $820k) when toxic liquidation spirals occur. In contrast, the mitigation policies discussed offer considerably lower chances of generating bad debt (∼ 19%) while exhibiting more risk on the worst-case outcomes (tail mean= $1.4M), assuming no other open market interventions occur.


The research by 0VIX has identified a significant problem and possible solutions to a shared flaw in DeFi lending platforms. Rather than dismissing AAVE’s exploit as a result of irresponsibility, volatility or speculative price action, protocols can now seek mitigation techniques and prevent bad debt.


More information about individual DeFi protocol’s bad debt figures can be found in RiskDAO’s bad debt dashboard.