Curvance
  • Protocol Overview
    • Click Less, Earn More
    • Protocol Architecture
    • Asset Types
    • Liquidity Markets
      • Borrowing
      • Liquidations
      • Interest Rates
      • Oracles
      • Collateral Caps
      • Bad Debt Socialization
    • Application Specific Sequencing
    • New Age Liquidity Mining
      • Protocols
    • How Are New Assets Integrated
    • Plugin System
    • Universal Account Balance
    • Token Approval Management
    • Lending Risks
  • Security
    • Security and Audits
  • Miscellaneous
    • RPCs and Testnet Stability
    • Glossary
    • TL;DR
      • Customer Types and Benefits
    • Brand Assets
    • Weblinks
    • Disclaimer
    • Frequently Asked Questions
  • Developer Docs
    • Overview
    • Quick Start Guides
      • Atlas Fastlane Auctions (coming soon)
      • Plugin Integration
        • List of Delegable Actions
      • Loans & Collateral
        • Lend Assets
        • Deposit into pTokens
        • Withdraw Loans
        • Withdraw pTokens
      • Borrowing & Repayment
        • Borrow
        • Repaying Debt
      • Leverage
        • Leveraging
        • Deleveraging
    • Lending Protocol
      • Market Manager
      • Position Tokens (pToken)
      • Earn Tokens (eTokens)
      • Dynamic Interest Rate Model
      • Universal Balance
    • Position Management
      • Leverage
      • Deleverage / Fold
    • Dynamic Liquidation Engine (DLE)
      • Orderflow Auction System
      • Bad Debt Socialization
    • Plugin & Delegation System
      • Transfer Lock Mechanism
      • Delegable Actions
    • Cross-Chain Functionality
      • Messaging Hub
      • Fee Manager
      • Reward Manager
    • Auxiliary Functionality
Powered by GitBook
On this page
  • Overview
  • Key Components
  • Process Flow
  • Technical Implementation
  • Security Considerations
Export as PDF
  1. Developer Docs
  2. Dynamic Liquidation Engine (DLE)

Bad Debt Socialization

Overview

Bad Debt Socialization is a critical risk management mechanism in the Curvance Protocol that handles scenarios where a borrower's collateral value falls below their outstanding debt. Rather than leaving the protocol with uncovered losses, this mechanism distributes the shortfall equitably among all lenders in the affected market, preserving system solvency while minimizing individual impact.

Key Components

System Actors

  • Liquidators: External agents who repay a portion of defaulted debt in exchange for collateral.

  • Borrowers: Users with debt positions that may become undercollateralized.

  • Lenders: eToken holders who collectively absorb any shortfall from liquidations.

  • Market Manager: Orchestrates the liquidation and bad debt socialization process.

Process Flow

1. Bad Debt Detection

The system identifies positions where collateral value is insufficient to cover debt:

Collateral Value < (Debt * Liquidation Incentive) = Bad Debt Condition

2. Asset-Specific Liquidation

When bad debt is detected:

  • Each collateral asset is evaluated individually for liquidation.

  • Liquidations occur on a per-asset basis rather than requiring full account liquidation.

  • Multiple liquidations can be processed efficiently in a single transaction.

3. Socialization Execution

When a liquidator executes the bad debt liquidation:

  1. The system calculates total debt to be closed for the specific asset.

  2. Determines how much can be repaid via the liquidator's token transfer.

  3. Calculates the remainder as bad debt to be socialized.

  4. The shortfall is distributed proportionally across all lenders of that asset.

Bad Debt = (Total Account Debt * Liquidation Incentive) - Collateral Value
Or, more simply:
Bad Debt = Total Account Debt - Liquidator Repayment

For example, if a borrower has $900 in debt with $850 in collateral during a liquidation with 5% liquidation incentive, lenders collectively absorb $95 (900 * 1.05 - 850 = 945 - 850 = 95) of the debt as a loss. If the borrower is liquidated across two liquidations, 25% initially then the remaining 75%, borrowers would recognize $23.75 and then $71.25 as bad debt across the liquidations.

4. State Transitions

The process follows these state transitions:

  • Normal Operation → Bad Debt Detection: When collateral falls below debt.

  • Bad Debt Detection → Asset Liquidation: Individual asset liquidation is triggered.

  • Asset Liquidation → Socialization: Execution of liquidation with partial repayment.

  • Socialization → Normal Operation: System returns to normal state with debt cleared.

Technical Implementation

The socialization mechanism operates through a coordinated interaction between:

  1. Debt Calculation: For each liquidation, the system:

    1. Calculates the total debt to be closed.

    2. Determines how much can be repaid through liquidation transfers.

    3. Subtracts this from total debt to find the bad debt amount.

  2. Efficient Processing:

    1. Multiple liquidations can be batched in a single transaction.

    2. Gas optimization by consolidating repayments and bad debt calculations.

  3. eToken Integration:

    1. The eToken contract recognizes unpaid debt by adjusting totalBorrows .

    2. This maintains the exchange rate mechanism while distributing losses.

  4. Atlas Integration:

    1. Atlas prioritizes liquidations to minimize bad debt through efficient market mechanisms.

    2. Buffer system ensures Atlas gets priority for executing liquidations.

    3. Dynamic penalty system incentivizes liquidators appropriately based on market conditions.

Security Considerations

  • Gas Efficiency: Optimized implementation handles thousands of liquidations efficiently, even during market stress.

  • Edge Cases: System handles rounding issues with conservative approaches that favor protocol solvency.

  • Transparent Tracking: Bad debt events are fully transparent with on-chain events.

This streamlined mechanism ensures the protocol remains solvent even in extreme market conditions while distributing any unavoidable losses fairly among participants, with minimal gas costs and maximum transparency.

PreviousOrderflow Auction SystemNextPlugin & Delegation System

Last updated 1 day ago