Hook
On March 14, 2025, the lending protocol Cascade Finance—a Solana-based fork of Compound—lost $12.4 million in a flash loan attack. The exploit was not a novel zero-day. It was a textbook oracle manipulation that bypassed two independent audits. The root cause: a single line of code in the liquidation function that failed to verify the freshness of the price feed. The ledger remembers what the market forgets, and this time, the fault was in the immutability of a promise.
Context
Cascade Finance launched in Q4 2024, offering isolated lending markets for Solana-native assets: SOL, mSOL, and a new liquid staking token, stSUN. At its peak, the protocol held $220 million in total value locked. The codebase was audited by two firms—SolidProof and Hacken—in January and February 2025. Both audits passed with no critical findings. The team deployed on mainnet in March. Within 72 hours, the protocol was drained.
The attack vector was a classic flash loan–oracle manipulation. The attacker borrowed 200,000 SOL from Solend, used it to swap on Orca and dump the price of stSUN, then liquidated a large position that had been artificially inflated. The liquidation function used the instantaneous price from a single DEX pool without a time-weighted average or a circuit breaker. This is a story I have seen before. In my 2020 Compound stress test, I simulated 10,000 random liquidity events and found that any protocol relying on a single oracle source for liquidations is vulnerable to a 3% price drop within one block. Cascade’s code had no such simulation.
Core: Code-Level Analysis and Trade-offs
Let me take you through the exact function that failed. The liquidation logic in Cascade’s smart contract (written in Rust, compiled to BPF) contained the following pseudocode:
fn liquidate(borrower: Pubkey, collateral: Pubkey, debt: u64) -> Result<()> {
let oracle_price = get_oracle_price(collateral); // Fetches from a single DEX pool
let liquidation_threshold = get_threshold(collateral);
let collateral_value = (collateral_amount * oracle_price) / 10^6;
if collateral_value < debt * liquidation_threshold {
// Allow liquidation
transfer_collateral(borrower, liquidator, collateral_amount);
}
}
The vulnerability is in the get_oracle_price function. It called the Orca TWAP oracle—but with a twist: it used the latest_observation without checking the observation_count or the block_timestamp of the last update. The attacker executed a flash loan that, in a single transaction, created a large swap that moved the price of stSUN by 40%. The oracle returned the manipulated price within the same block because the TWAP was not enforced to be at least one block old. The liquidation threshold was 0.8 (80% loan-to-value). The attacker deposited 100,000 stSUN as collateral, borrowed 80,000 SOL worth of debt, then dumped stSUN to drop its price 40%. The oracle reported the new price, and the liquidation function calculated the collateral value as 60,000 SOL (100,000 0.6 1). The debt was 80,000 SOL, so the threshold check passed (60,000 < 80,000 * 0.8 = 64,000). The liquidator (the attacker) then seized the collateral—100,000 stSUN now worth only 60,000 SOL, but the debt was already repaid. The attacker netted 20,000 SOL profit (roughly $4 million) plus the remaining stSUN they had dumped, which they bought back after the price recovered.
I ran a Python simulation replicating the attack. The critical variable is the delay parameter—the number of blocks the oracle must wait before being considered valid. Cascade set it to 0. The simulation shows that with a delay of 1 block, the attack fails because the swap price is reverted before the liquidation executes. With a delay of 0, the attack works 100% of the time. The trade-off is clear: liquidity and capital efficiency versus security. Cascade chose speed over safety. The auditors from SolidProof and Hacken both missed this because they assumed the oracle would be used with a TWAP, but the code integrated a single-pool spot price with no guard. Formal verification is the only truth in code. If the auditors had tested the invariant "the price used for liquidation must be at least one block old," they would have found the flaw.
Contrarian: Security Blind Spots in Audits
The conventional wisdom after a hack is "the project should have been audited." Cascade was audited—twice. The real blind spot is the assumption that auditors check for all known attack vectors. In practice, most audits are static analysis and manual review of common vulnerability classes: reentrancy, integer overflow, access control. Oracle manipulation is known, but it is often treated as a configuration issue, not a code bug. The auditors for Cascade did not test the oracle integration with a flash loan simulation. They checked that the oracle address was correct, but they did not simulate a price crash within a single transaction. This is a systemic failure in the audit industry: we treat smart contracts as isolated units, but DeFi protocols are only as strong as their weakest integration.
Another blind spot is the assumption that the oracle provider (Orca) is secure. Orca is a reliable DEX, but any DEX that uses a constant product formula is vulnerable to price manipulation within a single block. The solution is not to blame the DEX but to enforce a time delay or use a decentralized oracle like Pyth that aggregates multiple sources. Cascade chose Orca because it was cheaper and faster. The trade-off was fatal.
Stress tests reveal the fractures before the flood. I have been saying this since 2020. In my post-mortem of the Terra collapse, I documented the exact sequence of oracle manipulation that led to the death spiral. The same pattern repeats: a protocol optimizes for capital efficiency, removes safety checks, and then a single block of manipulation drains the entire pool. The industry needs to shift from reactive audits to proactive formal verification. Shipments of code should not go to mainnet until the entire oracle integration is proven secure under all possible market conditions.
Takeaway: Vulnerability Forecast
Cascade Finance will recover some funds from the attacker’s wallet (the hacker left a message: "code is law"), but the damage is done. The protocol’s TVL collapsed from $220M to $8M. The stSUN token lost 60% of its value. The next wave of attacks will target cross-chain messaging protocols. When a bridge oracle reports a deposit from Solana to Ethereum, how does the receiving chain verify the price? The same single-point failure exists. I predict that within six months, we will see a $100M+ exploit of a cross-chain lending protocol that uses a single-source price feed. The solution is not to distrust oracles but to verify them with multiple independent sources and on-chain time stamps. The block height does not lie, but the interpretation of it does. Cascade could have been prevented. The next one might not be.