Liquidity Curve
The formula that maps pool reserves to prices and slippage.
Basically
A liquidity curve is the formula an automated market maker, or AMM, uses to set prices between assets. It also controls how the pool's funds are spread across different prices.
Key Takeaways
- A liquidity curve is the mathematical invariant that governs how an automated market maker (AMM) prices trades. It also allocates reserves between two or more tokens in a liquidity pool.
- Different curve shapes produce different trading behaviour. The constant product formula (x · y = k) spreads liquidity across all prices, while StableSwap curves flatten near the peg to minimise slippage on stablecoin trades.
- Curve design directly determines the trade-offs between capital efficiency, slippage and impermanent loss. Choosing the right curve for an asset pair is one of the most important decisions in AMM design.
What Is a Liquidity Curve?
A liquidity curve is the mathematical function an AMM uses to set exchange rates between assets. The curve dictates how much token B a trader receives for a given amount of token A when they swap token A for token B on a decentralised exchange. It also determines how the pool's reserves change after each trade.
Traditional finance sets prices by matching buy and sell orders on an order book, while AMMs replace this process with a deterministic formula. The shape of that formula, the "curve", controls where liquidity is concentrated, how prices respond to trades of different sizes and how much slippage traders experience. Different asset types require different curves: a volatile pair like ETH/USDC needs a different pricing function from a pair of stablecoins pegged to the same value.
The term "curve" comes from plotting the relationship between the two token reserves on a graph. Each point on the curve represents a valid pool state after a trade. The slope at any point gives the instantaneous exchange rate, and the curvature determines how quickly that rate changes as trade size increases.
How It Works
Every AMM enforces an invariant, a mathematical relationship between pool reserves that must hold before and after every trade. Traders move along the curve by depositing one token and withdrawing another, but the invariant remains constant when fees are ignored. The three major liquidity curve designs each define a different invariant.
Constant Product (x · y = k)
The constant product formula is the simplest and most widely used AMM invariant, introduced by Uniswap v2. A pool holding x units of token A and y units of token B must keep their product constant: x · y = k.
The constant product invariant traces a hyperbola on a graph. Liquidity is distributed uniformly from a price of zero to infinity, so the pool can always facilitate trades at any price. Most of the capital sits idle as a result: in a pool where ETH trades around $2,000, the reserves allocated to prices like $10 or $100,000 are never used.
The constant product curve is resilient and general-purpose. It never runs out of either token entirely because the curve approaches but never touches the axes, which suits volatile pairs where prices can swing dramatically. The trade-off is poor capital efficiency.
StableSwap (Curve Finance)
The StableSwap invariant, introduced by Curve Finance, is optimised for assets that trade near the same price, such as stablecoin pairs (USDC/USDT) or wrapped asset pairs (WBTC/BTC). It blends two simpler invariants using an amplification coefficient A.
The constant-sum component (x + y = D) provides zero slippage when the pool is balanced, but its fatal flaw is that it allows the pool to be fully drained of one token. The constant-product component prevents that by introducing steep price impact at the extremes. The amplification coefficient A controls the blend: high A values flatten the curve near the peg, while low A values make it behave more like a standard constant product pool.
StableSwap concentrates liquidity around the peg price. A StableSwap pool can facilitate a $1 million stablecoin trade with a fraction of the slippage that the same trade would incur on a constant product pool of equal size. The design is dramatically more capital efficient for pegged assets.
Concentrated Liquidity (Uniswap v3)
Concentrated liquidity, introduced by Uniswap v3, takes a fundamentally different approach. Individual liquidity providers (LPs) can choose a specific price range for their capital instead of relying on a single global invariant. The maths still follows a constant product formula within that range, but the "virtual reserves" are much larger than the actual deposited capital.
Narrower ranges concentrate liquidity more and increase capital efficiency. An LP concentrating in a tight range around the current price provides the same depth as a much larger position spread across all prices. The trade-off is that the position becomes inactive, earns zero fees and becomes fully composed of the less valuable token, a form of impermanent loss, if the price moves outside the LP's chosen range.
Concentrated liquidity effectively lets the market create any curve shape by aggregating many individual positions. A stablecoin pair will naturally attract most LPs to a tight range around $1.00, producing a flat aggregate curve similar to StableSwap. A volatile pair will see LPs spread across wider ranges.
Slippage
Slippage is the difference between the expected price and the executed price of a trade. Flatter curves produce less slippage for a given trade size because the exchange rate changes slowly, so a StableSwap curve with a high amplification coefficient can handle large stablecoin swaps with near-zero slippage. A constant product curve, by contrast, produces proportional slippage on every trade regardless of size.
Capital Efficiency
Capital efficiency measures how much useful trading depth a given amount of deposited capital provides. A constant product pool distributes its capital across all possible prices, so most of it goes unused, while concentrated liquidity and StableSwap curves focus capital where it is actually needed and require less total value locked to achieve the same trade execution quality. A concentrated liquidity position in a narrow range can in practice provide the same depth as a full-range position many times its size.
Impermanent Loss
Impermanent loss occurs when the price ratio between pooled assets changes, leaving LPs worse off than if they had simply held the tokens. Curve shape affects how severe this loss becomes, and concentrated liquidity amplifies it within the chosen range: the narrower the range, the higher the potential loss when prices move. StableSwap curves mitigate impermanent loss for pegged assets because prices rarely deviate far from the peg, and the flat curve region minimises the portfolio rebalancing that drives the loss.
Stablecoin Pools
Stablecoin-to-stablecoin trades demand minimal slippage because the assets should trade near 1:1. StableSwap curves or tightly concentrated liquidity positions are the standard choice, and Curve Finance built its entire protocol around this use case. Its pools routinely handle multi-million dollar swaps with slippage measured in basis points, making flat curves core infrastructure for stablecoin swaps across DeFi.
Volatile Asset Pairs
Pairs like ETH/USDC or BTC/ETH experience large price swings. Constant product curves or wide-range concentrated liquidity positions work best here because they guarantee liquidity at any price. LPs in volatile pairs accept lower capital efficiency in exchange for staying active across a broader range of market conditions.
Custom Curve Protocols
Newer protocols experiment with custom curves for specific use cases. Bonding curves define token price as a function of supply for token launches and continuous funding. Protocols like Balancer generalise the constant product formula to weighted pools (x^w1 · y^w2 = k), enabling exposure ratios other than 50/50, while Uniswap v4's hook system allows developers to modify curve behaviour through programmable hooks that run custom logic before or after swaps.
DEX Aggregation and Routing
DEX aggregators split trades across multiple pools with different curve types to minimise total slippage. A large stablecoin swap might route partly through a StableSwap pool and partly through a concentrated liquidity pool, depending on which offers better rates at each portion of the trade size. Smart order routers use curve shapes as a fundamental input when optimising execution.
Why It Matters
Liquidity curves are the core primitive of decentralised trading. The choice of curve determines whether a protocol can compete with centralised exchanges on execution quality, whether LPs earn sustainable returns and whether large trades can execute without excessive price impact. Curve design continues to evolve as DeFi matures, from the simplicity of constant product to the specialisation of StableSwap to the flexibility of concentrated liquidity and programmable hooks.
Payment infrastructure built on decentralised protocols feels the effects of curve design in the cost and reliability of token swaps behind the scenes. The underlying liquidity curve determines execution cost when a payment system converts between stablecoins or settles across different assets. Protocols in the Spark ecosystem that handle stablecoin swaps or atomic swaps benefit from deep liquidity and efficient curve designs on the venues they route through.
Curve Mismatch Risk
The wrong curve for an asset pair leads to poor outcomes. A constant product curve on a stablecoin pair wastes capital and produces unnecessary slippage, while a StableSwap curve on a volatile pair can catastrophically underprice large trades when one asset depegs because the flat region allows massive imbalances before the price reacts. Depeg events on StableSwap pools have historically caused significant losses for LPs who provided liquidity assuming the assets would stay pegged.
Amplification Parameter Risk
The amplification coefficient A in StableSwap pools is a governance parameter that can be adjusted. Setting A too high creates a very flat curve that offers minimal protection during depegs, while setting A too low negates the benefit of using StableSwap over constant product. Protocol governance must balance efficiency against tail risk, and parameter changes can affect existing LP positions.
Concentrated Liquidity Complexity
Concentrated liquidity requires active management. LPs must choose price ranges, monitor positions and rebalance when prices move, while passive LPs who set wide ranges sacrifice much of the capital efficiency benefit. Research has shown that concentrated liquidity gains disproportionately benefit traders through lower slippage rather than LPs, who often underperform a simple buy-and-hold strategy after accounting for impermanent loss.
Oracle and Manipulation Risks
AMM pool prices are determined by the curve and can diverge from true market prices until arbitrageurs correct them. Shallow curves or low-liquidity pools are vulnerable to oracle manipulation and sandwich attacks. Protocols that use AMM pool prices as TWAP oracles must account for how the underlying curve shape affects price responsiveness and manipulation cost.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. You should always do your own research before using any protocol or technology.