Curve Finance AMM: StableSwap, Gauge Weights, and veCRV
Table of Contents
Table of Contents
Share

StableSwap invariant math, veCRV gauge weight voting, CRV emission mechanics, and Convex Finance cvxCRV integration for production DeFi builders in 2024.
Frequently Asked Questions
- The StableSwap invariant combines a constant-sum formula with a constant-product formula, modulated by an amplification coefficient A. When pool assets are near parity, the curve behaves like a constant-sum AMM with near-zero slippage. As the pool moves away from balance, it transitions toward constant-product behavior. This gives stablecoin pairs dramatically lower slippage than xy=k for balanced swaps while still providing infinite price discovery at extremes.
- veCRV holders vote weekly on the GaugeController contract to allocate a percentage weight to each registered pool gauge. The Minter contract reads these weights on a weekly epoch boundary and distributes the global CRV inflation rate proportionally. A pool with ten percent gauge weight receives ten percent of all CRV minted that week. Votes persist across epochs unless changed, and veCRV voting power decays linearly toward zero as the lock expiry approaches.
- cvxCRV is a liquid receipt token minted by Convex when a user deposits CRV into the Convex protocol. Convex locks the underlying CRV as veCRV permanently, votes on gauges to boost yields across all Convex-deposited pools, and passes boosted CRV rewards plus platform CVX tokens back to cvxCRV holders. Liquidity providers use it to capture veCRV boost without individually locking CRV for up to four years, while retaining the ability to trade the cvxCRV token on secondary markets.
- In July 2023, a reentrancy guard bug in Vyper compiler versions 0.2.15, 0.2.16, and 0.3.0 was exploited to drain several Curve v1 pools that relied on Vyper-native reentrancy protection rather than explicit mutex locks. Affected pools included alETH, msETH, pETH, and CRV/ETH, resulting in losses totaling approximately sixty-nine million dollars. The vulnerability did not affect pools compiled with newer Vyper versions or pools using OpenZeppelin-style ReentrancyGuard patterns written in Solidity.
- Curve pools charge a base swap fee set at the time of pool deployment, typically 0.04 percent for stablecoin pools. Of the total fee collected, fifty percent is distributed to liquidity providers as a rebate added to pool reserves, and fifty percent constitutes the admin fee directed to veCRV holders. The admin fee accumulates in the pool and is periodically claimed and converted to 3CRV tokens by the FeeDistributor contract, which then distributes 3CRV pro-rata to veCRV holders weekly.
Don't Miss What's Next
Subscribe to newsletter
Curve Finance
StableSwap
AMM
DeFi
veCRV
Gauge Weights
Convex Finance
Liquidity Incentives
Get in Touch
Our team will get back to you within 24 hours.














