If you have ever swapped tokens on Uniswap, PancakeSwap, or Curve, you have already used an Automated Market Maker (AMM), even if you never noticed the term. AMMs are not a brand-new concept, but they are the backbone of most decentralized exchanges (DEXs) operating today.
This article explains AMMs from the ground up. It covers how they work, why they matter, and the key risks you should understand before using them.
What is an Automated Market Maker (AMM)?
Automated Market Maker (AMM) is a type of smart contract on a blockchain that uses an algorithm to calculate token prices at the moment a user executes a trade. Because pricing is handled by a predefined formula, AMMs do not rely on an order book or a mechanism that matches buyers and sellers.
Instead, they operate through liquidity pools, where users deposit tokens to provide liquidity. When a trade occurs, the AMM calculates the price based on the token ratio inside the pool and returns an equivalent amount of another token to the user. This trading process is commonly referred to as a swap.
In simple terms, users trade directly with a liquidity pool rather than with another person. The pool is always available, operates 24/7, and token prices automatically adjust as supply and demand within the pool change.

What did Crypto Trading look like before AMMs?
On centralized exchanges (CEXs), the order book model works effectively because it relies on a centralized infrastructure that manages order matching and trade execution in real time. This controlled environment provides low latency, stable liquidity, and a consistent trading experience, making order books well suited for assets with high and continuous demand.
However, when this same model is deployed on fully on-chain decentralized exchanges (DEXs), those conditions no longer exist. Without a centralized execution layer, liquidity fragments quickly, especially for smaller tokens that cannot sustain constant order placement.
AMMs emerged in response by replacing order matching with liquidity pools, enabling continuous, non-custodial, and permissionless trading and forming the architectural foundation of DeFi.

How Does an AMM Work?
Liquidity Pool (LP)
Every AMM is built around a liquidity pool, which is a smart contract that holds two or more tokens, depending on the predefined trading pair. Each pool is configured with specific tokens, and liquidity is supplied in such a way that the total value of each token in the pool is equal at the time of deposit. Anyone can contribute tokens to the pool and become a Liquidity Provider (LP), earning a share of trading fees generated by swaps executed through that pool.
For example, in an ETH/USDC trading pair, the liquidity pool contains only ETH and USDC. If the price of ETH is $1,000, a pool holding 10 ETH must also hold 10,000 USDC, so that the total value of both assets remains balanced within the pool.
The Formula
The most common AMM model uses the Constant Product Market Maker (CPMM) formula:
x × y = k
- x is the amount of token A in the pool.
- y is the amount of token B in the pool.
- k is a constant that remains unchanged before and after each trade.
Let’s say when you swap token B for token A in the pool, this means:
- You buy token A and take it from the pool. The amount of token A decreases, so its price goes up.
- At the same time, you add token B to the pool, increasing its supply and pushing its price down.
This mechanism ensures the pool always has liquidity, even when prices move. This is the formula used by Uniswap V2 and became the foundation for most AMMs that followed.

Example
Imagine a pool that contains 10 ETH and 10,000 USDC. The constant k equals 10 × 10,000, which is 100,000.
You want to buy 1 ETH. The pool must keep k at 100,000, so after the trade:
- The pool has 9 ETH left.
- The required USDC amount becomes 100,000 ÷ 9 ≈ 11,111 USDC.
You effectively pay about 1,111 USDC for 1 ETH instead of 1,000 USDC at a fixed price.
The price moves upward because removing ETH changes the pool ratio, which changes the price. This is called slippage, and it becomes larger when your trade size is big relative to the pool size.
The role of Arbitrageurs
A key question is how AMM prices stay close to the broader market if they are set by an internal formula.
The answer lies with arbitrageurs. If ETH trades at $2,000 on Binance but only $1,950 in a Uniswap pool, an arbitrageur will buy cheap ETH from Uniswap and sell it on Binance for a profit. This action pushes the pool price back toward the market price.
Arbitrageurs are not bad actors. They are essential for AMMs to function properly. However, their profits often come from LPs, and this is one of the sources of impermanent loss, discussed later.

The Evolution of AMMs
AMMs evolved through several generations, each solving a different core problem in decentralized trading. Below is a timeline that highlights the key milestones.
2017: The Beginning with Bancor
AMMs were first implemented in practice when Bancor launched on Ethereum. Bancor used its native BNT token as an intermediary, meaning all tokens were connected through BNT rather than direct trading pairs. To trade ETH for USDC on-chain, a user would first swap ETH to BNT, then BNT to USDC.
This model ensured liquidity availability for supported tokens and reduced the need for multiple direct pools. However, it required two swaps per trade, leading to higher fees, greater slippage, and lower capital efficiency compared to later AMM designs.
2018: Uniswap V1 simplifies AMMs
When Uniswap V1 launched in 2018, adoption was gradual rather than explosive. Early usage came mainly from developers, token issuers, and DeFi-native users experimenting with permissionless on-chain liquidity. Trading volume was modest at first, but the model proved reliable: swaps always executed, pools were easy to create, and liquidity was transparently visible on-chain.
As more ERC-20 tokens chose Uniswap as their primary liquidity venue, network effects began to form. By 2019, Uniswap had become a default building block for DeFi applications, setting the stage for the sharp volume growth and broader community attention that followed in later versions.
2020: Expansion and Stablecoin optimization
In 2020, Uniswap V2 introduced a major upgrade by allowing any two ERC-20 tokens to be paired directly, without routing through ETH. This reduced costs and improved the trading experience.
At the same time, Curve Finance launched with an AMM formula optimized specifically for stablecoins. It significantly reduced slippage when swapping assets with similar values such as USDC, DAI, and USDT.
Balancer also expanded the AMM concept by enabling multi-token pools with custom weightings, laying the groundwork for on-chain portfolio and index-style products.
2021: A Breakthrough In Capital Efficiency With Uniswap V3
In 2021, Uniswap V3 marked a major breakthrough in AMM design with the introduction of concentrated liquidity. By allowing LPs to allocate capital within specific price ranges instead of across the entire curve, the protocol dramatically improved capital efficiency and reduced idle liquidity. This change made Uniswap significantly more competitive with traditional market-making models, especially for highly traded pairs.
As a result, Uniswap V3 quickly gained recognition across the DeFi ecosystem. Professional LPs and institutions adopted the model to deploy capital more precisely, while other AMM protocols began experimenting with similar designs or building directly on top of V3’s architecture.
Although the need for active position management increased complexity for LPs, concentrated liquidity became a new standard for capital-efficient on-chain trading and reshaped how AMMs were designed going forward.
2025: AMMs Become Programmable Liquidity Platforms
On January 31, 2025, Uniswap V4 officially launched with Hooks, allowing developers to attach custom smart contract logic to pools. This enables features such as dynamic fees, custom AMM curves, and auto-compounding. The singleton contract architecture also reduces gas costs and supports native ETH.
Examples of exploited AMMs underscore persistent DeFi risks, including GMX V1 losing $40M to a re-entrancy flaw in GLP pools, ALEX Protocol suffering an $8.3M vault-permission exploit, and Abracadabra losing $1.8M via a flash-loan attack in 2025.
According to CoinLaw, by July 2025, Uniswap V4 reached $1B in TVL in just 177 days, faster than V3. This shows how quickly the market is adopting the next generation of AMMs.

Risks Of AMMs
AMMs offer opportunities, but they also carry real risks. Understanding these risks is essential before participating.
Impermanent Loss
Impermanent loss is one of the largest and most misunderstood risks in AMMs, but it only applies to liquidity providers, not regular traders. It occurs when the relative prices of assets in a liquidity pool change after liquidity has been deposited. As prices diverge, the pool rebalances automatically, creating a growing gap between the value of providing liquidity and simply holding the assets.
For example, consider an ETH/USDT 50/50 pool with a total value of 100,000 USDT (50 ETH and 50,000 USDT). A liquidity provider deposits 10 ETH and 10,000 USDT, representing 20% of the pool.
If ETH’s price moves significantly relative to USDT, the LP’s asset composition shifts due to rebalancing, resulting in impermanent loss compared to holding the original assets outside the pool.
To understand how impermanent loss works in detail and why it becomes permanent in practice, read the full breakdown below.
Read more: How to Reduce Impermanent Loss in Crypto

Slippage
Slippage refers to the difference between the expected price of a trade and the actual execution price after the swap is completed. In AMM-based DEXs, slippage occurs because prices are determined by a mathematical formula that reacts to changes in pool balances.
When you execute a large trade in a relatively small liquidity pool, the swap itself shifts the token ratio inside the pool, causing the execution price to move away from the quoted price. The larger the trade is relative to the pool size, the more the price curve is pushed, and the higher the slippage becomes.
For example, assume an ETH/USDC pool where ETH is priced at $1,000 and the pool contains 10 ETH and 10,000 USDC. If a user swaps a small amount, such as 0.1 ETH, the price impact is minimal.
However, swapping 5 ETH would significantly change the pool balance, resulting in a much worse average execution price and a noticeable slippage percentage.
Smart Contract Risk
AMMs rely entirely on smart contracts. If a bug or vulnerability exists, funds in the pool can be exploited. Even heavily audited protocols like Uniswap are never completely risk-free.
Examples of AMM exploits show how subtle mathematical issues can escalate into severe losses. In November 2025, Balancer V2 suffered a $128M exploit caused by a rounding error in its pool mathematics, allowing attackers to extract value by repeatedly exploiting precision mismatches during swaps.
We’re aware of a potential exploit impacting Balancer v2 pools.
— Balancer (@Balancer) November 3, 2025
Our engineering and security teams are investigating with high priority.
We’ll share verified updates and next steps as soon as we have more information.
Others
Beyond slippage and smart contract risk, AMMs introduce additional execution and user-level risks. On networks like Ethereum mainnet, MEV bots can front-run or sandwich AMM transactions by buying before a user’s swap, pushing the price up, and selling back at a higher level. This behavior increases effective trading costs and is one reason newer designs such as Uniswap V4 explore MEV-aware mechanisms like Hooks.
At the same time, because AMMs allow permissionless listing, any token can be created and traded without approval. This makes it easy for fake or misleading tokens with similar names and symbols to appear alongside legitimate ones. If users do not carefully verify contract addresses, they may unintentionally trade the wrong asset, a risk that is especially common during meme token launches.
Tokens with identical or near-identical names may represent entirely different contracts, making contract verification essential when trading on AMMs.
Tips to reduce risks when using AMMs
- Choose low-volatility pairs: Stablecoin pools such as USDC and DAI have near-zero impermanent loss because their prices stay closely aligned. This is why Curve Finance remains one of the most popular AMMs for liquidity providers.
- Choose pools with high trading volume: Higher trading volume means more fees collected, which can help offset impermanent loss. ETH and USDC pools on Uniswap often process billions in daily volume, generating meaningful returns for LPs.
- Use concentrated liquidity carefully: Uniswap V3 and V4 allow LPs to define specific price ranges. Narrower ranges can generate higher fees but also increase the risk of going out of range, so careful balance is required.
- Use dynamic fee pools: Uniswap V4 Hooks enable fees to adjust automatically based on market volatility. Higher fees during volatile periods help compensate LPs for increased price risk.
- Impermanent loss insurance: Bancor V2 previously introduced an insurance mechanism by allocating 15% of trading fees to cover LP losses, highlighting one approach to mitigating impermanent loss in AMMs.
Conclusion
AMMs have come a long way, from early concepts discussed by Vitalik Buterin on Reddit, to Bancor’s first implementation, to Uniswap setting the industry standard, and now to concentrated liquidity and programmable pools with Hooks.
According to TradeSanta, with over $50B in TVL directly tied to AMMs, DEX volume accounting for 20% of global spot trading, and 14.2M active DeFi wallets as of mid-2025, AMMs are clearly not a temporary trend.
That said, caution is still necessary. Impermanent loss is real, smart contract risks remain, and providing liquidity does not guarantee profit. Understanding the mechanics, choosing the right pools, and managing risk are the foundations of sustainable participation in AMMs.
FAQs
Q1: Are AMMs suitable for beginners in DeFi?
AMMs are beginner-friendly in terms of usage because they do not require understanding order books or complex order types. However, providing liquidity responsibly still requires understanding risks such as slippage and impermanent loss.
Q2: Why do AMMs allow small tokens to be traded?
AMMs do not require buyers and sellers to meet like order books. As long as a liquidity pool exists, tokens can be swapped at any time, even with low volume or small communities.
Q3: How are trading fees distributed in AMMs?
Every trade generates fees that are distributed to Liquidity Providers based on their share of the pool. These fees are the main mechanism used to offset impermanent loss over time.
Q4: Can AMMs fully replace centralized exchanges?
AMMs excel at decentralized liquidity, but CEXs still outperform in speed, user experience, and advanced trading tools. In practice, both models complement each other rather than compete directly.
Q5: Why is concentrated liquidity both attractive and risky?
Concentrated liquidity allows LPs to use capital more efficiently and earn higher fees within narrow price ranges. However, if prices move outside that range, LPs may stop earning fees and must actively rebalance.
Q6: What is the future focus of AMMs?
The main direction is programmability and adaptability. Models like programmable AMMs with Hooks show a shift from fixed formulas toward flexible, intelligent liquidity infrastructure.