Skip to main content
Liquidation protects the lending pool when positions become undercollateralized. When a position’s health factor drops below 1.0, liquidators can repay debt and seize collateral at a discount. The system supports two modes: instant liquidation and Dutch auctions.
A liquidation happens fully automated through our relayer and will soon implement the IVC for maximum independency.

Liquidation Mechanics

When Liquidation Triggers

A position becomes liquidatable when: Health Factor=Collateral Value×Liquidation ThresholdTotal Debt<1.0\text{Health Factor} = \frac{\text{Collateral Value} \times \text{Liquidation Threshold}}{\text{Total Debt}} < 1.0 Example:
  • Collateral: 100 tokens × 200=200 = 20,000
  • Debt: $17,500
  • Liquidation Threshold: 85%
  • Health Factor: (20,000×0.85)/20,000 × 0.85) / 17,500 = 0.97 ✅ Liquidatable

Close Factor

The close factor limits how much debt can be repaid per liquidation (typically 25-50%). This:
  • Prevents single liquidators from seizing everything
  • Gives borrowers chance to respond between partial liquidations
  • Distributes liquidation opportunities
With 50% close factor, a 10,000debtpositionallowsmax10,000 debt position allows max 5,000 repayment per liquidation transaction.

Liquidation Modes

Instant Liquidation

Default mode for smaller markets. Liquidated collateral transfers immediately to the configured liquidation contract. Flow:
  1. Liquidator (backend relayer) calls liquidate(loanId, signedPrice)
  2. Market calculates collateral to seize (debt + penalty)
  3. Collateral transfers to Liquidation Router
  4. Router receives via receiveLiquidatedCollateral()
  5. Collateral routes to trading venue for sale
  6. USDC proceeds return via receiveLiquidationProceeds()

Dutch Auction

Recommended for larger markets. Price decreases over time, creating competitive bidding. Configuration:
SettingDescription
DurationAuction length (e.g., 1-24 hours)
Start PremiumInitial price above oracle (e.g., 130%)
Min PremiumFloor price (e.g., 95%)
Flow:
  1. Liquidator triggers auction creation
  2. Auction starts at premium price
  3. Price decreases linearly toward minimum
  4. Bidders purchase collateral at current price
  5. USDC goes directly to lending pool
  6. Auction ends when all collateral sold or duration expires
Price Formula: Current Price=Start Price(Start PriceEnd Price)×Elapsed TimeDuration\text{Current Price} = \text{Start Price} - \frac{(\text{Start Price} - \text{End Price}) \times \text{Elapsed Time}}{\text{Duration}} Advantages:
  • Better price discovery
  • Multiple participants can bid
  • No need for external liquidation contract
  • Transparent, on-chain process

Liquidation Panel

The Liquidations tab in market details shows:
SectionInformation
Liquidatable LoansPositions with health factor < 1.0
Pending LiquidationsInstant liquidations awaiting settlement
Active AuctionsDutch auctions in progress
Liquidation StatsHistorical metrics

Manually Triggering Liquidations

Click on the position you want to liquidate, click Liquidate on any eligible position. The system:
  1. Fetches current price from oracle
  2. Signs price update if needed
  3. Executes liquidation transaction
  4. Creates pending liquidation or auction
Health factor has to be below 1.

Bidding on Auctions

For Dutch auctions, click Bid and enter:
  • Collateral amount to purchase
  • System shows current price and USDC required
Bids execute immediately at current auction price.

Settling Expired Auctions

If auctions expire with unsold collateral:
  1. Click Settle Expired
  2. Remaining collateral routes to liquidation contract
  3. Proceeds as instant liquidation

Liquidation Hooks

Coming Soon: Liquidation hooks allow you to execute custom functions before and after a liquidation initialized.

Hook Example

The most common example is the combination of two hooks:
  1. Risk Check – beforeLiquidation(): Check the risk values of the liquidated asset based on your setup parameters. Outputs a boolean.
  2. Execute – afterLiquidation(): Buy an asset at a discounted price if the beforeLiquidation() returns true.
This allows institutions to automatically strengthen their asset portfolio at discounted prices and in harmony with their risk parameters.

External Liquidation Contract Integration

For institutions requiring custom liquidation handling (OTC desks, internal market makers, etc.), implement the liquidation receiver interface.

Interface Requirements

Your liquidation contract must implement:
interface ILiquidationReceiver {
    /**
     * @notice Called when liquidated collateral is received
     * @param stockToken Address of the collateral token
     * @param amount Amount of collateral received
     * @param debtRepaid Amount of USDC debt this covers
     * @param borrower Original position owner
     * @param liquidationId Unique identifier for this liquidation
     */
    function receiveLiquidatedCollateral(
        address stockToken,
        uint256 amount,
        uint256 debtRepaid,
        address borrower,
        uint256 liquidationId
    ) external;
}

Settlement Requirements

After selling collateral, return proceeds to the lending market:
// On the lending market contract
function receiveLiquidationProceeds(
    uint256 liquidationId,
    uint256 amount  // USDC amount
) external;
Your contract must:
  1. Approve USDC spending to the lending market
  2. Call receiveLiquidationProceeds() with liquidation ID and USDC amount
  3. Handle the proceeds within reasonable timeframe (default timeout: 7 days)

Integration Steps

1

Deploy Liquidation Contract

Deploy your contract implementing ILiquidationReceiver. Ensure it can:
  • Receive ERC-20 tokens
  • Track liquidation IDs
  • Return USDC to specified addresses
2

Configure Market

In market Settings, click Configure under Trading Venue and select Custom Address. Enter your contract address.
3

Authorize Token Transfers

Your liquidation contract needs authorization on the stock token to receive collateral. The Issuers App shows pending authorizations.
4

Test Settlement Flow

On testnet:
  1. Create a position
  2. Manipulate price to make it liquidatable
  3. Trigger liquidation
  4. Verify your contract receives collateral
  5. Complete settlement, verify pool receives USDC

Settlement Timeouts

Liquidations have a 7-day timeout. If your contract doesn’t settle within this period:
  1. Admin can call handleLiquidationTimeout()
  2. Debt becomes bad debt
  3. Insurance fund covers the loss (if funded)
Ensure your settlement process completes well before timeout.

Liquidation Router

The shared Liquidation Router handles collateral routing across multiple markets: Capabilities:
  • Receives collateral from any authorized market
  • Routes to market-specific trading venues
  • Handles USDC settlement back to originating markets
  • Rate limiting per token (prevent manipulation)
For most deployments, the default router configuration works without custom integration. Only implement a custom liquidation contract if you need specific handling (internal OTC, special compliance requirements, etc.).

Insurance Fund

When liquidation proceeds don’t fully cover debt: Bad Debt=Original DebtLiquidation Proceeds\text{Bad Debt} = \text{Original Debt} - \text{Liquidation Proceeds} The insurance fund:
  1. Receives portion of protocol fees
  2. Covers bad debt automatically
  3. Protects liquidity providers from losses
Monitor insurance fund balance in market metrics. Low balance during volatile periods indicates elevated risk.

Monitoring Best Practices

Daily

  • Check for liquidatable positions
  • Verify oracle price freshness
  • Monitor pending liquidation settlements

Weekly

  • Review liquidation statistics
  • Check insurance fund balance
  • Audit settlement timeouts

Smart Contracts

Contract architecture and roles

Management

Day-to-day operations