Encyclopedia DeFi · Entry 49
Automated market makers: trading against a programmed inventory
In this article
At a glance
Key facts
The pool is the counterparty inventory
In a two-token AMM, buyers do not need a particular seller’s matching order at the moment of a swap. A contract exchanges against inventory deposited earlier. The rule limits how much of one token can leave for a given amount of the other.
Liquidity providers own claims on the resulting inventory. They do not simply lend unchanged piles of both assets: trading changes the composition of what their claims represent.
A curve describes a trade-off
For a fee-free constant-product pool, x times y stays constant during a swap. If reserves begin at 100 A and 1,000 B, adding 10 A leaves 110 A and about 909.091 B, so the output is about 90.909 B. The starting reserve ratio of 10 B per A would have implied 100 B if the whole trade could happen at that marginal rate.
This difference follows from consuming inventory along the curve. A larger pool at the same starting ratio moves less for the same input. The calculation is an idealized illustration, not a quote from a live market.
How the pool relates to outside prices
A pool’s balances do not automatically know an external market price. Traders who can buy on one venue and sell on another can move pool prices toward outside prices. Fees, costs and execution risk can leave differences.
Other AMM rules allocate liquidity differently. A v3 position supplies a price interval and stops participating once the price is outside that interval. Apply the formula for the actual version instead of treating every pool as the full-range example.
Direct answers
Questions people ask
Does an AMM guarantee that every trade is possible?
No. Available liquidity, allowed tokens, contract checks and the trader’s limits constrain execution. Concentrated pools can have price ranges with no active liquidity.
Inspect the evidence
The answer and key facts have stable claim links. These records retain the scope and qualification when reused.
An automated market maker, or AMM, quotes exchanges using a programmed rule and available inventory. Liquidity providers supply that inventory. A constant-product pool is one AMM design; concentrated ranges and other curves behave differently, so “AMM” does not identify a single pricing formula.
Scope: DeFi. Verification: verified · 2026-10-02T15:08:18.373Z.
Link to this claimInventory: Swaps change the quantities of the two tokens in a v2 pair.
Scope: DeFi. Verification: verified · 2026-10-02T15:08:18.373Z.
Link to this claimPrice: The next quote depends on the new reserve balances.
Scope: DeFi. Verification: verified · 2026-10-02T15:08:18.373Z.
Link to this claimVariation: Uniswap v3 concentrates liquidity inside chosen ranges.
Scope: DeFi. Verification: verified · 2026-10-02T15:08:18.373Z.
Link to this claimRevision history
- — First publication after primary-source research and independent automated verification.
On the Understand a swap path · Learn next: Constant-product pools: deriving the output from x times y
Source register
Sources and references
Retrieval dates and locators are recorded individually.- Uniswap v2 pair sourceUniswap
Reserve accounting, LP shares, fee-adjusted invariant and optional protocol fee.
Locator: mint; burn; swap; _mintFee · Version / scope: v2-core v1.0.1 · Retrieved: 2026-10-02Open source - Introducing Uniswap v3Uniswap Labs
Range-based liquidity, inactive positions and position-specific accounting.
Locator: Concentrated Liquidity; Active Liquidity; Non-Fungible Liquidity · Version / scope: 2021-03-23 announcement · Retrieved: 2026-10-02Open source - Uniswap v2 pricingUniswap
Reserve-dependent quotes, trade bounds and external price observations.
Locator: Pricing Trades; Exact Input; Exact Output · Version / scope: Uniswap v2 · Retrieved: 2026-10-02Open source
Research and drafting use AI assistance. A separate automated review checks claims against primary sources; no external expert or named human review is implied. Publication, substantive editing, source retrieval and verification are recorded separately. This version was independently checked by an automated reviewer on 2 October 2026.
Editorial method and correctionsDegrees of Satoshi editorial project. “Automated market makers: trading against a programmed inventory.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/automated-market-makers/