AMMs

Liquidity in Ambient is provided through an automated market maker (AMM) mechanism. Unlike traditional limit order books (LOBs) liquidity is not provided by individual orders, but an aggregate pool of liquidity with capital provided by liquidity providers (LPs).

Each liquidity pool in Ambient represents a two-sided market between a pair of fungible assets or tokens. At any given time, each pool has a single exchange rate determined by the ratio of virtual reserves committed to the pool. End users can swap one token in this pair for the other based on a deterministic formula.

Ambient pools use a constant product market maker (CPMM) algorithm. The product of the two sides of the virtual reserves will stay constant regardless of the size or direction of the swap. (Excepting fees and collected and concentrated liquidity bumps.) When a swapper sends a quantity of base token to the pool, the pool returns a quantity of quote tokens based on this constant product relationship. Hence the pool's exchange rate will move to raise the exchange rate of quote tokens relative to base tokens.

This mechanism balances supply and demand by re-adjusting prices proportional to the size and direction of swaps. Because of this swappers do not receive the instantaneous exchange rate, but a slightly worse price depending how large their trade is relative to the liquidity in the pool. This difference is called price impact.

In addition swappers pay a liquidity fee proportional to the amount of notional they traded. Liquidity fees are re-distributed to LPs based on their pro-rata contribution to active liquidity in the pool. The fee rate varies based on the specific pool and may be adjusted depending on market conditions, but is typically in the range of 0-1%.

Last updated