# AMM Content type: Glossary Term Summary: Think of an AMM like a vending machine that always has items in stock. Instead of waiting for someone else to agree to buy or sell at your price, you simply trade with the machine. It uses a special math formula to decide the price based on how many items are left, ensuring you can always complete your trade instantly. Key concepts: DeFi, Continuous liquidity availability, Permissionless trading access, Automated price discovery, Risk of impermanent loss, High slippage during large trades, Vulnerable to sandwich attacks Related resources: - Constant Product Formula (Glossary Term): https://theblockchainlibrary.com/glossary/constant-product-formula - DEX (Glossary Term): https://theblockchainlibrary.com/glossary/dex - Liquidity Pool (Glossary Term): https://theblockchainlibrary.com/glossary/liquidity-pool - Slippage (Glossary Term): https://theblockchainlibrary.com/glossary/slippage - Smart Contract (Glossary Term): https://theblockchainlibrary.com/glossary/smart-contract - Smart Contract (Glossary Term): https://theblockchainlibrary.com/glossary/smart-contract - Yield Farming (Glossary Term): https://theblockchainlibrary.com/glossary/yield-farming
DeFiintermediate

AMM

An Automated Market Maker (AMM) is a type of decentralized exchange protocol that relies on a mathematical formula to price assets instead of using a traditional order book. In an AMM, assets are pooled into smart contracts, known as liquidity pools, where traders interact with the pool rather than a counterparty. This infrastructure enables continuous liquidity and automated trade execution, removing the need for intermediaries such as market makers or centralized exchanges in the pricing and settlement process.

Explain Like I'm 12

Think of an AMM like a vending machine that always has items in stock. Instead of waiting for someone else to agree to buy or sell at your price, you simply trade with the machine. It uses a special math formula to decide the price based on how many items are left, ensuring you can always complete your trade instantly.

Why It Matters

AMMs are the foundational building blocks of DeFi, allowing decentralized trading to function without centralized authorities. They enable users to swap tokens permissionlessly and ensure that liquidity is always accessible for various assets.

How It Works

Liquidity providers deposit pairs of tokens into a smart contract vault based on a constant product formula, such as x*y=k. When a trader swaps token A for token B, the contract adjusts the ratio of tokens in the pool, which automatically shifts the price based on the trade size. Arbitrageurs then trade against these pools to keep the price aligned with global market rates.

Real-World Example

Uniswap V2, which uses the constant product formula to facilitate billions in decentralized token swaps.

Advantages

  • Continuous liquidity availability
  • Permissionless trading access
  • Automated price discovery

Limitations

  • Risk of impermanent loss
  • High slippage during large trades
  • Vulnerable to sandwich attacks

Common Misconceptions

  • Many believe AMMs require a centralized entity to set prices.
  • Some think liquidity providers are guaranteed a profit regardless of market conditions.

Knowledge Explorer

Explore This Concept in the Knowledge Graph

See how AMM connects to other concepts, books, research, and developer resources.

Explore Connections

Related Terms

Constant Product Formula

An automated-market-maker invariant commonly expressed as x times y equals k.

DEX

A Decentralized Exchange (DEX) is a peer-to-peer marketplace where users trade cryptocurrencies without an intermediary or central authority. Unlike centralized exchanges (CEXs) that hold user funds and process trades internally, DEXs utilize smart contracts to execute trades directly between wallets. This setup ensures that users maintain custody of their assets until the moment of the trade, promoting censorship resistance and financial sovereignty.

Liquidity Pool

A liquidity pool is a crowdsourced collection of digital assets locked in a smart contract to facilitate decentralized trading and lending. Unlike traditional order books where buyers and sellers must be matched, liquidity pools use Automated Market Makers (AMMs) to enable permissionless exchange. By pooling funds, the protocol ensures that there is always a counterparty available for trades, maintaining market depth even for less popular tokens and reducing reliance on centralized intermediaries.

Slippage

Slippage is the difference between the expected price of a trade and the price at which the trade is actually executed. It commonly occurs in decentralized exchanges during periods of high volatility or when the trade size is large relative to the liquidity pool's total depth. When a large order is placed, it pushes the asset price significantly along the curve of the automated market maker, leading to a less favorable execution price for the trader.

Smart Contract

A smart contract is a self-executing program stored on a blockchain that automatically runs when predetermined conditions are met. These contracts eliminate the need for intermediaries by encoding terms directly into lines of code, ensuring that the agreement is enforced exactly as written without human interference. Because they reside on an immutable ledger, the execution results are verifiable, transparent, and impossible to tamper with once deployed.

Smart Contract

A self-executing program stored on a blockchain that automatically enforces and executes the terms of an agreement when predetermined conditions are met. Smart contracts are deterministic, immutable once deployed, and form the backbone of decentralized applications.

Yield Farming

Yield farming is a decentralized finance (DeFi) mechanism wherein users provide liquidity to a protocol by locking their cryptocurrency assets into smart contracts. In exchange for supplying these assets, which are utilized for purposes such as trading pairs, lending, or borrowing, users receive rewards, typically in the form of platform-native governance tokens or a share of transaction fees. This process incentivizes liquidity provision, ensuring that decentralized exchanges and lending markets have sufficient depth to operate efficiently while allowing participants to earn passive income on their held assets.