How Automated Market Makers Work

Automated market makers replaced order books with a math formula. Here's how the constant product mechanism actually works, what liquidity provision means, and where the system breaks down.
Lewis Jackson
CEO and Founder

Before AMMs existed, trading crypto assets on-chain was genuinely difficult. You needed a counterparty — someone willing to take the other side of your trade at a price you both agreed on. Order book matching works fine on centralised exchanges where you can run fast servers and aggregate lots of market participants. On a blockchain, where every operation is slow and expensive, maintaining an order book is a near-impossible coordination problem.

Automated market makers solved this by removing the counterparty entirely. Instead of matching buyers with sellers, an AMM lets you trade against a pool of funds governed by a formula. No one has to be on the other side. The math handles it.

That's the idea. The mechanism is worth understanding carefully, because it's not quite as clean as it sounds.


The Constant Product Formula

The foundational AMM design — introduced by Uniswap v1 in 2018 and popularised by v2 — is built on one equation:

x · y = k

Where x is the quantity of token A in the pool, y is the quantity of token B, and k is a constant. When you trade, k cannot change (ignoring fees). When you add token A to the pool, the protocol removes token B in proportion — moving along the curve to preserve the product.

Walk through a concrete example. Suppose a pool holds 100 ETH and 200,000 USDC. The constant k is 20,000,000. You want to buy 1 ETH. You're asking the pool to reduce its ETH balance from 100 to 99. For k to stay constant, the USDC balance must rise: 20,000,000 ÷ 99 = 202,020 USDC. So you'd pay approximately 2,020 USDC — not exactly 2,000, because the pool's composition shifts as you trade.

That gap — the difference between the quoted price and the mid-market price — is called price impact. It's not a fee or a rounding error. It's structural. Every trade moves the curve, and large trades move it more. A 0.1% swap barely registers; a 10% swap can be expensive.


What Liquidity Providers Are Actually Doing

The funds in a liquidity pool don't appear from nowhere. They're deposited by liquidity providers (LPs) who receive pool tokens in return — a proportional claim on the pool's assets and any fees it earns.

When you deposit into a pool, you're not making a bet on either asset's price. You're becoming the market. The pool owns your tokens, and you own a share of the pool. If the pool earns fees, your share appreciates. If the pool's composition shifts dramatically because one asset's price moved, your redemption value may differ from what you deposited — even if fee income is positive.

That phenomenon is impermanent loss. The name is a bit misleading — it sounds temporary, but it crystallises whenever you withdraw. The mechanism: if ETH rises sharply relative to USDC, arbitrageurs will buy ETH from the pool until the pool's implied price matches the market. This rebalances the pool away from ETH (which appreciated) and toward USDC. An LP who simply held ETH would have benefited from the price move. An LP who provided liquidity captured fees but ends up holding less of the appreciating asset.

Whether impermanent loss exceeds fee income depends on trading volume, asset volatility, and how long you stay in the pool. There's no universal answer. High-volume, low-volatility pairs (two stablecoins, for example) tend to have favourable dynamics for LPs. High-volatility pairs with lower volume can result in net loss even after fees.


Where Constraints Live

The constant product formula works, but it's capital-inefficient by design. In an x·y=k pool, liquidity exists across the entire price curve from zero to infinity — most of it deployed at price ranges that will never realistically trade. That means a significant fraction of LP capital is sitting idle at any given time, earning nothing.

This is a hard economic constraint, not a design flaw that can be patched. The curve shape creates depth at the current price only if the asset trades near where it was priced when liquidity was deposited.

Different protocols have addressed this in different ways:

  • Curve Finance uses a different formula (the stableswap invariant) optimised for assets that should trade near parity — stablecoins, liquid staking tokens, wrapped assets. It concentrates depth around a tight range by blending the constant-product curve with a constant-sum curve.
  • Uniswap v3 introduced concentrated liquidity — LPs specify a price range where their capital is deployed. Within that range, they earn fees at a much higher rate. Outside it, their liquidity is inactive. The trade-off is active management: as prices move, LPs need to adjust their ranges or accept the liquidity going out of range.
  • Balancer generalised the pool structure to support multiple assets and customisable weightings, rather than fixed 50/50 splits.

Each design is an attempt to improve capital efficiency while preserving the core property — permissionless, trustless trading via a formula.


What's Changing

Concentrated liquidity has become the dominant model for high-activity asset pairs. Uniswap v3's share of DEX volume reflects this shift — active LP management (often via automated range managers) has partially addressed the capital efficiency problem. The trade-off is complexity: passive LPs are more exposed to impermanent loss without careful range management.

A meaningful development is the emergence of singleton pool architectures (like Uniswap v4's hooks system), which allow custom logic to be attached to individual pools — dynamic fees, on-chain limit orders, oracle integration. This is less a paradigm shift than an extensibility upgrade, but it blurs the line between AMMs and more complex execution venues.

There's also growing work on intent-based systems (CoW Protocol, UniswapX) that route trades across AMMs and other sources, sometimes allowing batched settlement that eliminates the price impact users would face in a single pool. These systems sit on top of AMMs rather than replacing them — the AMMs still provide underlying liquidity.


Confirmation Signals

  • AMM-based DEX volume sustaining or growing as a share of total crypto trading volume (on-chain vs centralised)
  • LP profitability data showing fee income exceeding impermanent loss on major pairs over multi-month periods
  • Continued adoption of concentrated liquidity positions by significant LP capital

Invalidation Signals

  • Sustained shift of volume toward fully off-chain systems that settle without on-chain liquidity pools
  • A major exploit of the constant product formula or oracle manipulation that creates bad debt at scale
  • Regulatory prohibition of permissionless liquidity provision in major markets, reducing LP participation and pool depth

Timing Perspective

Now: AMMs are live, functional infrastructure. If you're interacting with DeFi, you're almost certainly routing through them. The mechanisms described here govern your actual swap costs.

Next: Concentrated liquidity management tooling is maturing — automated range managers are reducing the operational burden of active LP positions. Intent-based routing is increasingly abstracting pool selection from the end user.

Later: What the optimal AMM design looks like for low-correlation, cross-chain asset pairs remains an open research problem. Nothing to act on at this stage.


Boundary Statement

This post explains the mechanism. It doesn't constitute advice on providing liquidity, and it doesn't address the tax implications of LP positions in any jurisdiction (which vary significantly and are actively debated).

Understanding how an AMM works is a prerequisite for making informed decisions about using one. The decision itself is outside the scope of this explanation.

Related Posts

See All
Crypto Research
New XRP-Focused Research Defining the “Velocity Threshold” for Global Settlement and Liquidity
A lot of people looking at my recent research have asked the same question: “Surely Ripple already understands all of this. So what does that mean for XRP?” That question is completely valid — and it turns out it’s the right question to ask. This research breaks down why XRP is unlikely to be the internal settlement asset of CBDC shared ledgers or unified bank platforms, and why that doesn’t mean XRP is irrelevant. Instead, it explains where XRP realistically fits in the system banks are actually building: at the seams, where different rulebooks, platforms, and networks still need to connect. Using liquidity math, system design, and real-world settlement mechanics, this piece explains: why most value settles inside venues, not through bridges why XRP’s role is narrower but more precise than most narratives suggest how velocity (refresh interval) determines whether XRP creates scarcity or just throughput and why Ripple’s strategy makes more sense once you stop assuming XRP must be “the core of everything” This isn’t a bullish or bearish take — it’s a structural one. If you want to understand XRP beyond hype and price targets, this is the question you need to grapple with.
Read Now
Crypto Research
The Jackson Liquidity Framework - Announcement
Lewis Jackson Ventures announces the release of the Jackson Liquidity Framework — the first quantitative, regulator-aligned model for liquidity sizing in AMM-based settlement systems, CBDC corridors, and tokenised financial infrastructures. Developed using advanced stochastic simulations and grounded in Basel III and PFMI principles, the framework provides a missing methodology for determining how much liquidity prefunded AMM pools actually require under real-world flow conditions.
Read Now
Crypto Research
Banks, Stablecoins, and Tokenized Assets
In Episode 011 of The Macro, crypto analyst Lewis Jackson unpacks a pivotal week in global finance — one marked by record growth in tokenized assets, expanding stablecoin adoption across emerging markets, and major institutions deepening their blockchain commitments. This research brief summarises Jackson’s key findings, from tokenized deposits to institutional RWA chains and AI-driven compliance, and explains how these developments signal a maturing, multi-rail settlement architecture spanning Ethereum, XRPL, stablecoin networks, and new interoperability layers.Taken together, this episode marks a structural shift toward programmable finance, instant settlement, and tokenized real-world assets at global scale.
Read Now

Related Posts

See All
No items found.
Lewsletter

Weekly notes on what I’m seeing

A personal letter I send straight to your inbox —reflections on crypto, wealth, time and life.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.