Skip to main content
DeFi

Major Risks in DeFi

Pomegra Learn

Major Risks in DeFi

Decentralized finance moves capital at unprecedented speed and scale without traditional gatekeepers, risk managers, or regulatory oversight. While this enables innovation and efficiency, it also concentrates and amplifies risks. Losses from smart contract bugs, oracle failures, and liquidation cascades can evaporate millions of dollars in seconds. Unlike traditional finance, where losses are spread across institutions and regulators can step in with circuit breakers and backstops, DeFi's risks fall directly on users.

Understanding DeFi risks is essential for anyone deploying capital. The following are the primary categories of risk and the mechanisms by which they manifest.

Smart Contract Risk

A smart contract is only as secure as its code. If the contract contains a bug, that bug becomes a vulnerability that attackers can exploit. Unlike traditional software, where a bug in version 1.0 can be patched in version 1.1, smart contracts on blockchains are immutable—once deployed, the code cannot be changed.

The DAO Hack (2016) is the canonical example. The DAO smart contract had a reentrancy vulnerability: when a user withdrew funds, the contract sent the funds before updating the balance. An attacker exploited this by creating a recursive function that repeatedly called the withdrawal function, draining the contract before the balance update could occur. The attacker stole $50 million (equivalent), and the only remedy was a hard fork of Ethereum itself—rolling back history to before the theft.

More recent examples illustrate the persistence of this risk. The Ronin Bridge hack (2022) exploited a multi-signature vulnerability, allowing attackers to steal $625 million. The Nomad Bridge hack (2022) exploited an initialization bug, draining $190 million. In each case, the code was reviewed and deployed by competent teams, yet vulnerabilities remained.

Common vulnerability classes include:

  • Integer overflow/underflow: Arithmetic operations exceed the limits of their data type, wrapping around. Modern languages like Solidity 0.8+ have protections, but older contracts remain vulnerable.
  • Unchecked external calls: A contract sends funds but doesn't verify the recipient actually received them, or doesn't handle the case where the recipient's code rejects the transfer.
  • Front-running: A transaction submitted by one user is observed in the mempool by another user, who submits a similar transaction with higher fees to execute first, extracting value.
  • Flash loan attacks: An attacker borrows a large amount of capital via a flash loan, uses it to manipulate prices, and profits before repaying the loan.

Oracle Risk

Blockchain smart contracts cannot directly observe real-world data like asset prices. Instead, they rely on oracles—external services that feed data on-chain. An oracle might report the current price of Ethereum based on aggregated data from multiple centralized exchanges.

If an oracle is inaccurate or compromised, the smart contracts that depend on it can make wrong decisions. This is particularly critical for lending and derivative protocols, which use price feeds to determine collateral values and liquidation prices.

Oracle manipulation can occur in several ways:

  • Price feed attacks: An attacker temporarily manipulates an exchange price (by quickly buying large quantities and selling them back), and the oracle reports the manipulated price before it reverts. Flash loan attacks often combine this—borrowing a large quantity of an asset, using it to pump the price, and profiting from lending contracts that believed the inflated price.
  • Stale prices: If an oracle data provider goes down or is delayed, contracts receive outdated prices. During the 2023 Curve Finance exploit, an oracle provided stale price data, allowing an attacker to profit from the mismatch between the on-chain price and the actual market price.
  • Single point of failure: Many protocols use a single oracle provider (e.g., Chainlink) without redundancy. If that provider is compromised, all dependent protocols are affected.

Robust oracle design requires multiple independent price sources, time delays to allow for observation and dispute, and circuit breakers that halt operations if prices move too rapidly. Protocols like Aave use multiple oracles and fallback mechanisms; however, the fundamental problem—that blockchains cannot directly observe off-chain data—remains unsolved.

Liquidation Cascades

When users borrow from a DeFi lending protocol, they pledge collateral. If the collateral's value falls below a threshold (often 70-80% of the borrowed amount), the position is liquidated: the collateral is auctioned off to repay the debt. This mechanism protects the protocol from loss; users are incentivized to maintain adequate collateral.

However, during periods of volatility, liquidations can cascade, creating a feedback loop:

  1. Asset prices fall (due to broader market movement or a localized shock).
  2. Leveraged borrowers' positions approach liquidation thresholds.
  3. Liquidators begin executing auctions, selling collateral for whatever price they can get.
  4. The sell pressure pushes prices lower.
  5. More positions fall below thresholds, triggering more liquidations.
  6. The cascade accelerates until either collateral prices stabilize or all vulnerable positions are liquidated.

The 2020 Black Thursday attack demonstrated this mechanism. MakerDAO (a lending protocol) experienced a liquidation cascade when Ethereum prices crashed 50% in minutes, overwhelming liquidators' ability to execute auctions. MakerDAO's governance was forced to vote on an emergency bailout, devaluing the stablecoin (DAI) and shifting losses to governance token holders.

Liquidation cascades disproportionately harm retail users. Sophisticated liquidators run highly optimized infrastructure to detect and execute liquidations milliseconds after positions breach thresholds. Retail users' transactions are delayed by mempool latency and network congestion, meaning liquidators liquidate them first. The liquidators capture most of the collateral, leaving retail users with minimal recovery.

To mitigate this risk, protocols implement:

  • Liquidation thresholds: Keeping thresholds low enough that borrowers have buffer before liquidation.
  • Liquidation fees: Sharing liquidation profits with the protocol (encouraging buffer maintenance).
  • Auction mechanisms: Allowing collateral to be sold over time rather than instantly, reducing sell pressure.
  • Circuit breakers: Pausing borrowing or liquidations during extreme volatility to prevent cascades.

Impermanent Loss

Automated Market Makers (AMMs) create liquidity pools where users deposit two assets (typically a token and stablecoin) in equal value. The AMM uses a formula to determine prices: the constant product formula, x * y = k, means that as one asset is bought, its price rises (compensating the liquidity provider), but the other asset's price falls.

Impermanent loss occurs when the two assets' prices diverge. Suppose you deposit 1 ETH and $2,000 USDC into a Uniswap pool when ETH is $2,000. Later, ETH rises to $4,000. As users buy ETH from the pool, the AMM keeps prices in sync with the market, meaning you end up with less ETH than you started with (you've sold some as the price rose). If you'd simply held the ETH and USDC separately, you'd have 1 ETH (now worth $4,000) and $2,000 USDC. Instead, you have less ETH and more USDC due to trading mechanics—you "lost" the upside, hence "impermanent loss."

The loss is "impermanent" because it only materializes if you withdraw from the pool. If you hold the position and fees accumulate, the fees can eventually offset the loss. But if prices diverge significantly, fees rarely compensate.

Impermanent loss is highest for volatile assets in pools with low trading volume (so fees don't compensate). Sophisticated liquidity providers manage impermanent loss by focusing on stable asset pairs (where price divergence is minimal) or by actively managing positions (withdrawing during large price moves).

Collateral Risk and Death Spirals

When a protocol issues its own token (especially a governance or incentive token), it often accepts that token as collateral for loans or deposits. This creates a circular dependency: the protocol's solvency depends on the token's value, but if users lose confidence in the protocol, the token's value falls, triggering liquidations of positions that use the token as collateral, which reduces the token's demand, accelerating the spiral.

Luna and UST (2022) exemplified this. Luna was the governance token of the Terra protocol, which issued UST, a stablecoin backed by Luna collateral and a complex mechanism to maintain the peg. When UST began losing its peg, users rushed to redeem it for Luna, flooding the market with Luna supply. Luna's price crashed from $80 to near-zero, UST lost its peg entirely, and the entire protocol collapsed. Users lost approximately $40 billion in notional value.

The root cause was accepting Luna as collateral for UST—a circular dependency that was stable until sentiment shifted, at which point it became a death spiral.

To mitigate this risk, protocols should:

  • Diversify collateral: Accept collateral from multiple external sources rather than internal tokens.
  • Over-collateralize: Require more collateral than the debt it secures, providing a buffer.
  • Monitor collateral diversity: Track how much collateral comes from internal tokens and reduce that exposure.

Regulatory Risk

DeFi operates in regulatory gray zones in most jurisdictions. The U.S. Securities and Exchange Commission (SEC), Commodity Futures Trading Commission (CFTC), and Financial Crimes Enforcement Network (FinCEN) have issued warnings and regulations, but the application to specific DeFi protocols remains unclear.

Key regulatory risks include:

  • Securities law: If a DeFi token is deemed a security, the token's issuance violates securities laws unless it goes through proper registration. Retroactively, token holders and issuers might face liability.
  • Derivatives regulation: Options, perpetual futures, and other derivatives are heavily regulated in traditional finance. DeFi protocols offering these without licenses may violate CFTC rules.
  • Anti-money laundering: FinCEN guidance requires crypto exchanges to implement KYC (know-your-customer) and AML (anti-money laundering) compliance. Decentralized exchanges lack gatekeepers for enforcement, creating ambiguity about protocol liability.
  • Custody and banking regulation: If a DeFi protocol holds user assets in custody, it may be subject to banking regulations, requiring licenses and reserve requirements.

The regulatory environment is rapidly evolving. Protocols face the risk that today's compliant behavior becomes non-compliant tomorrow, or that jurisdiction-specific rules apply retroactively, imposing liability.

Governance Risk

DeFi governance allows token holders to vote on protocol parameters, changes, and allocations of capital. This is powerful—enabling community-driven evolution—but introduces risks:

  • Vote capture: Large token holders or coordinated groups can vote themselves benefits, socializing losses across small holders.
  • Governance attacks: An attacker accumulates governance tokens, votes to drain the protocol's reserves or modify parameters maliciously, then sells the tokens.
  • Contentious forks: Disagreements over governance direction can lead to protocol forks, splitting the user base and reducing both versions' liquidity.

Aave governance attacks (attempted but largely mitigated by multi-sig safeguards) and MakerDAO's governance crises (where competing factions disagree on collateral strategy) illustrate these risks.

Contagion and Systemic Risk

DeFi protocols are interconnected through composability. When one protocol fails, losses cascade. The 2020 Aave/Compound liquidation cascade and the 2022 Three Arrows Capital collapse (affecting Celsius, Voyager, and other centralized platforms) demonstrated how quickly losses spread.

Systemic risk is amplified because DeFi lacks circuit breakers and stabilizers that traditional finance has (margin call limits, trading halts, central bank interventions). A shock that would be absorbed in traditional markets can cause catastrophic cascades in DeFi.

Flowchart

Key Takeaways

  • Smart contract vulnerabilities can permanently drain protocol value; immutability means bugs cannot be patched.
  • Oracle risks arise when price feeds are inaccurate, manipulated, or stale, misleading contracts' decisions.
  • Liquidation cascades amplify losses during volatility; prices fall, triggering more liquidations, further depressing prices.
  • Impermanent loss affects liquidity providers when asset prices diverge; fees must compensate to be profitable.
  • Regulatory risk stems from unclear legal status of DeFi; retroactive application of securities or derivatives laws could impose liability.
  • Governance attacks, collateral death spirals, and composability cascades amplify risks across protocols.
  • Risk management requires diversification, over-collateralization, monitoring external data feeds, and robust smart contract auditing.

Next: Importance of Smart Contract Audits in DeFi