Delayed Liquidation
The Delayed Liquidation contract is an opt-in feature that allows borrowers to benefit from a grace period before being liquidated on Morpho v2 if they breach their maximum LTV. It gives borrowers more time to manage their positions before being liquidated.
Lenders must understand the risks implied by creating or accepting an offer that uses a grace period as it can lead to the liquidation being delayed for an extended period of time leading to higher probability of bad debt if the collateral value decreases in excess of the LLTV buffer over the grace period. Lenders can set lower Liquidation LTVs to protect against this risk. Note that grace periods must also be triggered onchain, forcing liquidators to expense a cost upfront start the liquidation process for a borrower. The liquidation will only be possible to trigger if the borrower is still eligible for liquidation after the grace period.
How It Works
1. Grace Period Initiation
When a borrower's position becomes unhealthy, anyone can call startGracePeriod to begin the grace period:
Validation checks:
- Borrower position must be unhealthy (debt exceeds maximum allowed based on collateral value and LLTV)
- No active grace period or liquidation period is already in progress for this position
Grace period start:
- Records the timestamp when the grace period begins
- Borrower has
GRACE_PERIODseconds to improve their position health
During the grace period, the borrower can:
- Add more collateral to increase their maximum debt capacity
- Repay debt to reduce their debt amount
- Take other actions to restore position health
2. Liquidation Period
After the grace period expires, the liquidation period begins:
Liquidation window:
- Starts after
GRACE_PERIODseconds have elapsed - Lasts for
LIQUIDATION_PERIODseconds - During this window, anyone can call
liquidateto liquidate the position
Liquidation execution:
- Validates that current time is within the liquidation period (or past maturity)
- If past maturity, liquidation is always allowed regardless of grace/liquidation periods
- Executes the liquidation on Morpho V2 by seizing collateral if the borrower is still eligible for liquidation
Post-maturity liquidations:
- After the obligation's maturity timestamp, liquidations are always permitted
- Grace and liquidation periods are bypassed for matured positions
- This ensures lenders can recover funds from matured, unpaid positions
3. Status Checking
The getStatus function provides real-time information about a position's liquidation timeline:
Returns:
inGracePeriod: True if currently in grace periodinLiquidationPeriod: True if currently in liquidation periodcanStartGracePeriod: True if grace period can be started (position unhealthy and no active periods)gracePeriodEnd: Timestamp when grace period ends (0 if not active)liquidationPeriodEnd: Timestamp when liquidation period ends (0 if not active)
This allows borrowers, liquidators, and UIs to track the status of positions and plan accordingly.
Key Parameters
Parameters are set at deployment from the factory and are immutable:
- GRACE_PERIOD: Duration in seconds that borrowers have to restore position health before liquidation becomes possible
- LIQUIDATION_PERIOD: Duration in seconds during which liquidation is allowed after the grace period expires
Considerations
For Borrowers:
- Protection against instant liquidations during temporary market volatility
- Time to add collateral or repay debt to restore position health
- Predictable liquidation timelines once the Liquidation LTV is breached
For Lenders:
- Ensures unhealthy positions can eventually be liquidated
- Can ask for lower Liquidation LTVs and higher rates to protect against the increased risks of delayed liquidations
- Post-maturity positions can always be liquidated