An automated market maker (AMM) is an automated trading mechanism used by many decentralized exchanges (DEXs), commonly implemented through smart contracts and liquidity pools rather than matching buyer and seller orders. The AMM is the trading mechanism, not the exchange itself: some DEXs instead use order books. It enables token swaps against pooled assets without requiring a matching counterparty order for each trade.
How Pool Swaps Work
In a typical automated market maker, liquidity providers (LPs) deposit tokens into a pool managed by smart contracts. A trader supplies one token to the pool and receives another. The pricing rule determines the output based on the trade size and the pool’s balances, with applicable fees included in the calculation. The swap changes those balances, affecting the terms available for subsequent trades. An order book instead records buy and sell orders that can be matched when their terms are compatible.
Trading often allows open participation and is not tied to exchange business hours, but it depends on the pool and network operating. Access conditions and the degree of decentralization differ across implementations.
How AMM Pricing Works
A constant-product automated market maker uses the relationship x × y = k, where x and y represent the reserves of two tokens. During a swap in this simplified, fee-free model, k remains constant: removing some of one token requires adding enough of the other to preserve the product. Buying a token from the pool reduces its reserve and makes subsequent purchases more expensive under this model. Fees retained in the pool, as well as liquidity additions or withdrawals, can change k.
When a pool’s price differs from prices elsewhere, arbitrageurs can buy in the cheaper market and sell in the more expensive one. Their trades help move the pool’s price toward external market prices, although transaction costs and network conditions can leave differences. Other AMM designs use different pricing rules, so the constant-product relationship is an illustration rather than a universal definition.
Advertisement — FinchTrade.
FinchTrade services
Get startedLiquidity and Trade Execution
Trade size matters relative to the liquidity usable at the relevant prices. Larger trades relative to that liquidity generally cause greater price impact, while deeper usable liquidity generally reduces it for a comparable trade. Price impact is the trade’s own effect on the pool price. Slippage is the difference between the quoted and executed outcome, which can arise when pool conditions change before confirmation. A quote may already account for the trade’s expected price impact.
Traders also need to account for swap fees and any network transaction fees when assessing execution costs. Automated availability does not guarantee sufficient liquidity or execution at a desired price, particularly in thin pools or during rapid market movements.
Liquidity Provider Fees and Risks
Swaps through an automated market maker commonly incur trading fees, a portion of which may be allocated to LPs. Allocations depend on the protocol and each provider’s eligible liquidity contribution; fee rates and protocol deductions vary. Net results depend on trading activity, asset prices and losses, not simply the amount deposited. A larger deposit may increase a provider’s fee share under a given design, but it does not guarantee greater profit.
Impermanent loss is the shortfall in a liquidity position’s value relative to holding the same deposited assets outside the pool when their relative prices change. It arises because trading changes the mix of assets the provider can withdraw. It can occur without an extreme price move, and fee income may not offset it. The label “impermanent” does not promise recovery or prevent a loss from becoming realized on withdrawal.
LPs also retain ordinary token-price risk: their assets can fall in value regardless of how the pool performs relative to holding them. Smart-contract bugs or exploits can cause a separate loss of deposited funds.