Bad Debt Explained in Detail
Bad debt appears when a borrower's debt is larger than what the protocol can recover. The gap may come from collateral price drops, failed liquidations, stale oracles, interest accrual, or bad accounting.
Reserves or insurance may cover the gap, but the debt is still a protocol loss.
Smart contract example
recoverable collateral + reserves < outstanding debt
That shortfall is the core bad debt condition.
Bad Debt in Auditing
Bad debt is a solvency failure. It can hurt lenders, drain reserves, break accounting, or force governance intervention.
Auditors test whether allowed protocol states can create unrecoverable debt.
Red flags in code
-
Liquidation paths revert under stress.
-
Loan-to-value or collateral parameters are too aggressive.
-
Stale or manipulated oracle prices are accepted.
-
Bad debt is not tracked per market or asset.
-
Interest accrues without rechecking solvency-sensitive flows.
How to test or review it
-
Simulate price crashes, full utilization, and reserve depletion.
-
Test liquidations at close-factor and dust boundaries.
-
Mock stale, wrong, and extreme oracle prices.
-
Include non-standard collateral behavior when supported.
-
Add invariants around assets, debt, reserves, and recoverable collateral.
Keep learning this topic
Liquidation
Liquidation is a protocol action that repays or closes an undercollateralized borrow position and transfers collateral according to the protocol's rules.
Collateral Ratio
Collateral ratio is the ratio of collateral value to debt value in a lending, borrowing, or minting system.
Loan-to-Value
Loan-to-value is the maximum borrow value allowed against collateral value in a lending system.
Practice this in real audit scenarios
Definitions help, but auditors need reps. SCH turns concepts like Bad Debt into exploit labs, code review habits, and report-writing practice.
Start the free trial or see the full smart contract auditing course.