Formulas
Last updated
Last updated
Curve Finance utilizes a StableSwap invariant to facilitate efficient stablecoin trading with low slippage. The invariant ensures that the pool remains balanced.
Formula:
Components
A: Amplification coefficient, controlling the sensitivity of the invariant to price changes.
n: Number of tokens in the pool.
x_i: Balance of the iแตสฐ asset in the pool.
D: Total supply of liquidity tokens, representing the combined assets in the pool.
Uniswap V2 operates on the Constant Product Market Maker (CPMM) model, ensuring that the product of the reserves of the two assets remains constant.
Formula:
Components
x: Reserve of Token X in the liquidity pool.
y: Reserve of Token Y in the liquidity pool.
k: Constant product, remains unchanged before and after any trade.
Uniswap V3 introduces Concentrated Liquidity, allowing liquidity providers to allocate their capital within specific price ranges, enhancing capital efficiency.
Formula
The core formula related to liquidity in a given price range is:
Components
L: Liquidity provided within the specified price range.
P_high: Upper price bound of the liquidity range.
P_lowโ: Lower price bound of the liquidity range.