New: Explore our latest Web3 innovations.Learn More about Ancilar Web3 services

AMMs and StableSwaps: The Math of DeFi Liquidity Explained

DeFi
2025-11-07
Author:Jyotvir
AMMs and StableSwaps: The Math of DeFi Liquidity Explained

How AMMs price tokens, how StableSwap curves cut stablecoin slippage by 100x, and what DeFi builders must know before deploying production pools in 2025.

Frequently Asked Questions

An Automated Market Maker is a smart-contract protocol that uses a mathematical formula to price assets in a liquidity pool. Instead of matching buyers with sellers via an order book, the AMM adjusts token prices continuously based on the ratio of reserves in the pool. Uniswap v2 introduced the constant-product formula x * y = k, which became the industry baseline.
The StableSwap invariant, introduced by Curve Finance, blends a constant-sum formula near pool equilibrium with a constant-product formula at the extremes. Near the 1:1 parity point, the curve is nearly flat, allowing large stablecoin swaps with minimal price impact. This design reduces average slippage for USDC/USDT-type swaps by roughly 100x compared to a standard constant-product AMM at the same pool depth.
Impermanent loss occurs when the price ratio of two tokens in a pool diverges from the ratio at the time of deposit. The AMM rebalances holdings automatically, leaving the LP with less of the appreciating asset than if they had held both tokens directly. The loss becomes permanent when the LP withdraws. It is largest during high-volatility divergence events and smallest for correlated-price pairs such as USDC and USDT.
The amplification coefficient A controls how flat the pricing curve is near equilibrium. A high A value such as 2000 keeps the exchange rate very close to 1:1 even for large trades, but at the cost of making the pool fragile if a peg breaks. A low A value makes the curve behave more like a standard constant-product AMM, providing wider price tolerance. Curve governance can adjust A through smooth time-locked ramp functions.
Uniswap v3 allows liquidity providers to concentrate capital within a chosen price range rather than distributing it uniformly across the 0-to-infinity curve. Within an active range, a v3 position behaves like a v2 pool with much higher effective depth, improving capital efficiency by up to 4000x for tight ranges. Outside the active range, the position earns no fees and is fully converted to the cheaper token.

Don't Miss What's Next

Subscribe to newsletter

Tags:

DeFi

AMM

DEX

crypto

trading

Get in Touch

Our team will get back to you within 24 hours.

A clear proven process, that delivers

End of Scroll. Start of Discovery.

You've seen our ideas - now go deeper.
Discover more insights, tutorials, and innovations shaping Web3.