[RFC] Partial Liquidations

First I want to thank the @woof team for their work scoping out partial liquidations and presenting this RFC. They have been patient, receptive to feedback and easy to work with and I believe this initiative they’ve put forth could be a nice step forward towards increasing Compound’s collateral factors. I also want to thank @torrey for providing helpful suggestions, context and clarifications and @jbass-oz and the OpenZeppelin team for their comments as well.

The remainder of this response will be structured as follows

  1. Liquidation review and tradeoffs of partial liquidations
  2. Feedback for the proposed design
  3. Analysis of potential designs and their parameterizations

Before diving into this wanted to bring up a quick note on terminology

DeFi Lending Terminology

The RFC’s terminology clashes with established DeFi conventions. Consistent terminology prevents ambiguity and ensures everyone shares the same understanding

Two prominent examples

The liquidation factor (LF) should refer to the collateral asset risk parameter that determines percentage of collateral value that can be borrowed (including interest) before an account becomes liquidatable. This is the term used on Compound’s website

and also used in prior analysis on liquidations by Gauntlet here and in all of their risk parameter recommendations.

I understand that it’s confusing since this is referred to as the liquidateCollateralFactor in the Comet code here but this becomes even more messy since there is another term called liquidationFactor a line below which actually corresponds to 1 - liquidation penalty (LP). With the definition proposed here, the term liquidation factor is now overloaded in 3 different ways with

  1. Being the LF as is shown on the front end
  2. Being 1 - LP as defined within asset info in Comet
  3. Being the account level collateralization threshold for liquidation as defined in this RFC

Let’s use the front end as the source of truth since it probably has the most eyes and agreed upon definition. I would redefine (3) to a term like “account liquidation ratio” where if it exceeds 1 the account is eligible for liquidation.

The health factor has been defined for as long as I can remember as the ratio of the collateral value and the debt value, factored by the LF, not the CF.

A definition is given by Aave here and this is the same convention that Euler used for the original target health factor partial liquidation implementation here. The intuition here is that higher health factor means more account health so if an account’s health factor drops below 1 then it is eligible for liquidation. I would redefine the reciprocal here to a term like “borrow utilization ratio” so if it exceeds 1 then the account can be liquidated.

For the remainder of this post will use the following terms with their definitions linked

HF = health factor
CF = collateral factor
LF = liquidation factor
LP = liquidation penalty
SFPF = store front price factor
c = close factor
IB = insolvency buffer

Liquidation Review

When considering this new functionality for the protocol, would be good to review some context and tradeoffs.

Why liquidations matter

The primary function of liquidations is to protect the protocol against insolvencies. In particular, the insolvency buffer as defined by Gauntlet here is increasing with liquidation penalty. On their own, liquidations aren’t necessarily harmful to the protocol since they serve as a core mechanism for decentralized risk management. Another way to view them is as a systemic risk cost. Initially this cost is placed on the borrower but shifts to the protocol if the loan goes insolvent. In that sense, protocols having liquidations is similar to a liquidity provider hedging against risk.

An important point about the liquidation penalty is that it constrains the maximum collateral factor for an asset. If the protocol can reduce the cost of liquidations while maintaining the same level of risk reduction, it can safely raise collateral factors. This would improve Compound’s competitiveness and likely attract more users and capital. For a more detailed explanation, I previously posted about this topic here.

A reasonable critique of liquidations is that they can be inefficient. In many cases, the cost is too high relative to the actual risk, which results in worse UX for borrowers in both higher penalties and lower capital efficiency due to lower collateral factors. Partial liquidations are one potential improvement.

Tradeoffs of partial liquidations

Partial liquidations limit how much of an account can be liquidated in a single transaction.

There are several common implementations within DeFi such as

  1. Applying a fixed percentage known as a close factor, used by protocols like Aave and Compound V2
  2. Targeting a specific health factor after liquidation such as in Euler V1
  3. Using a dynamic AMM for liquidation, such as LLAMMA in Curve’s crvUSD system, explained here

Whether partial liquidations are preferable to full liquidations can be dependent on price trajectory and market context. In the case of a scam wick partial liquidations clearly better in protecting borrower collateral. If full liquidations are like hedging all at once then partial liquidations are like hedging through TWAPing. The tradeoff becomes a question of how aggressively the protocol should de-risk. If the price drop is driven by fake news it’s better to avoid overpaying liquidators to fire sale assets. But if the bad news is real and collateral prices are falling block after block then the protocol needs hedge aggressively and in full to prevent worse outcomes from happening.

Partial liquidations tend to be better on average since most of the time the situation isn’t urgent enough to justify the cost of the full liquidation penalty, but full liquidations are safer in worst-case scenarios. The key is in how much risk is introduced by the delay from liquidating partially over multiple blocks instead of doing it all at once.

Feedback for proposed design

Before diving into the analysis, I wanted to give some inline feedback on the proposal.

Intro Feedback

There’s some nuance here. Insolvencies are bad for the protocol. Most liquidations are not insolvencies. Liquidations that are not insolvencies generate revenue for the protocol through the portion of the LP not paid to liquidators via the SFPF. Frequent liquidations can be bad UX for borrowers and may lead to lower user retention or reduced TVL. Still, it’s not obvious that liquidations are inherently bad for the protocol, though they are clearly negative for borrowers and slightly negative for lenders due to reduced interest income, as noted in the RFC.

In theory, all liquidations and insolvencies could be eliminated by setting collateral factors near zero and liquidation penalties near one. But that would also guarantee near-zero TVL. As a rule of thumb, very few liquidations may be a sign that the protocol is being too conservative in its product offering, while the absence of large insolvencies is usually a sign of strong risk management.

Motivation Feedback

Agree with @torrey’s clarification here. This should lead to some net reserve growth, upper bounded by LP \cdot (1-SFPF) of the collateral value in expectation. Some of that will be offset by costs like liquidation delays and oracle deviations, but in general liquidations are locally profitable for the protocol. Similar dynamics can be seen on perpetuals exchanges as well.

Agree with @torrey’s clarifications. Some numerical examples of how this works can be found in some of Gauntlet’s previous analysis here.

The main motivation of partial liquidations should be to pay less than full liquidations for each unit of risk reduction. Lowering this cost unlocks higher collateral factors and makes the protocol more competitive from a capital efficiency perspective.

Liquidators with any capital base can already participate in liquidations. While the absorb currently is for the full account, the subsequent collateral does not need to be repurchased all at once. Flash swaps allow liquidations to done atomically with very little capital so portfolio size is rarely the bottleneck.

Basis Feedback

As stated in previous analysis, the existing mechanism makes Compound III uncompetitive. Disrupt it :slight_smile:

The goal should be to deliver impact. Sometimes this may require breaking changes.

The reason to do this is to execute risk reduction more cheaply for borrowers and the protocol. This should lead to liquidators getting paid less. That is the desired outcome. Giving liquidators a choice in this matter takes away a lot of the impact of this change.

Unclear if this is true. Reducing the audit surface seems good. New code may not be better than small modifications to existing code.


I follow the spirit of the constraints as listed but the main goal to do this should be improving the protocol. How much improvement the changes provide should be quantified relative to their respective costs so the community can make a decision. In that sense, none of these seem like they should be hard constraints to me.

Solutions Feedback

I’m not sure I follow the need to introduce this new parameter. The bound seems to be that the target HF > 1 otherwise the loan is immediately liquidatable again. How much above 1 becomes a parameter that needs to be set, regardless of whether transforming the computation to using LFs or CFs.

Paying more for partial liquidations than full liquidations defeats the purpose of this feature. Returning to the TWAP analogy breaking a larger trade into smaller ones which incur less slippage should lead to cheaper execution overall. TWAPs help users reduce execution costs when there’s less trade urgency which means market makers earn less. Similarly partial liquidations should allow the protocol to manage risk more gradually and cheaply so liquidators should be less profitable.

Introducing a new risk parameter is a significant change, and it’s not yet clear whether it is necessary or would provide meaningful benefits.

Miscellaneous Feedback

This is a great simplifying suggestion. This can provide a lot of the benefits while minimizing the audit surface. Will provide some analysis as to what this percentage should be below.

Nitpicking here but both the LP and LF matter in determining the liquidator’s overall profit (along with other factors such as volatility, liquidity etc) so it’s not always the case that the highest CF assets will be liquidated first.

To elaborate on @torrey’s point about dust accounts, with any close factor c < 1 an account can never really be fully liquidated in practice.

The collateral remaining in each step is 1-c of the previous step so the proportion of total collateral liquidated can be expressed as

c + (1-c)c + (1-c)^2c + (1-c)^3 c + \ldots = c (1 + (1-c) + (1-c)^2 + \ldots)
= c \cdot \displaystyle\frac{1}{1 - (1-c)} = 1

as the infinite geometric series converges. Eventually the liquidation proceeds won’t be enough to cover base costs e.g. gas so will just remain in the protocol.

Would imagine it’s not worth introducing a new protocol parameter just to handle this.

While making use of liquidator points is a novel idea, ideally the points would reflect how much a liquidation actually benefits the protocol. That is tricky to measure accurately since it depends on external factors such as market conditions. For example, atomic liquidations should receive almost no points because liquidators are already fiercely competing to capture easy arbitrage profits. This competition suggests the protocol is already overpaying, so no further incentive is needed, which is some of the motivation behind the OEV initiative. In contrast, non-atomic liquidations that involve completing the arbitrage loop on a CEX are more valuable the faster they occur since they provide a clearer service to the protocol difficult to obtain otherwise. The most beneficial are altruistic backstop liquidations where the liquidator takes on risk without immediate arbitrage or even accepts a loss. In this context, a retroactive points program may be more effective than trying to fit a metric based on the absorption counts and base fees tracked in the protocol logic here.

Summary

Directionally, this is a good change. Some key points to keep in mind

  1. The main reason to implement this is to improve capital efficiency. Raising collateral factors is only possible if the protocol can reduce overall liquidation costs for the same level of risk management. Paying more for partial liquidations just to make them more attractive to liquidators than full liquidations defeats the purpose.
  2. As a result of this change liquidators should earn less. This outcome was highlighted by Euler here. It’s fair to assume liquidators are here to maximize PnL not protocol health. Giving them the option to fully liquidate when a partial liquidation that is better for the protocol is available also defeats the purpose. One way to support both paths is to allow full liquidations below a certain health factor. Aave uses 0.95 as that threshold here.
  3. Before the impact of the change is established, it’s prudent to err on the side of less complexity in the implementation to reduce the audit surface.
4 Likes