Curve API

Curve is a decentralised exchange governed by the Curve DAO, which optimises liquidity utilisation through algorithmically adjusting parameters.

Curve pools modify the x * y = k constant function by using the A parameter to control the concentration of liquidity around the midpoint, and using the gamma parameter to determine the breadth of the curve, making a more efficient use of the pool's liquidity and lowering slippage. Depending on price action and liquidity, the A parameter may ramp up or down over an algorithmically determined timeframe. Dynamic fees are also implemented using the mid_fee, out_fee and fee_gamma parameters, with fees increasing when the pool is imbalanced.

Curve has two main pool types: StableSwap and CryptoSwap. These also come in different pool 'flavours': plain pools, metapools, and lending pools. Unlike Uniswap, Curve pools may contain more than two assets, although a swap is always between two assets.

StableSwap pools are optimised for asset pairings which have stable relative values, such as stablecoins (e.g. USDC-USDT-DAI) or derivatives (e.g. stETH-ETH); StableSwap-NG pools are a new generation of these contracts with some optimisations. CryptoSwap pools are optimised for asset pairings which have volatile relative values (e.g. ETH-CVX).

CryptoSwap V2 contracts improve upon the original V1 contracts; Tricrypto-NG pools are a new generation of the three-token CryptoSwap contracts with some optimisations.

Lending pools contain a wrapped representation of an underlying asset (e.g. aUSDC), which is lent out on decentralised lending markets such as Aave, Compound, or Yearn, enabling liquidity providers to earn interest on coins as well as trading fees and liquidity incentives. The underlying_coin refers to the underlying asset being lent out.

Metapools allow for Curve pool LP tokens to be paired with other assets, combining liquidity from the base pools. For example, by depositing DAI, USDC, and USDT into the 3pool, a liquidity provider receives 3CRV LP tokens. 3CRV can then be paired with GUSD in the gusd3CRV metapool. In this example, the 3pool is considered the base_pool for this metapool, with DAI, USDC, and USDT each being a base_coin.

All Curve pools are associated with an LP token, which users receive upon depositing liquidity. In newer pool implementations, there is a single contract for both the pool and LP token.

Our Toolbox API for Curve provides comprehensive coverage of Pools, Prices, and Tokens to empower traders, liquidity providers, and integrators.

This toolbox covers Curve and all of its forks, cross chain.