# Inability to perform partial liquidations allows huge positions to accrue bad debt in the system

DYAD's liquidate() burns the entire minted DYAD of a DNft, so whales' huge positions can't be partially liquidated, accruing bad debt.

- Payout: Audit contest
- Severity: high
- Program: DYAD
- Found by: MrPotatoMagic
- Disclosed: 2024-06-17
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-04-dyad-findings/issues/1097
- Library page: https://bugbountylibrary.com/r/c4%3A2024-04-dyad%3AH-02
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:business-logic vuln:liquidation

**Target:** VaultManagerV2.liquidate() liquidation logic
**Root cause:** liquidate() calls dyad.burn with the full mintedDyad amount for the id, with no parameter for a partial amount, so a liquidator must cover the entire debt to liquidate.
**Steps:**
1. Whale mints large DYAD against collateral via a DNft id.
2. Price moves so collatRatio(id) < MIN_COLLATERIZATION_RATIO.
3. Liquidator calls `liquidate(id, to)`; line 235 executes `dyad.burn(id, msg.sender, dyad.mintedDyad(address(this), id))` requiring the full minted amount.
4. If liquidator cannot supply/burn the full amount (exceeds market liquidity), liquidation reverts and position stays undercollateralized.
**How found:** Code reading of liquidate() revealed the burn uses the full mintedDyad amount rather than a caller-supplied partial amount, making whale positions unliquidatable.
**Exploitation:** A large undercollateralized position cannot be liquidated because the liquidator must burn the entire DYAD debt; if that exceeds available DYAD liquidity (even via flash loan), the position persists and accrues bad debt to the protocol.
**Insight:** In lending/liquidation code, check whether the liquidation entrypoint accepts a debt amount; a hardcoded full-debt burn caps liquidatable size at available token liquidity, leaving large positions as bad debt.

