Liquidity pool diagram two tokens swapping in AMM visualization
1344×768 · AVIF · CC BY 4.0

A diagram illustrates a two-token liquidity pool in an Automated Market Maker (AMM), depicting the swap process between them.
About this subject
Automated Market Makers (AMMs) revolutionized decentralized exchanges (DEXs) by replacing traditional order books with liquidity pools. In these pools, two tokens are deposited in proportions that define their relative price, following a mathematical formula like x * y = k, where x and y represent the reserves of each token and k is a constant. When a user performs a swap, they add one token to the pool and withdraw the other, altering the reserves and consequently the price. This model ensures continuous liquidity, even for low-volume trading pairs, and underpins protocols like Uniswap and SushiSwap.
A typical two-token liquidity pool diagram visually illustrates the swap mechanism: token A is inserted on one side, and token B is withdrawn on the other. The reserve proportions determine the exchange rate, which adjusts automatically based on supply and demand. This system, known as a bonding curve, helps avoid slippage in volatile markets, although liquidity providers still face the risk of impermanent loss.
The popularity of AMMs has grown exponentially since 2020, driven by the decentralized finance (DeFi) boom. According to DeFi Llama, the total value locked in liquidity pools exceeded $50 billion in 2021. Visualizations like this diagram are essential for educating new users on how decentralized exchanges work, highlighting the transparency and autonomy provided by blockchain technology.
Interestingly, the x * y = k formula was inspired by prediction market concepts and adapted by Hayden Adams, creator of Uniswap, in 2018. Since then, variations like Balancer's multi-token weighted pools and Curve's stablecoin-focused pools have expanded possibilities. The two-token liquidity pool diagram remains the most didactic representation of this innovative financial mechanism.
Frequently Asked Questions
What is a liquidity pool in an AMM?
A liquidity pool is a collection of funds locked in a smart contract, containing two or more tokens. It provides liquidity for users to swap tokens directly, without needing a traditional counterparty.
How does the x * y = k formula work?
The x * y = k formula ensures that the product of the two token reserves remains constant after each swap. When one token is added, the other is withdrawn in a proportion that keeps k unchanged, automatically adjusting the price.
What is impermanent loss?
Impermanent loss is a temporary loss that liquidity providers may experience when the relative price of tokens in the pool deviates from the external market. It becomes permanent if the provider withdraws funds during this divergence.
Direct URL
https://pub-c7d6a6ea828543ac903a74a341ccb2e1.r2.dev/imagens/liquidity-pool-diagram-two-tokens-swapping-in-amm-visualization-documentary-photography-bright-midday-sun.avifHow to credit
Include a visible link back to UtilizAí. Copy one of the snippets below:
<a href="https://xn--utiliza-eza.com/en/midia/imagens/liquidity-pool-diagram-two-tokens-swapping-in-amm-visualization-documentary-photography-bright-midday-sun">Liquidity pool diagram two tokens swapping in AMM visualization</a> by <a href="https://xn--utiliza-eza.com">UtilizAí</a>, licensed under <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
[Liquidity pool diagram two tokens swapping in AMM visualization](https://xn--utiliza-eza.com/en/midia/imagens/liquidity-pool-diagram-two-tokens-swapping-in-amm-visualization-documentary-photography-bright-midday-sun) by [UtilizAí](https://xn--utiliza-eza.com), CC BY 4.0
License: CC-BY-4.0
Tags
Related images
Stablecoin minting interface showing collateralization ratio
Stablecoin minting interface showing collateralization ratio
Stablecoin minting interface showing collateralization ratio
Stablecoin minting interface showing collateralization ratio
Stablecoin minting interface showing collateralization ratio
Stablecoin minting interface showing collateralization ratio