What happens if the liquidated amount is below the amount lent? Who pays the difference?

If the liquidated collateral amount is insufficient to cover the loaned amount (aka. “bad debt”) in a Vault, Morphos’ protocol tracks the loss so that third-parties can inject the missing funds (via a "deposit on behalf" mechanism) and ensure lenders aren’t stuck. • Worst-Case Scenario: In case of a large-scale shortfall event (e.g., due to extreme market volatility or liquidation failures) any third-party can decide to allocate funds to cover the bad debt or other recovery mechanisms to compensate lenders. In case the debt is still not covered, this bad debt amount is deducted from the vault’s "available assets" for withdrawals, so lenders can only redeem the part of their funds that are not associated with the bad debt.