Stableswap and Cryptoswap Pools
Curve utilizes two specialized algorithms for its liquidity pools: Stableswap and Cryptoswap. Each is engineered to provide the best possible trading experience and returns for different types of crypto assets.
Here’s a quick comparison:
| Feature | Stableswap Pools | Cryptoswap Pools |
|---|---|---|
| Asset Type | Pegged-value assets (e.g., USDC/USDT, stETH/ETH), or stable assets with underlying yield (e.g., scrvUSD/USDT). | Volatile, uncorrelated assets (e.g., ETH/WBTC, WBTC/crvUSD). |
| Number of Assets | At least 2, with maximum of 8 | 2 or 3 |
| Primary Goal | Ultra-low slippage for assets that trade near a fixed ratio (usually 1:1). | Efficiently trade volatile assets while protecting LPs and maintaining pool balance. |
| Mechanism | Concentrates liquidity around a fixed peg (e.g., 1:1). The pool can become unbalanced (e.g., 90% USDC, 10% USDT) and still function efficiently, relying on arbitrage to restore balance. | Balances and concentrates liquidity around current price, with equal value in each asset. If prices change, it automatically rebalances liquidity if LP have generated enough to stay profitable. |
| LP Strategy | Fully Passive. LPs provide liquidity across the entire price range. This "set and forget" model contrasts with AMMs that require active management of liquidity positions. | Fully Passive. The algorithm automatically manages liquidity concentration and rebalancing, using accrued trading fees to cover the costs. |
Stableswap Pools
The Stableswap algorithm is Curve's original innovation and the foundation of the protocol. It's designed to facilitate swaps between assets that are pegged to the same value, like two different stablecoins or a liquid staking derivative and its underlying asset.
The primary advantage is incredibly deep liquidity around the peg. This means traders can execute massive swaps with minimal price impact (slippage). For instance, in a healthy $20M USDC/USDT pool, a $1M swap would likely incur less than 0.01% slippage (receive $999.9k after swapping), making it one of the most capital-efficient platforms for stable assets.
A key feature of Stableswap pools is that they are fully passive. Unlike most other AMMs where LPs must actively manage their price ranges, Curve LPs can simply deposit their assets and earn fees without further intervention. The pool provides liquidity across all possible prices, though it's most concentrated at the peg.
Types of Assets in Stableswap Pools
Stableswap pools can handle a few different types of assets:
- Pegged Assets: Tokens that should trade at a 1:1 ratio, such as crvUSD/USDT or stETH/ETH.
- Yield-Bearing Assets: Assets that gradually appreciate against a base asset due to underlying yield, like sUSDe/USDT. The Stableswap math handles this slow-changing ratio gracefully.
- Constant Ratio Assets: A less common but powerful use case. For example, two tokenized gold assets for different weights, kgGOLD and ozGOLD, where 1 kgGOLD is always worth about 35 times more than 1 ozGOLD (1 kilogram (kg) = 35 ounces (oz)).
It's important to note that Stableswap pools are designed for these specific types of assets. Trying to use them for things they weren't designed for, like a forex pair (USDC and EURC), is a bad idea and can cause LPs to lose a lot of money. Cryptoswap was created to solve this very problem.
Important Note: Stableswap pools assume the peg is stable. If an asset permanently depegs or is exploited, LPs can incur significant losses as they will be left holding the devalued asset.
How Providing Liquidity Works
How does Stableswap Work?
The magic of Stableswap is its liquidity concentration. Let's visualize a crvUSD/USDC pool where each block represents $1M of liquidity:
In this example most of the pool's liquidity (e.g., $40M out of $80M total) is concentrated in a very tight range around the $1.00 price. Each block represents 1 million tokens (1M) of either crvUSD or USDC.
Swap Example:
- A Stableswap pool has 40M of both crvUSD and USDC, the pool is perfectly balanced, so each asset is $1.
- A user wants to swap $20M USDC for crvUSD:
- The user's 20M USDC is deposited to the pool
- Approx. 19.98M crvUSD is withdrawn
- The price increases to 1.002 USDC per crvUSD
- The pool is now imbalanced, it would only take a user selling 9M USDC to push the price up another 0.002. The imbalance also creates an arbitrage opportunity: traders are now incentivized to swap crvUSD back into the pool to get USDC at a slight discount, which naturally pushes the pool back toward a 50/50 balance.
Cryptoswap Pools
Cryptoswap pools are Curve's solution for trading any pair of assets with volatile or uncorrelated prices. This includes everything from blue-chips like ETH/WBTC to forex pairs like EURC/USDC or a project's native token against ETH.
Unlike Stableswap, the Cryptoswap algorithm does not assume a fixed peg. Instead, its goal is to keep the value of each asset in the pool balanced (e.g., 50% ETH and 50% USDT by value). It achieves this through a novel internal oracle and an automated rebalancing mechanism.
Like their Stableswap counterparts, Cryptoswap pools are fully passive and full-range, making them simple and accessible for all LPs.
How Providing Liquidity Works
How Cryptoswap Works: Concentrating and Rebalancing
At its core, a Cryptoswap pool functions like a Stableswap pool concentrated around the price_scale (center of liquidity). As traders swap back and forth, the pool earns fees.
However, when the market price of the assets drifts significantly, the pool must move its liquidity concentration to match the new price. This is called rebalancing. To ensure this process is always profitable for LPs, it only happens if two conditions are met:
- Adjustment Step: The price must move more than a set minimum amount (e.g., 0.5%). This prevents constant, unnecessary rebalancing in a choppy market. It is set by the
adjustment_stepparameter. - Profitability Check: The pool must have accrued enough trading fees to ensure the recent profits from swaps are more than double the cost of rebalancing. This guarantees that rebalancing doesn't cause a net loss for LPs.
Let's look at a simple USD/EUR forex pool example:
- Liquidity is initially balanced around the price of $1.10, which is also the current price. It looks and functions like a normal Stableswap pool.
- A user swaps USD for EUR, and the EUR/USD price increases to $1.105, because of the slight imbalance. While price stays within Minimum Step range, it will continue functioning like Stableswap.
- Another swap happens, generating more profit for LPs. This increases price to $1.11, outside adjustment step range. A rebalance can now occur, assuming the pool has enough profit to rebalance.
- The pool can use up to half the generated profit from swaps to move to balance liquidity around around the new price of $1.11, automatically.