How Does Curve Finance Work?

DEX|Risk B|10 mechanisms|6 interactions

The largest stablecoin exchange in DeFi, also offering its own stablecoin (crvUSD) and governing $1.8B in deposits. It pioneered the vote-locking model that spawned the Curve Wars. Its B- grade reflects a $73M hack in 2023 caused by a bug in the Vyper programming language, a risk unique to Curve.

TVL

$1.8B

Sector

DEX

Risk Grade

B

Value Grade

B

Core Mechanisms

AMM/StableSwap

StableSwap invariant optimized for tightly-pegged asset pairs

Curve's foundational innovation: a modified invariant that concentrates liquidity around the peg for correlated assets (stablecoins, LSTs). Industry standard adopted by many forks.

AMM/CryptoSwap

Tricrypto pools for volatile uncorrelated assets with dynamic peg repricing

Extended the StableSwap model for volatile asset pairs using an internal oracle that dynamically adjusts the concentration point. Enables Curve to compete on non-stable pairs.

Stablecoin/CDP-LLAMMA

Novel

crvUSD: soft-liquidation via Lending-Liquidating AMM (LLAMMA)

crvUSD uses LLAMMA for 'soft' liquidations that continuously convert collateral to crvUSD as price falls, and back as price rises. Over $120M in circulation. Novel mechanism with limited stress-testing history.

Governance/veToken

veCRV: vote-escrowed CRV directing pool emissions and earning protocol fees

Pioneered the ve-tokenomics model adopted across DeFi. Lock CRV for up to 4 years for veCRV. 35-65% of trading fees go to veCRV stakers. Drives the 'Curve Wars' for emission control.

Incentive/Gauge-System

Gauge weight voting to direct CRV emissions across pools

Weekly gauge votes determine CRV emission distribution across pools. This system spawned the Curve Wars ecosystem (Convex, Aura) where protocols compete for emission allocation.

Lending/crvUSD-Markets

Lending markets where crvUSD can be minted against volatile collateral

Multiple lending markets allow minting crvUSD against ETH, wBTC, stETH, and other collateral. Each market has independent risk parameters and LLAMMA instances.

Oracle/Internal-EMA

Exponential Moving Average (EMA) oracle from pool trading data

Curve pools provide internal EMA oracles consumed by crvUSD markets and external protocols. Manipulation resistance comes from the time-weighted averaging.

AMM/Factory

Permissionless pool factory for deploying new Curve pools

Anyone can deploy stableswap or cryptoswap pools via the factory. Permissionless creation enables rapid innovation but requires user diligence on pool quality.

Infrastructure/Vyper

Smart contracts written in Vyper programming language

Curve is the largest Vyper-based protocol. The July 2023 exploit originated from a Vyper compiler reentrancy bug (v0.2.15-0.3.0). Language-level dependency risk is unique to Curve in DeFi.

Lending/Credit-Lines

Protocol-level credit lines (e.g., 60M crvUSD to YieldBasis)

Curve governance has extended credit lines in crvUSD to partner protocols. Introduces tail risk: if a borrowing protocol is exploited, Curve faces bad debt and peg pressure.

How the Pieces Interact

LLAMMA soft-liquidationProlonged price declineHigh

LLAMMA continuously converts collateral during price drops, but in a sustained downturn, borrowers may find their collateral fully converted to crvUSD with no ability to recover, effectively creating a hard liquidation with extra slippage.

Vyper compiler dependencyContract upgrade limitationsHigh

A new Vyper compiler vulnerability would threaten all Curve contracts simultaneously. The July 2023 exploit demonstrated this systemic language-level risk. Curve's commitment to Vyper concentrates this exposure.

veCRV emissions captureProtocol-directed liquidityHigh

The Curve Wars dynamic means protocols (Convex, Aura) accumulate veCRV to direct emissions to their pools. This concentrates governance power and may misallocate incentives away from protocol health.

crvUSD credit linesBorrower protocol solvencyMedium

A 60M crvUSD credit line to YieldBasis means an exploit of that protocol could create bad debt for Curve, pressuring the crvUSD peg. Governance-approved credit lines create tail risk.

Internal EMA oraclecrvUSD liquidation thresholdsMedium

The EMA oracle smooths price data but can lag during flash crashes, delaying soft-liquidation initiation and potentially creating under-collateralized positions before LLAMMA activates.

What Could Go Wrong

  1. Vyper compiler vulnerability (July 2023 exploit) eroded trust; language-level risks persist for Vyper-based contracts
  2. crvUSD LLAMMA soft-liquidation mechanism is novel and largely untested through a severe prolonged downturn
  3. veCRV governance concentration enables whale-driven emissions capture (Curve Wars dynamics)

Vyper Compiler Zero-Day Cascade

Tail

Trigger: A second Vyper compiler vulnerability is discovered affecting contracts compiled with Vyper v0.3.1+ (post-2023 patch), enabling reentrancy or state manipulation across multiple Curve pool contracts simultaneously

  1. 1.Security researcher or attacker discovers new Vyper compiler-level vulnerability in versions used by current Curve contracts All Curve pools compiled with the affected Vyper version are simultaneously vulnerable
  2. 2.Attacker drains multiple StableSwap and CryptoSwap pools before patches can be deployed LP depositors across affected pools lose assets; $100M+ potentially at risk given $1.8B TVL
  3. 3.crvUSD lending markets experience oracle disruption as underlying pool reserves are manipulated LLAMMA soft-liquidation mechanism cannot function correctly with corrupted pool state
  4. 4.CRV token crashes 50%+ as the largest Vyper-based protocol faces systemic vulnerability Convex, Aura, and the entire Curve Wars ecosystem face cascading devaluation
  5. 5.veCRV-locked governance tokens become worthless; 4-year locked positions cannot be exited Curve's pioneering ve-tokenomics model faces existential crisis; DeFi protocols dependent on Curve liquidity scramble for alternatives

Risk Profile at a Glance

Mechanism Novelty3/15
Interaction Severity6/20
Oracle Surface0/10
Documentation Gaps1/10
Track Record5/15
Scale Exposure7/10
Regulatory Risk1/10
Vitality Risk2/10
B

Overall: B (25/100)

Lower score = safer

More on Curve Finance

Related DEX Explainers