Liquidation systems overview (design, code, comparing) [part 1]

Stable Unit DAO
StableUnit
Published in
9 min readApr 14, 2022

Introduction

The goal of this research is to summarize the best practices for liquidations in order to discover optimal mechanics for StableUnit to reach the highest capital efficiency without compromising on security.

The long tail is a business strategy that allows companies to realize significant profits by selling low volumes of hard-to-find items to many customers, instead of only selling large volumes of a reduced number of popular items.

Long-tail assets are plentiful in the cryptocurrency industry. These crypto assets are usually months, if not years in circulation, yet suffer from a low to non-existent trading volume.

Initial Research and Findings

The process behind the proposed solution design initially began with looking at different options to determine which may be optimal for the Stable Unit protocol. More specifically, we considered the following solutions:

  • English Auctions
  • Dutch Auctions
  • Fixed Spread Instant Settlement

After research and design consideration, we believe the modified fixed spread instant settlement liquidation system, based on its merits, is likely the most suitable solution for a design of the liquidations system. The fixed spread liquidation system has been validated in the market and has proven to work for lending markets with volumes over $55 billion TVL.

In terms of this proposed solution design, the sections below will present the math behind liquidation process, outline existing liquidation mechanisms and details regarding proposed solution.

Calculating Health Factor [4]

Loan to Value

The Loan to Value (LTV) ratio defines the maximum amount of currency that can be borrowed with a specific collateral. It’s expressed in percentage: at LTV=75%, for every 1 ETH worth of collateral, borrowers will be able to borrow 0.75 ETH worth of the corresponding currency. Once a borrow is taken, the LTV evolves with market conditions.

For each wallet the maximum LTV is calculate as the weighted average of the LTVs of the collateral assets and their value:

Liquidation Threshold

The liquidation threshold is the percentage at which a position is defined as undercollateralised. For example, a Liquidation threshold of 80% means that if the value rises above 80% of the collateral, the position is undercollateralised and could be liquidated.

The delta between the Loan-To-Value and the Liquidation Threshold is a safety cushion for borrowers.

For each wallet the Liquidation Threshold is calculate as the weighted average of the Liquidation Thresholds of the collateral assets and their value:

Health Factor

For each position, these risks parameters enable the calculation of the health factor:

When health factor < 1 the position may be liquidated to maintain solvency as described in the diagram below.

Aave — Risk Parameters

Comparison of Liquidation Systems

Existing lending platforms mainly adopt two distinct liquidation mechanisms. One mechanism is based on an auction process, including non-atomic English auction process and Dutch auctions with instant settlements, and the other follows an atomic fixed spread strategy.

1. Auction Liquidation

An auction based liquidation mechanism follows the subsequent methodology, as described in [1]:

  1. A loan becomes eligible for liquidation (i.e., the health factor drops below 1).
  2. A liquidator starts the auction process (which can last several hours).
  3. Interested liquidators provide their bids (e.g., the highest bid receives the loan collateral).
  4. The auction ends according to the rules set forth in the auction contract.

MakerDAO “tend-dent auction”. MakerDAO 1.2 employs a two-phase auction process, a “tend-dent” auction. When a position with 𝐷 value of debt and 𝐶 value of collateral is eligible for liquidation, i.e., HF < 1, a liquidator is able to initiate the tend-dent auction. A liquidator is required to bid at a higher price than the last bid in the auction. The two-phase workflow is described as follows. Tend: In the tend phase, liquidators compete by bidding to repay parts of the debt in exchange for the entire collateral. The amount of debt committed to repay in each bid should be less than 𝐷 and each bid should be bigger than previous one. If the auction terminates in the tend phase, the winning bidder receives all the collateral (i.e., 𝐶). When bid reaches 𝐷, the auction moves into the dent phase. Dent: In the dent phase, liquidators compete by bidding to accept decreasing amounts of collateral in exchange for the full debt (i.e., 𝐷) they will end up repaying. The amount of collateral committed in each bid should be less than 𝐶 and each bid should be less than previous one. The winning bidder repays the full debt and receives the partial collateral. The remaining collateral is returned to the position owner (i.e., the borrower). The auction terminates when any of the following two conditions is satisfied. Note that the auction can terminate in the tend phase.

  1. Auction Length Condition: the configurable auction length (e.g., 6 hours) has passed since the initiation of the auction.
  2. Bid Duration Condition: the configurable bid duration (e.g., 5 hours) has passed since the last bid. After the termination of an auction, the winning liquidator is allowed to finalize the liquidation to claim the proposed collateral.

After the termination of an auction, the winning liquidator is allowed to finalize the liquidation to claim the proposed collateral.

MakerDAO Dutch auctions. Unlike the old Liquidation 1.2 system which utilized English auctions, in which repay bids are placed, with a participant’s capital remaining locked until they are outbid or until the auction terminates, Liquidation 2.0 uses Dutch auctions which settle instantly. They do so according to a price calculated from the initial price and the time elapsed since the auction began. The lack of a lock-up period mitigates much of the price volatility risk for auction participants and allows for faster capital recycling.

Price-versus-time curves are specified through an interface that treats price at the current time as a function of the initial price of an auction and the time at which that price was set. How to determine the most effective price curve for a given collateral is still an active area of research; some initial options (linear, step-wise exponential, and continuous exponential) have been implemented for research purposes and initial deployment. Other candidates besides these include a piecewise linear curve and a piecewise exponential curve. [2]

2. Fixed Spread Liquidation [1]

Instead of allowing multiple liquidators to bid over a time-frame, a liquidatable loan can be instantly liquidated with a pre-determined discount. Aave, for instance, allows liquidators to purchase the loan collateral at up to a 15% discount of the current market price. This discount, or liquidation spread, is known upfront, and the liquidators can hence locally decide whether to engage in a liquidation opportunity. Following a fixed spread model avoids hour-long liquidation auctions, which cost time and transaction fees. Liquidators, moreover, can choose to liquidate collateral with the use of atomic flash loans. While flash loans increase the transaction costs of the liquidators, they reduce the currency exposure risk of holding the assets required for liquidation.

Fixed Spread Liquidation Example. In the following, provided an example of a fixed spread liquidation:

  1. Currency values: Assume an initial price of 3,500 USD/ETH.
  2. Collateral Deposit: A user deposits 3 ETH, and hence has $10,500$ USD worth of collateral. If we assume a liquidation threshold (LT) of 0.8, the resulting borrowing capacity of the user is BC = 10,500 USD × LT = 8,400 USD.
  3. Borrowing: In the next step the user borrows, for instance, 8,400 USDC worth 8,400 USD.
  4. ETH price decline: Now assume that the ETH value declines to 3,300 USD/ETH, which means that the collateral value declines to 9,900 USD with BC = 7,920 USD. The price oracle updates the ETH price on the lending smart contract. The health factor of the loan now drops to HF = 7,920 USD / 8,400 USD ~ 0.94 < 1 and thus the collateral is available for liquidation.
  5. Liquidation: A liquidator submits a liquidation transaction to repay 50% (close factor) of the debt, i.e., 4,200 USDC. In return, the liquidator is allowed to purchase collateral at the price of (3,330 USD / ETH) / (1 + LS) = 3,000 USD / ETH (assumed that the liquidation spread LS is 10%). In this liquidation, the liquidator receives 4,200 USD / (3,000 USD / ETH) x 3,300 USD / ETH = 4,620 USD worth of ETH and realizes the profit of 420 USD.

Comparison of Existing Protocols

CDPs

Lending protocols

Long-tail Assets Consideration

Among researched protocols a dominating motivation for allowing an asset to be accepted as a collateral is based on the expectation of high liquidity, which ensures that discount on the collateral can be immediately turned to profit by selling the received asset.

With long-tail assets we expect that immediate liquidity available on the market will not be sufficient to drive the liquidation process for majority of such assets.

Nevertheless we can assume that some of such assets present more value than others. This value can be addressed in the protocol design in several ways:

  • Floating liquidation spread: premium of the asset can change according to market condition for the asset.
  • Floating close factor: proportion of debt that is allowed to be repaid in single liquidation can change according to market conditions for the asset.
  • Ranking assets according to immediate liquidity: protocol can have a internal dynamic characteristic of assets used as collateral to provide liquidator with simple way to estimate expected profit of liquidation.
  • Swap routing and price estimate: offering an exact route for immediate swapping of the collateral asset to a liquidable asset.
  • Asset bundling: while liquidating one asset may be not profitable by itself, liquidating them as a bundle can offer extra opportunities to generate profit
  • Non-profit scenario: some assets can present value in way other than one that can be immediately extracted, such as in scenarios with voting-tokens, NFTs. Obtaining such assets through the liquidation mechanism can be a preferable or perhaps even the only possible way to get them into possession.

Proposed Solution Design

We believe, given the design considerations above, that Fixed Spread Instant Settlement liquidation mechanism is likely the optimal design solution. In such mechanism, liquidation settlement happens due to a number of parameters that define collateral asset as profitable for liquidator. Addressing the requirement for being both robust for the purpose of existing liquidations infrastructure and be suitable for effective liquidations of long-tail assets we propose following design solutions:

  • Variable Liquidation Spread — Liquidation spread may change according to market conditions for chosen asset.
  • Variable Close Factor — Amount of collateral asset available for liquidation is subject to changing market conditions.
  • Asset ranks — All the assets in the system are assigned a rank which may work as a quick way to estimate profitability of liquidation.
  • Swap routing and price estimate — Offering a swap route for an asset and providing a realtime data on the available liquidity along with each asset.
  • Asset bundling — Bundling of assets suggests different risk estimates, thus allowing for an advanced models of generating profit.
  • Non-immediate non-monetary profit extraction — Providing an interface to expose the value of assets in non-monetary terms.

References

[1] K.Qin, L. Zhou, P. Gamito, P. Jovanovic, A. Gervais. 2021. An Empirical Study of DeFi Liquidations: Incentives, Risks, and Instabilities

[2] Maker Foundation. 2022. Liquidation 2.0 Module

[3] A. Kirillov, S. Chung. StableSims. 2022. Optimizing MakerDAO Liquidations 2.0 Incentives via Agent-Based Modeling

[4] Aave Protocol. 2022. Risk Parameters.

[5] Maker Foundation. 2022. Multi Collateral Dai.

[6] Abracadabra. 2022. Magic Internet Money.

[7] Liquity. 2022. Decentralized Borrowing Protocol.

[8] Mai Finance. 2022. QiDao.

[9] DefiLlama. 2022. Lending TVL Rankings.

[10] DefiLlama. 2022. CDP TVL Rankings.

--

--