Uncategorized

AMMs Explained: How Automated Market Makers Price Tokens

Amms
Email :102

Most people first encounter decentralized finance through a simple swap on Uniswap or a similar platform. They select one token, confirm the transaction, and receive another — nearly instantly, without any visible counterparty. What makes this possible is the Automated Market Maker, or AMM. Understanding how these systems price tokens reveals why decentralized exchanges have grown into multi-billion dollar infrastructures — and why they behave so differently from the stock exchanges most people are familiar with.

This guide walks through the mechanics of AMMs from the ground up. You’ll learn what they actually do under the hood, how the math determines prices, what trade-offs every liquidity provider accepts, and which protocols dominate the space as of early 2025.


What Are Automated Market Makers?

An Automated Market Maker is a decentralized trading protocol that uses mathematical formulas — rather than traditional order books — to determine the price of token pairs. In a conventional exchange, buyers and sellers submit limit orders at various price levels. The exchange matches these orders when a buyer’s maximum price meets a seller’s minimum price. This is called an order book model, and it requires active participants on both sides of every trade.

AMMs eliminate the need for counterparties altogether. Instead of matching a buyer with a seller, trades occur against a liquidity pool — a smart contract holding reserves of two (or more) tokens. When you swap Token A for Token B, you’re effectively trading with the pool itself, not with another person. The pool’s algorithm adjusts the price automatically based on how much of each token remains in reserve after your trade.

This design provides continuous liquidity without requiring anyone to actively manage orders. The first major AMM, Bancor, launched in 2017, but the model gained mainstream adoption with Uniswap’s 2018 debut. By mid-2024, Uniswap processed over $150 billion in monthly trading volume, surpassing most traditional stock exchanges in activity.

The key insight is that AMMs don’t need human market makers. The mathematical formula governing the pool does the work automatically — hence “automated” market maker.


How AMMs Work: Liquidity Pools and the Constant Product Formula

The heart of most AMMs is a concept called constant product, popularized by Uniswap’s model and expressed as:

x × y = k

In this formula, x represents the quantity of Token A in the pool, y represents the quantity of Token B, and k is a constant that never changes during a trade. When you swap Token A for Token B, the protocol calculates how many tokens of each type to add or remove from the pool such that the product of the two reserves always equals k.

Here’s why this matters for pricing. If someone buys a large amount of Token A from the pool, the supply of Token A decreases while Token B increases. Because x × y must always equal k, the protocol automatically raises the price of Token A (fewer tokens available means higher price) and lowers the price of Token B (more tokens available means lower price). The price shifts happen instantly — there’s no auction, no bid-ask spread negotiation, just the algorithm doing its job.

This is different from how prices move in traditional markets. In an order book, price moves discretely as individual orders get filled. In an AMM, price moves continuously along a curve — every trade causes a price adjustment, no matter how small. This is why the constant product formula generates what’s called a constant product market maker (CPMM) — the price curve is smooth, not stepped.

The “k” constant represents the total liquidity in the pool. When liquidity providers (LPs) add tokens to a pool, they increase both x and y proportionally, which increases k. This added liquidity makes the price curve flatter, meaning larger trades cause smaller price impacts. When LPs remove liquidity, k decreases, making prices more volatile for the same trade size.


How AMMs Price Tokens: A Concrete Example

Numbers make this concrete. Imagine a Uniswap pool containing 10,000 USDC and 100 ETH. The constant k equals 10,000 × 100 = 1,000,000. The current implicit price is 10,000 USDC per ETH (100 ETH would trade for 10,000 USDC in aggregate).

Now suppose a trader wants to buy 10 ETH from this pool. The pool must have exactly 10 ETH remaining after the trade. Using the constant product formula:

After the trade: x₂ × 10 = 1,000,000
x₂ = 1,000,000 / 10 = 100,000 USDC

So the pool now holds 100,000 USDC and 10 ETH. The trader sent 100,000 USDC to the pool and received 10 ETH. But here’s the critical point: the trader did not pay the original price of 10,000 USDC per ETH. They paid an average price of 10,000 USDC per ETH only because they bought a relatively small fraction of the pool’s reserves.

To see the price impact, calculate what happens for the next incremental ETH. With only 10 ETH remaining, the next ETH would cost:

Price of next ETH = 1,000,000 / 10 = 100,000 USDC

The price doubled from 10,000 to 100,000 USDC per ETH — simply because the pool was depleted of ETH relative to USDC. This illustrates the core tension in AMM design: the constant product formula ensures infinite liquidity only in theory, but in practice, prices move dramatically as you trade larger and larger portions of a pool’s reserves.

The difference between the expected price (based on pool balance before the trade) and the actual execution price is called slippage. In the example above, the slippage was massive because the trade was enormous relative to pool size. In real trading, slippage typically ranges from 0.1% to several percent depending on pool depth and trade size.


Types of AMM Models

Not all AMMs use the constant product formula. Different mathematical models suit different use cases, and understanding the trade-offs helps explain why the DeFi ecosystem has fragmented into specialized protocols.

Constant Product (CPMM) — Used by Uniswap (V2 and V3), SushiSwap, and most general-purpose DEXs. The x × y = k formula provides infinite price range and works for any token pair, but suffers from price impact on large trades. Best for volatile token pairs where extreme price ranges are necessary.

Constant Sum (CSMM) — Used primarily in stablecoin swaps, particularly by Curve Finance. The formula is x + y = k, which creates a flat price curve — zero price impact regardless of trade size, as long as both assets remain in the pool. This works well for assets designed to maintain parity (like USDC and USDT), but becomes dangerous if the assets diverge significantly, as the pool can be drained completely.

Constant Mean (CMM) — Used by Balancer, this generalized formula allows pools with more than two tokens and weighted allocations. A pool could hold 50% ETH, 30% BTC, and 20% DAI, and the constant mean formula applies accordingly. This enables sophisticated portfolio strategies and rebanking, but introduces complexity in pricing calculations.

Hybrid Models — Curve’s StableSwap combines constant product and constant sum to create a hybrid that behaves like a constant sum near the target price (minimizing slippage for correlated assets) but transitions to constant product behavior at extreme prices (preventing pool drainage). This innovation, introduced in Curve’s whitepaper, is why stablecoin swapping on Curve often offers better rates than Uniswap.

The choice of AMM model shapes user experience. For most users, understanding which model applies to their trade matters less than checking the pool’s total value locked (TVL) before executing a large swap.


Slippage, Impermanent Loss, and Liquidity Provider Rewards

Three concepts define the AMM experience for liquidity providers. Understanding them is essential before committing funds to any pool.

Slippage is the difference between the expected price of a trade and the actual execution price. It increases with trade size relative to pool depth. Most DEX interfaces display expected slippage before confirmation, allowing users to adjust trade sizes or accept the variance. A 0.5% slippage tolerance means your trade will execute even if price moves up to 0.5% worse than expected, but will revert if it moves beyond that threshold.

Impermanent loss is more subtle and often misunderstood. When you provide liquidity to a constant product pool, you’re exposed to the relative price change between the two tokens. If Token A rises in value relative to Token B significantly enough that people arbitrage the pool, your LP position ends up with more of the lower-value token and less of the higher-value token than if you had simply held both tokens in your wallet. This is called impermanent because it only becomes permanent when you withdraw — if the price ratio returns to its original state, the loss disappears.

To compensate for this risk, LPs earn a share of the trading fees collected from every swap. On Uniswap V3, the fee tier is typically 0.3% per swap (though 0.05% and 1% tiers exist for stablepairs and exotic pairs respectively). If trading volume is high enough, these fees can outweigh impermanent loss, making LP positions profitable overall. However, there’s no guarantee — in extreme trending markets where one asset appreciates steadily against another, impermanent loss can exceed fee revenue.

Liquidity provider rewards also include protocol tokens from liquidity mining programs. Uniswap, Curve, and Balancer have all distributed native tokens to LPs at various points, adding a speculative yield component on top of swap fees. These programs shift over time, and the APY (annual percentage yield) fluctuates based on token price and total emissions.


Major AMM Protocols in 2025

The AMM landscape has consolidated around several dominant protocols, each optimized for different use cases.

Uniswap remains the highest-volume decentralized exchange, with V3 concentrating liquidity within custom price ranges. LPs can concentrate their capital around specific price ranges, dramatically increasing capital efficiency compared to V2’s uniform distribution. As of early 2025, Uniswap has processed over $1 trillion in cumulative volume since launch, though exact figures vary by data source.

Curve Finance dominates stablecoin and wrapped asset trading. Its hybrid AMM design minimizes slippage for correlated assets, making it the default venue for swapping between USDC, USDT, DAI, FRAX, and similar tokens. Curve’s pools also serve as lending collateral and yield farm bases, creating tight integration with the broader DeFi ecosystem.

Balancer offers multi-token pools with customizable weights, enabling portfolio management strategies that no other major AMM supports. Its V3 upgrade introduces concentrated liquidity similar to Uniswap V3 while maintaining the multi-asset pool flexibility that distinguishes the protocol.

DODO pioneered a proactive market maker (PMM) algorithm that uses price oracles to reduce slippage closer to the order book model. While smaller in total volume than the three above, DODO’s approach demonstrates that innovation in AMM design continues.


Risks of Using AMMs

No honest treatment of AMMs omits the significant risks. The technology is powerful but comes with failure modes that traditional finance largely avoids.

Smart contract risk is the most fundamental. Every pool is a piece of code, and code contains bugs. The largest AMM hacks have resulted from vulnerabilities in router contracts, factory contracts, or flash loan interactions. Even audited protocols have suffered exploits — Wormhole lost $320 million in 2022 through a signature verification bug. Users must accept that their funds are only as secure as the underlying code.

Impermanent loss remains a trap for inexperienced LPs. Offering liquidity to a volatile token pair during a bull run can result in holding less value than if the tokens had sat in a wallet. The fees mitigate this risk in many scenarios, but not all. LPing is not “free yield” — it’s a sophisticated trading strategy with its own risk profile.

Rug pulls and malicious pools target users who trade through unknown or newly-launched pools. Scammers create token pairs with fake volume, attract victims through airdrop promotions or social media hype, then drain the pool through large swaps or by manipulating the token’s metadata. Always verify pool age, check whether the token has verified audits, and prefer established protocols for significant trades.

Regulatory uncertainty adds a layer of non-technical risk. The SEC and other regulators have increasingly scrutinized DeFi protocols, and some AMM designs may run afoul of securities laws depending on how tokens are classified. This is an evolving situation where the rules aren’t settled.


Conclusion

AMMs have fundamentally rewritten the rules of market making. By replacing human counterparties with deterministic algorithms, they’ve enabled anyone with an internet connection to provide liquidity and execute trades — no exchange account, no identity verification, no permission required. The constant product formula, for all its simplicity, creates a self-regulating pricing mechanism that responds to supply and demand without any central authority.

But the model isn’t magic. Slippage, impermanent loss, and smart contract vulnerabilities are real costs that every user bears. The most sophisticated DeFi participants don’t just swap tokens — they understand how the pricing curves behave, which protocols optimize for which assets, and when the AMM model advantages or disadvantages them compared to alternatives.

As the space matures, the AMMs themselves continue evolving. Concentrated liquidity, hybrid pricing models, and oracle integration are pushing the technology toward the capital efficiency of traditional order books while retaining the permissionless accessibility that made DeFi compelling from the start. Whether this evolution ultimately replaces conventional exchanges or settles into a complementary niche is a question that only the next few years of market dynamics will answer.

img

Established author with demonstrable expertise and years of professional writing experience. Background includes formal journalism training and collaboration with reputable organizations. Upholds strict editorial standards and fact-based reporting.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts