The Momentum Crash Is a Code Execution Error: What Your Risk Model Missed

0xPlanB
Culture

Over the past 72 hours, cumulative liquidations across Ethereum lending protocols exceeded $340 million, yet the underlying invariant violations were mathematically predictable six months ago. The market calls it a momentum crash. I call it a systematic failure in risk parameter calibration.

Context: The Mechanics of a Cascading Failure

Every lending protocol—Aave, Compound, Morpho—operates on a simple state machine. A user deposits collateral (e.g., ETH, wstETH), borrows a stablecoin (e.g., USDC, DAI), and the protocol maintains a health factor > 1. The formula is: healthFactor = (collateral * liquidationThreshold) / borrowed. When asset prices drop, the health factor falls below 1, triggering liquidation auctions.

The problem is not the formula. It is the assumption that price discovery and liquidation execution occur in separate, sequential blocks. In reality, a momentum crash compresses time. A 5% ETH drop in one hour triggers a cascade of margin calls, each liquidation selling borrowed assets into a declining market, depressing the oracle price further, and triggering the next wave. This is not a market panic—it is a deterministic, recursive loop.

Core: Where the Code Fails the Model

During my 2020 audit of a prominent lending protocol’s collateral liquidation logic, I discovered a critical reentrancy vulnerability in the withdrawal function: balances were updated after external calls. That was a classic Solidity bug. The momentum crash of 2025 is a different class of bug—a systemic blind spot in the risk model itself.

Let’s examine the interest rate model. Aave and Compound borrow rates are piecewise linear functions of utilization. They are arbitrary. They do not reflect real-time liquidity demand elasticity. During a crash, utilization spikes to 95%+ in minutes, and the borrow rate mathematically approaches infinity. Code snippet:\n\n