# Withdrawing just before a bad debt event can increase losses for remaining liquidity providers

LPs can front-run bad debt socialization in Panoptic by withdrawing before liquidation mints shares to the liquidator, shifting losses onto remaining LPs.

- Payout: Contest reward
- Severity: medium
- Program: Panoptic
- Credited: Valves
- Disclosed: 2026-03-09
- Write-up quality: 6/10
- Original: https://code4rena.com/reports/2025-12-panoptic-next-core#m-19
- Library page: https://bugbountylibrary.com/r/c4%3A2025-12-panoptic-next-core%3AM-19
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:race-window vuln:business-logic vuln:liquidation

**Target:** CollateralTracker share/asset accounting during liquidation
**Root cause:** Bad debt is socialized by minting new shares to the liquidator while totalAssets drops, diluting remaining LPs; withdrawals are not locked or pro-rated around the event, so exiting LPs escape the dilution.
**Steps:**
1. Set up a liquidatable position with bad debt where liquidatee lacks funds for the liquidator bonus.
2. Observe totalAssets and totalShares before liquidation.
3. As LP, withdraw shares immediately before liquidation is executed.
4. Liquidation mints shares to liquidator, dropping totalAssets and diluting remaining LPs.
5. Compare withdrawable amount before vs after: 1009.25e18 vs 989.32e18, showing front-run gain.
**How found:** Reasoned about the share/asset ratio mechanics: liquidation mints shares to the liquidator while assets leave the protocol, changing the ratio, which LPs can front-run.
**Exploitation:** LP monitors for imminent liquidations with bad debt, withdraws shares just before the liquidation transaction, avoiding the share dilution; remaining LPs absorb the full deficit.
**Insight:** In share-based lending pools, any event that mints shares against departing assets (liquidator bonuses, bad debt socialization) is a front-runnable dilution; check whether withdrawals are locked or pro-rated around such events.
