What are Automated Market Makers (AMMs) and what role do they play within DeFi?

What are Automated Market Makers

What are Automated Market Makers (AMMs)?

Automated Market Makers (AMMs) are algorithmic mechanisms that enable decentralized trading (without the involvement of traditional market makers) in digital assets (cryptocurrencies). AMMs are widely used within DeFi systems, such as DEXs.

AMMs automatically determine prices through mathematical formulas based on supply and demand within a liquidity pool, making the use of order books unnecessary. This prevents buyers and sellers from having to be directly matched. Normally, this role is fulfilled by market makers or an exchange that provides liquidity in a trading pair. Within DeFi, AMMs fulfill this role because network users provide liquidity via liquidity pools, while the pricing mechanism operates fully automatically.


Key Takeaways

  • Automated Market Makers (AMMs) enable decentralized trading without order books or traditional market makers.
  • AMMs automatically determine prices through mathematical formulas based on token ratios within a liquidity pool.
  • Liquidity is provided by users (liquidity providers), while arbitrage traders correct price discrepancies with external markets.
  • AMMs offer continuous liquidity and transparency but involve risks such as impermanent loss, smart contract risk, and price deviations.
  • AMMs are particularly suitable for decentralized markets and less liquid trading pairs, while order books are more efficient at high liquidity levels.

How does an Automated Market Maker (AMM) work?

Automated Market Makers (AMMs) operate using liquidity pools and smart contracts. A liquidity pool is a place where two or more tokens are deposited by users of a DEX. In principle, the ratio within such a pool is evenly distributed by users, but active trading can cause imbalances in the available liquidity per token.

Here, the AMM plays a key role by automatically adjusting prices through an algorithm based on the token ratio in the pool, ensuring market liquidity remains functional and users can continue trading a pair with fast execution and efficient order handling. When a user buys or sells a token, the ratio in the pool changes. The algorithm then automatically adjusts the price to restore equilibrium. This creates price dynamics without the need for active market makers.

Smart contracts play a central role within AMMs: they manage liquidity pools, automatically execute transactions, and determine token prices based on predefined mathematical formulas. When users add liquidity or trade tokens, the smart contract ensures the correct amounts are transferred, trading fees are calculated and distributed to liquidity providers, and all transactions follow fixed rules. Because these processes occur fully on-chain and are automated, AMMs are transparent, predictable, and independent of centralized parties.

A commonly used formula in AMMs to determine prices is the constant product model:

x · y = k

Example:
Suppose there is a liquidity pool for the ETH/USDC trading pair containing 100 ETH and 200,000 USDC. The price of 1 ETH in this pool is therefore 2,000 USDC. The constant product (k) in this case is:

100 · 200,000 = 20,000,000

When a user buys 1 ETH with USDC, USDC is added to the pool and ETH is removed from the pool. This changes the ratio between ETH and USDC. The algorithm ensures that the product of both token amounts remains equal to k by automatically adjusting the price.

After the transaction, the pool may contain 99 ETH and approximately 202,000 USDC. Because there is less ETH and more USDC in the pool, the price of ETH increases. In this way, the AMM automatically determines a new market price based on supply and demand, without the need for active market makers.

When the price in an AMM deviates from the market price on other platforms, an arbitrage opportunity arises. Arbitrage traders exploit this by buying tokens where they are cheap and selling them where they are more expensive. Within DeFi, these are usually automated bots or professional traders who continuously compare prices across different DEXs and CEXs. Through these arbitrage activities, the correct token flows back into the liquidity pool, causing the AMM price to move back toward the market price and restoring balance in the pool.

The difference between an AMM and a DEX

An AMM is a price discovery mechanism that DEXs can use. A DEX (Decentralized Exchange) is a decentralized trading platform where tokens can be traded and that operates on top of a blockchain, such as Ethereum or Solana.

In other words:

  • A DEX is the infrastructure.
  • An AMM is one possible way trading is facilitated within that infrastructure.

Some DEXs use AMMs (such as Uniswap), while other DEXs operate with order books (such as dYdX).

Liquidity pools

Another important component of many DEXs is liquidity pools. A liquidity pool works hand in hand with an AMM, as liquidity pools provide liquidity via liquidity providers (LPs), while AMMs are responsible for price discovery. This results in a system where traditional market makers are not required to set prices or provide liquidity. However, this also involves risks, such as impermanent loss.

Automated Market Maker vs order book

AMMs and order books are both ways to organize the execution of buy and sell orders, but each operates differently. In a traditional order book, buy and sell orders are collected and recorded based on price and time. For an order book to function properly, it must be sufficiently populated on both sides and requires high market activity to remain efficient.

Market makers are employed to ensure sufficient liquidity. Low liquidity makes it harder to trade quickly and efficiently, especially during periods of low trading activity. This is why you often see lower liquidity in more volatile markets, such as smaller altcoins. Market makers take on more risk and often demand higher spreads to compensate for that risk.

An AMM works differently. Within an AMM, orders are not visible in an order book, and prices are continuously determined by an algorithm regardless of trading volume. As a result, an AMM is less dependent on active traders and traditional market makers.

In short, order books are generally more efficient in markets with high liquidity, while AMMs perform better in decentralized and less liquid environments.

Risks of Automated Market Makers (AMMs)

There are also risks associated with using Automated Market Makers (AMMs) that should be taken into account.

Impermanent loss
Liquidity providers face the risk of impermanent loss when token prices in a liquidity pool change significantly relative to the external market. When this happens, the value of the deposited tokens may be lower than if the tokens had simply been held in a wallet. This loss in value is referred to as impermanent loss. It is not a security risk, but an economic risk where value can be lost.

Smart contract risk
AMMs operate entirely through smart contracts. This involves risk, as bugs in the code or vulnerabilities can lead to exploits and loss of funds. Audits can help mitigate these risks by reviewing smart contracts for known vulnerabilities, but a certain level of technical risk always remains.

Price manipulation at low liquidity
Liquidity pools with low liquidity, such as those for smaller tokens, can be relatively easily influenced by large players (so-called whales). By executing large transactions, they can cause sharp price movements and high slippage, from which they may profit, while other traders may be left holding unfavorable or significantly devalued tokens.

Dependence on arbitrage
AMMs rely on arbitrage traders to correct price differences with external markets. When arbitrage is temporarily absent, for example due to high transaction fees or network congestion, prices in the AMM can deviate from the market price for extended periods.

Front-running and MEV
Because blockchain transactions are public before they are confirmed, bots can front-run transactions (front-running) or reorder them to extract profit through Maximal Extractable Value (MEV). This can result in higher costs, additional slippage, and worse execution prices for users.

Volatility of underlying assets
AMMs are sensitive to strong price movements of the tokens in the pool. High volatility increases the likelihood of impermanent loss and can reduce the attractiveness of liquidity provision for liquidity providers.

Advantages of Automated Market Makers (AMMs)

  • Continuous liquidity
    Trading is possible as long as liquidity is available in the pool, regardless of the number of active buyers or sellers.
  • Decentralization
    AMMs operate fully on-chain via smart contracts, without reliance on a central party or centralized market makers.
  • Accessibility
    Anyone can provide liquidity by adding tokens to a liquidity pool, without special permission or professional infrastructure.
  • Transparency
    All rules, prices, and transactions are recorded in public smart contracts and can be verified by anyone.
  • Automation
    Price discovery and order execution are fully automated through algorithms, making active market makers unnecessary.

Disadvantages of Automated Market Makers (AMMs)

  • Impermanent loss for liquidity providers
    During strong price changes relative to the external market, liquidity providers may achieve lower returns than if they had held their tokens.
  • Capital inefficiency
    Compared to order books, more capital is often required to achieve comparable liquidity and price precision, especially for larger trades.
  • Price deviations from external markets
    AMM prices can temporarily deviate from the broader market, particularly during periods of low liquidity or high volatility.
  • Dependence on arbitrage
    The return to market prices depends on arbitrage traders, which can lead to additional costs and faster value shifts within liquidity pools.
  • Use of smart contracts
    The use of smart contracts carries the risk that vulnerabilities or bugs in the code can be exploited, potentially leading to loss of funds.

Final thoughts

Automated Market Makers are a fundamental part of the DeFi ecosystem and have significantly changed the way digital assets are traded. By using liquidity pools and smart contracts, AMMs enable decentralized trading without reliance on order books or traditional market makers. This provides continuous liquidity, transparency, and broad accessibility for users worldwide.

At the same time, AMMs also come with specific disadvantages and risks. Liquidity providers are exposed to impermanent loss, prices can temporarily deviate from external markets, and the system depends on arbitrage traders to restore balance. In addition, smart contract risks and market volatility are important considerations for both traders and liquidity providers.

AMMs are particularly suitable for decentralized environments and trading pairs with lower liquidity, where traditional order books are less efficient. For users who understand the underlying mechanisms and risks, AMMs offer powerful opportunities to trade and generate returns within DeFi.

About Finst

Finst is a leading cryptocurrency platform in the Netherlands, providing ultra-low trading fees, institutional-grade security, and a comprehensive suite of crypto services such as trading, custody, staking, and fiat on/off-ramp. Finst, founded by DEGIRO's ex-core team, is authorized as a crypto-asset service provider under MiCAR by the Dutch Authority for Financial Markets (AFM) and serves both retail and institutional clients in 30 European countries.

The crypto platform you'll love

We are here to give you the tools, inspiration, and support you need to become a better investor.

Sign up