liquidation-cascade

Solid

Detect cascading liquidations and socialized bad debt — correlated collateral (multiple LSTs/stables), bad debt socialized across unrelated markets, oracle flash-crash triggering mass liquidation, insurance-fund depletion ordering, liquidation incentives too low to clear bad debt, and depeg cascades. Activate whenever a lending/perp/CDP protocol liquidates positions, prices collateral, or has shared-risk pools.

Web & Frontend 38 stars 5 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
53
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Liquidation cascade detection ## When this applies Trigger on any of: - Lending / CDP / perp markets with liquidation and a liquidation bonus - Multiple collateral assets that are correlated (stETH/rETH/cbETH, USDC/DAI/USDT) - A single insurance fund or backstop covering many isolated or pooled markets - Bad-debt handling that socializes losses across lenders/LPs - Collateral priced from a feed that can flash-crash or depeg - Liquidation incentives or close factors set by governance ## Detection patterns ### Correlated collateral, no concentration cap (HIGH) ```solidity // stETH, rETH, cbETH all accepted, all priced off ETH-correlated feeds collateralFactor[stETH] = 0.9e18; collateralFactor[rETH] = 0.9e18; ``` **Signal:** treating correlated LSTs as independent diversification. A single LST depeg (stETH 2022, or an LRT slashing event) crashes many positions at once, overwhelming liquidation throughput. Cap aggregate exposure per risk-cluster, not per token. ### Bad debt socialized across markets (HIGH) A loss in one risky isolated market draining a *shared* insurance fund or pool that also backs blue-chip markets. **Signal:** one toxic listing can impair unrelated depositors (the Mango / cross-margin contagion class). Isolate bad debt to the originating market. ### Oracle flash-crash mass liquidation (HIGH) ```solidity uint256 price = oracle.getPrice(collateral); // single-block spot, no bounds if (debt > price * collateral * cf) liquidate(); ``` **Signal:** a mom...

Details

Author
iktok90-design
Repository
iktok90-design/ai-smart-contract-auditor
Created
1 weeks ago
Last Updated
2 days ago
Language
JavaScript
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category