sherlock-audit / 2024-06-makerdao-endgame-judging

1 stars 1 forks source link

mrhudson890 - Liquidation auctions for MKR are unnecessary, leak value, and increases bad debt accumulation #115

Closed sherlock-admin2 closed 1 month ago

sherlock-admin2 commented 1 month ago

mrhudson890

Medium

Liquidation auctions for MKR are unnecessary, leak value, and increases bad debt accumulation

Summary

The current MKR liquidation design in the LockstakeEngine (LSE) and LockstakeClipper results in significant value leakage and bad debt accumulation.

The process follows the established pattern for external collateral assets. However, MKR is an internally owned (burnable and mintable) collateral. Thus, the cycle of first market selling MKR during liquidations to arbitrageurs and paying for liquidations incentives, and later possibly buying it back through the flapper mechanism if a surplus is generated, is unnecessary and leaks a large amount of value (mostly during the liquidation auctions). Over time this leakage can be estimated to easily be above 0.5% or even 5% of protocol reserves.

Selling it in liquidation auctions to arbitrageurs, when the price is low, leaks value due to the necessity of arbitrage profits, gas prices, and keeper incentives. By replacing this process with immediate MKR burning during liquidations, and only selling through flopper auctions if and when necessary, in larger lots, and more controlled pace, the protocol could significantly reduce value leakage, and either reduce bad debt accumulation or increase profits.

Root Cause

The root cause of this issue lies in the design of the liquidation and surplus auction processes which is designed with immutable assets in mind and is unsuitable for an internally owned asset:

  1. MKR is sold in liquidation auctions when positions become unsafe, at unfavorable rates due to the market conditions that triggered the liquidations.
  2. Surplus DAI accumulates in the vow, which is then possibly used to buy MKR through the flapper (Splitter) mechanism, again from the open market.
  3. This cycle of selling low (and maybe buying later) leads to value leakage through multiple inefficiencies:
    • Liquidation auctions, via many separate lots, incur gas costs, external profits, and keeper incentives (chips and tips).
    • MKR is often sold when its price is low during market stress and high gas prices.
    • The take discount needs to generate arbitrage profits, cover high gas costs, reduced liquidity (slippage), and opportunity costs for the bots, so is considerably lower than market price.
    • Liquidations put additional, correlated, and uncontrollable selling pressure on the asset price, exacerbating the problem further, and compounding the problem of "selling-low". The additional pressure even risks liquidation cascades and additional bad debt.

In comparison, using flopper auctions has the following advantages:

Internal pre-conditions

n/a

External pre-conditions

Attack Path

  1. Market wide price decline reduces MKR price making a large amount of liquidations necessary.
  2. Liquidation auctions are triggered at the depressed, low price, and high gas prices.
  3. Protocol pays incentives in the form of chip and tip to the keepers.
  4. The collateral is than sold to takers, but the price is not only low due to market conditions, but also the final take discount needs to generate arbitrage profits, cover high gas costs, reduced liquidity (slippage), and opportunity costs for the bots, so is considerably lower than market price.
  5. The MKR auctions cause further price decline, triggering additional liquidations, and further protocol losses.

Impact

Because the chop (liquidation penalty) is commonly set to 113%, it's reasonable to conclude that liquidation process inefficiency is up to 13% loss. I'll assume a more conservative 5% leakage below. The exact number is likely to vary, but regardless of the exact figure, the inefficiencies accumulate over time.

The impact of this inefficiency is substantial:

  1. Value Leakage: Assuming the conservative 5% value leakage on MKR sold in liquidation auctions, when cumulative liquidation volume reaches 10M USD, approximately 500K USD will be lost to inefficiencies. This is equivalent to a [0.5% loss vs. the assumed 100M protocol reserves figure](https://github.com/makerdao/sherlock-contest/blob/master/README.md#severity-definitions.
  2. Long-term Losses: Over a prolonged period (years), when cumulative liquidations reach 100M USD, the total value leaked could be as high as 5M USD, or 5% of assumed protocol reserves.
  3. Increased Bad Debt: The inefficient process may lead to increased bad debt accumulation, as the protocol consistently sells MKR at unfavorable prices, and risk bad debt generation due to exacerbating liquidation cascades.
  4. Reduced Protocol Sustainability: Continuous value leakage reduces the protocol's ability to maintain a healthy balance sheet and manage risk effectively.

PoC

n/a

Mitigation

Simplify the current liquidation auction process by replacing it with MKR burning:

telome commented 1 month ago

This submission does not indicate a smart contract problem, but rather some suggestions for other design choices. Therefore out of scope.