What Is an Automated Market Maker (AMM) in Crypto?

ECOS Team 11 min read
What Is an Automated Market Maker (AMM) in Crypto

Introduction

An automated market maker is a mechanism that prices and executes cryptocurrency swaps using rules encoded in software. Many decentralized finance services use it to let traders exchange assets against pooled reserves. No matching sell order needs to arrive for each purchase.

The quote still has a cost. Your trade changes the pool, and a large purchase can become expensive before it finishes. Understanding that movement helps explain both the convenience of an AMM and the risks taken by people who supply its assets.

What Is an Automated Market Maker in Crypto?

An automated market maker uses a pricing rule to determine how much of one asset a trader receives for another. In a typical pool-based system, a smart contract holds the reserves and enforces the exchange. A smart contract is a program running on a blockchain; its rules govern the transaction when it executes.

What Does AMM Stand For?

AMM stands for automated market maker. A traditional market maker posts buy and sell offers, usually using its own capital. An AMM applies programmed exchange rules to available liquidity. The people contributing that liquidity still carry financial risk.

AMMs, Decentralized Exchanges, and Liquidity Pools

A decentralized exchange, or DEX, is the trading venue or protocol. The automated market maker provides its exchange mechanism, while a liquidity pool supplies the assets used for swaps. These terms describe different parts of the system. Some DEXs use order books, and others combine order books with pools.

How Do Automated Market Makers Work?

Three participants make the basic system work. Traders exchange assets. Liquidity providers supply reserves. Arbitrageurs trade price differences between markets, helping pool quotes stay connected to prices elsewhere.

The Role of Liquidity Providers and Pool Reserves

A liquidity provider, usually called an LP, deposits assets under the pool's rules. A conventional two-token, 50/50 pool typically requires equal market values when liquidity is added proportionally. Other designs allow different weights or deposit arrangements.

After each swap, the quantities held by the pool change. The LP owns a claim on a share of those changing reserves, rather than a promise to receive the original quantities back.

How the Constant Product Formula Works: x × y = k

The simplest familiar example follows the constant product formula:

x × y = k

Here, x and y are the reserves of two tokens, and k is their product. Ignoring fees and deposits or withdrawals, a swap preserves that product. Buying one token removes it from the pool, so the trader must add increasing amounts of the other token to continue buying.

The reserve ratio gives the marginal price before fees. It does not guarantee that a whole order executes at that price. Fees also matter: in a standard Uniswap v2-style pool, retained swap fees can increase the actual reserve product over time.

A Simple Token Swap Example

Suppose a hypothetical pool contains 100 units of Token A and 10,000 units of Token B. Its product is 1,000,000, and the starting marginal quote is 100 B for one A. Ignore fees and rounding for this example.

A trader adds 1,000 B. The B reserve becomes 11,000, so the formula leaves about 90.9091 A in the pool. The trader receives roughly 9.0909 A. That works out to an average cost of 110 B per A, despite the initial quote of 100. The ending marginal quote is approximately 121 B per A.

How Arbitrage Helps Align Pool Prices

Suppose A trades more cheaply in this pool than elsewhere. An arbitrageur may buy A from the pool and sell it on another venue. Removing A pushes its pool price upward. This continues while the price difference exceeds fees and execution costs.

The basic formula has no independent knowledge of a fair price. Arbitrage supplies the connection to other markets, but it can be delayed by congestion or expensive transactions. Some other AMM designs also incorporate external price feeds.

Automated Market Makers vs. Order Book Exchanges

Automated Market Makers vs. Order Book Exchanges

In an automated market maker, deposited reserves provide liquidity and a curve determines execution prices. An order book draws liquidity from resting buy and sell orders. A market order consumes those offers at successive price levels; a limit order specifies an acceptable price but may remain unfilled.

With either approach, depth matters. A thin pool produces substantial price impact. A thin order book makes a large order walk through increasingly expensive offers. Neither mechanism creates unlimited liquidity.

Costs differ too. Pool swaps can involve trading fees, network charges, and adverse transaction ordering. Order books involve spreads and trading fees; on-chain versions may also require network fees. Custody depends on the venue's implementation. Using an order book does not automatically mean handing assets to a centralized exchange.

Main Types of Automated Market Makers

Different pool designs suit different markets. The choice affects how much liquidity is available around the current price and what happens when prices move sharply.

Constant Product AMMs

Constant product pools are useful for pairs whose prices can move independently, such as a volatile token against a stablecoin. Their broad price curve is relatively straightforward to understand. However, much of a full-range pool's capital may sit far from the current trading price, reducing capital efficiency.

StableSwap and Weighted Pools

StableSwap concentrates liquidity around the expected relationship between closely priced assets, such as two dollar-pegged stablecoins. Curve's StableSwap design can reduce price impact near that relationship. A severe depeg can break the assumption and leave providers holding more of the weaker token.

Weighted pools allow allocations other than 50/50. Balancer's weighted design supports configurations such as 80/20 and pools containing more than two tokens. This gives providers different asset exposure, though the weights also affect swap pricing. The smaller side of an uneven pool can be expensive to trade against.

Concentrated Liquidity AMMs

Concentrated liquidity lets an LP choose a price interval. Uniswap v3 introduced this approach, which v4 also uses. Capital can support deeper trading within the chosen interval than the same deposit spread across the entire price curve. Once the market leaves that interval, the position stops earning swap fees until it becomes active again. Range management takes attention and may require additional transactions.

How Do Liquidity Providers Earn Fees?

How Do Liquidity Providers Earn Fees?

Fee income comes from actual swaps. An advertised annual percentage is usually an estimate based on assumptions or recent activity. Tomorrow's volume may look very different.

Trading Fees and Liquidity Positions

Eligible LPs earn a portion of swap fees according to their share of active liquidity and the pool's rules. Protocol or other configured charges can reduce the amount reaching them. In concentrated pools, two deposits of equal value can earn different fees because their ranges differ.

A position may be represented by fungible LP tokens or another form of position record. Check what the specific version issues and how withdrawals work.

For a simplified fee calculation, suppose eligible swaps total $10,000 and the LP fee is 0.3%. That produces $30 in LP fees. A provider entitled to 2% of those fees would receive $0.60 before their own transaction costs. This illustration assumes the stated fee reaches LPs and the provider's share stays constant; it is not a forecast of daily earnings.

Why Fee Income Does Not Guarantee a Profit

Assess the entire position: the current value of withdrawable assets, collected fees, and costs of adding, adjusting, or removing liquidity. Compare that result with simply holding the same starting assets. A busy pool may generate fees while its LPs still underperform that holding benchmark. Token price declines can also produce an outright loss in dollar terms.

Benefits and Risks of AMMs

The same pool is a source of execution for a trader and an investment position for an LP. Their risks overlap, but the consequences are different.

Permissionless Trading and Automated Liquidity

Public AMM contracts can make it easier to establish a market without recruiting a traditional market-making firm. Developers can integrate swaps into other applications. Availability still depends on usable liquidity, token restrictions, network operation, and any relevant interface or legal conditions. An accessible contract does not ensure a useful quote.

Price Impact, Slippage, and MEV

Price impact is the price movement caused by your own order. Slippage is the difference between the quoted and executed result, including changes while a transaction is pending. A slippage limit sets the worst execution you agree to accept; setting it higher does not add liquidity.

Maximal extractable value, or MEV, includes gains from transaction ordering. In a sandwich attack, another participant trades before and after your swap to profit from the price movement. Tight execution limits and suitable protected routing can reduce exposure, but do not guarantee protection.

Impermanent Loss and Out-of-Range Positions

Impermanent loss describes an LP position falling behind the value of holding the starting assets as relative prices change. Despite the name, recovery is not assured. Trading fees may offset the difference, or may fall short.

Consider the earlier 50/50 pool if A's external price doubles to 200 B. After arbitrage, and ignoring fees, its reserves would be about 70.71 A and 14,142.14 B. Valued in B, the pool holds roughly 28,284.27. Keeping the original 100 A and 10,000 B outside the pool would instead be worth 30,000 B. The pool gained value, yet lagged holding by approximately 5.72%. That distinction matters when someone describes an LP position as profitable.

An out-of-range concentrated position is also inactive and typically holds only one of the pair's assets. Moving its range can incur costs and alter exposure. The fact that no fees are accruing does not mean market risk has stopped.

Smart Contract, Token, and Depeg Risks

Contract bugs, compromised permissions, and malicious token code can threaten deposited funds. Some tokens impose transfer taxes, restrict sales, or allow an issuer to freeze balances. Stablecoins introduce issuer and depeg risk. A familiar protocol name cannot make an unfamiliar token safe. Additional hooks or integrations create further components to inspect.

Examples of AMM Protocols

Uniswap v2 provides a clear constant-product reference. Uniswap v3 adds concentrated positions. Uniswap v4 retains concentrated liquidity while supporting hooks, optional contracts that customize behavior around pool operations. Those hooks can change fees or other rules, so two v4 pools can behave differently.

Curve StableSwap-NG targets stablecoins and assets expected to trade near a defined relationship. Curve also has CryptoSwap implementations for volatile assets; describing every Curve pool as a stablecoin pool would be misleading.

Balancer v3 Weighted Pools support custom asset weights and multiple tokens. Its other pool types use different pricing mechanisms. Compare the individual pool's design and deployed contracts, rather than treating an entire protocol as one uniform product.

What to Check Before Using an AMM

Verify the network, token addresses, and exact pool version first. Then inspect the quote for your intended trade size. Total pool value alone can hide limited liquidity near the current price.

Before signing, check:

  • The minimum output, trading fee, and estimated network cost.
  • The permission requested by the spender contract, including any spending limit.
  • For an LP position, the price range, fee entitlement, and withdrawal process.
  • Any hook, administrator control, or external service on which the pool depends.

Key Takeaways

  • An automated market maker applies trading rules to available liquidity.
  • Reserve changes affect execution prices; large orders can be costly.
  • StableSwap, weighted, and concentrated designs behave differently.
  • LP fees depend on activity and eligibility, while capital remains at risk.
  • A protocol name is insufficient to evaluate a particular pool.

Expert Insight

Chainlink's educational guide What Are Automated Market Makers (AMMs)? explains that users “trade directly through the AMM.” The practical consequence is worth keeping in mind: a submitted swap depends on the pool's rules and available liquidity, so the quoted result deserves inspection before signing.

Conclusion

Start with one question: what happens to the assets when a swap executes? Once that is clear, inspect the pool's pricing rule, usable liquidity, and permissions. Treat liquidity provision as exposure to changing assets with uncertain fee income, rather than a savings product with a predictable return.

FAQ

What is an automated market maker in simple terms?

It is a mechanism that quotes and executes swaps using programmed rules. In a typical pool-based AMM, traders exchange tokens against reserves supplied by liquidity providers.

Is every decentralized exchange an AMM?

No. A DEX can use an order book, AMM pools, or a combination. The exchange and its trading mechanism are related concepts, not synonyms.

Do all AMMs use the same formula?

No. Constant product, StableSwap, weighted, and concentrated liquidity designs have different pricing behavior. The individual pool and protocol version matter.

Can liquidity providers lose money despite earning fees?

Yes. Asset price changes, impermanent loss, transaction costs, or contract failures can outweigh fees. Fee income alone is not a measure of overall profit.

Have traffic?

Earn with the best product in cloud mining

Become a partner
15%

First purchase

On every new user’s first purchase. No limit on the purchase amount.

5%

Repeat purchases

Earn for life from every repeat purchase. When the user buys again, you earn again.