Introducing Pre-Liquidations: Enhanced Loan Management on Morpho

Today, we're introducing an open-source pre-liquidation factory that enables any application built on Morpho to offer borrowers opt-in loan management features, such as auto-deleverage and auto-close.

For any Morpho Market, anyone can configure custom liquidation parameters—when they trigger, what percentage of a position closes, and the associated penalties—that would occur prior to default liquidations.

Pre-liquidations expand the Morpho Stack, unlocking new possibilities for applications to improve the borrower experience by giving them more control over their positions.

The mechanics behind pre-liquidations

Before exploring pre-liquidation, let's review how default liquidations work on Morpho.

The liquidation mechanism is consistent across all Morpho Markets. When a position becomes unhealthy, liquidators can repay up to 100% of a borrower's debt (close factor of 1) and receive the collateral plus an incentive based on the Liquidation Incentive Factor (LIF). The liquidator receives the full LIF, with Morpho taking no fees. More details on liquidations and the LIF can be found here.

While this primitive approach favors lenders by providing strong liquidation guarantees, it was designed with the knowledge that custom liquidation systems could be built on top of Morpho Markets to better serve borrowers' needs. This is where the pre-liquidation contract comes into play. It is a general factory for deploying individual contracts that contain custom liquidation parameters for any given Morpho Market.

Borrowers can opt into the new set of parameters by authorizing the contract to “switch on” the custom liquidation settings. If a pre-liquidation fails to execute properly—for instance, if no liquidators are monitoring the new contract—the borrower will be liquidated using Morpho's default liquidation mechanism.

The set of pre-liquidation parameters is composed of:

  • a Morpho market (id);

  • a pre-liquidation loan-to-value (preLltv);

  • two pre-liquidation close factor parameters (preLCF1 and preLCF2);

  • two pre-liquidation incentive factor parameters (preLIF1 and preLIF2);

  • a pre-liquidation oracle (preLiquidationOracle)

Including a pre-liquidation oracle as a parameter allows the use of solutions such as Chainlink Smart Value Recapture (SVR) for oracle extractable value (OEV) recapture.

The dual parameter option, which includes the close factor and incentive factor, enables the creation of dynamic factors that change between pre-LLTV and the market’s default LLTV.

How applications can integrate pre-liquidations

Having explained the contract’s mechanics, let's explore how applications and front-ends can use custom pre-liquidation contracts to offer borrowers different position management tools.

Taking Coinbase's crypto-backed loans as an example, Coinbase could set up a custom pre-liquidation contract and allow users to approve it through the Coinbase App.

Here are two examples of features that can be enabled with pre-liquidation contracts:

Auto Deleverage

Instead of closing the entire position when it becomes unhealthy, auto deleverage closes only enough of the position to restore its health. This approach aims to keep positions open as much as possible while reducing liquidation fees paid by borrowers.

To enable auto deleveraging, the pre-liquidation contract would need to specify the liquidation close factors where preLCF1 < preLCF2 ≤ 1, and preLIF is fixed.

For example, if preLCF1 is set to 0.1 and preLCF2 to 1, then when a position first becomes unhealthy (position LTV > pre-LLTV), at most 10% can be closed. As the position's LTV approaches the default LLTV, the closeable portion would gradually increase toward 100%, effectively implementing gradual liquidations.

Auto Close

The goal of an auto close is to close the position entirely while reducing the liquidation fee paid by the borrower.

One way to achieve this is to configure a pre-liquidation contract with a fixed preLIF value significantly lower than the default LIF, as seen below. It’s also possible to mimic a Dutch auction for liquidation by implementing a dynamic LIF where preLIF1 is less than preLIF2.

By authorizing auto-close, borrowers accept earlier liquidation in exchange for a reduced liquidation penalty.

Security

The code for Pre-Liquidations has been audited by Spearbit and ABDK, with the full reports available here.

Key specifications have also been formally verified using Certora and are accessible here.

The contract is included in Morpho's $1.5M bug bounty program on both Immunefi and Cantina.

Subscribe to Morpho
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.