Automated Market Maker (AMM)
Mecanismo de exchange descentralizada que substitui o livro de ofertas por pools de liquidez e uma fórmula matemática para precificar trocas.
Key points
- An automated market maker, or AMM, is a decentralized exchange protocol that lets you swap assets without an intermediary and without an order book.
- The price does not come from matched buyers and sellers, but from a formula applied to the reserves of a liquidity pool funded by users.
- Liquidity providers earn a share of trading fees, but take on impermanent loss when the prices of the pool's assets diverge.
What is an AMM?
An automated market maker is a subset of decentralized exchange (DEX) protocols. Instead of matching buy and sell orders in an order book, it lets you trade digital assets against a shared fund, the liquidity pool, using a mathematical formula to set the price of each swap. Trading happens directly between the user's wallet and the smart contract.
How it works
The best-known model uses the constant product formula. A pool holds two assets, and the product of the quantities of each one stays constant with every swap. When someone buys one of the assets, its quantity in the pool falls and the other rises, which pushes up the price of the asset bought. This way the price adjusts itself, with no human counterparty.
Pools are funded by liquidity providers, who deposit both assets in proportion and receive, in exchange, a fraction of the fees charged on each operation. The greater the pool's liquidity, the smaller the impact of an order on the price, meaning lower slippage.
All the logic runs in public, auditable smart contracts. This removes the custodial intermediary, but shifts the risk to the correctness of the code and to the pool's economic behavior.
There are variations on the basic formula. Pools aimed at similarly priced assets, such as two stablecoins, use curves that concentrate liquidity around parity and reduce slippage in that range. Other models allow different weights between assets or concentrate liquidity in price ranges defined by the provider.
Why it matters
AMMs enabled much of the liquidity in decentralized finance (DeFi) and made it possible to trade assets with little presence on centralized exchanges. For a desk that needs to convert between stablecoins or access niche tokens, the AMM is an always-available settlement infrastructure, with no trading hours.
Risks and limitations
The main economic risk is impermanent loss: when the relative price of the pool's assets changes, the liquidity provider may end up with less value than if they had simply held the assets. On top of that come the risks of smart contract failure, low-liquidity pools with high slippage, and attacks that exploit the pricing formula.