Liquidity pool diagram two tokens swapping in AMM visualization

1344×768 · AVIF · CC BY 4.0

liquidity pool diagram two tokens swapping in AMM visualization in editorial style

Educational diagram of a liquidity pool in an AMM showing the swap between two tokens, with arrows indicating the transaction flow.

About this subject

In decentralized finance (DeFi), Automated Market Makers (AMMs) have revolutionized how tokens are traded. Unlike traditional exchanges that use order books, AMMs rely on liquidity pools: smart contracts that hold reserves of two or more tokens. The diagram illustrates a two-token liquidity pool, for example ETH and USDC, where a user can swap one for the other. The mechanics are governed by a mathematical formula, such as x * y = k (constant product), ensuring the product of the reserves remains unchanged after each swap. This means that buying one token decreases its reserve in the pool while increasing the other, automatically adjusting the price.

The concept was popularized by Uniswap, launched in 2018 on Ethereum. Since then, it has become the foundation for numerous DeFi protocols, including SushiSwap, PancakeSwap, and Curve Finance. Each pool consists of liquidity providers who deposit token pairs in exchange for transaction fees, typically 0.3% per swap. The diagram visually shows the flow: the user sends Token A to the contract, which calculates the amount of Token B to receive based on the formula, and then delivers Token B to the user. Arrows indicate this movement, highlighting the simplicity and efficiency of the process.

An important nuance is slippage: in pools with low liquidity, swapping large amounts can cause significant price impact. Consequently, many AMMs implement concentrated liquidity pools, like Uniswap V3, allowing providers to allocate liquidity within specific price ranges, optimizing capital efficiency. The diagram, though simplified, faithfully represents the essence of AMMs: decentralization, transparency, and automation. This model is crucial for democratizing access to financial markets, especially in regions with limited banking infrastructure, such as Brazil, where DeFi has been growing rapidly.

Frequently Asked Questions

What is a liquidity pool in DeFi?

It is a smart contract that holds reserves of two or more tokens, allowing users to swap between them without an order book. Liquidity providers deposit tokens into the pool and earn fees from transactions.

How does the constant product formula (x * y = k) work?

This formula ensures that the product of the reserves of the two tokens in the pool remains constant after each swap. Thus, when one token is bought, its reserve decreases and the other increases, automatically adjusting the price.

What is the difference between an AMM and a traditional exchange?

Traditional exchanges use order books where buyers and sellers are matched. AMMs use liquidity pools and mathematical formulas to determine prices, enabling automated and decentralized trading.

Download

Download AVIF

62 KB · 1344×768

Direct URL

https://pub-c7d6a6ea828543ac903a74a341ccb2e1.r2.dev/imagens/liquidity-pool-diagram-two-tokens-swapping-in-amm-visualization-closeup-macro-shot-morning-natural-light.avif

How to credit

Include a visible link back to UtilizAí. Copy one of the snippets below:

HTML
<a href="https://xn--utiliza-eza.com/en/midia/imagens/liquidity-pool-diagram-two-tokens-swapping-in-amm-visualization-closeup-macro-shot-morning-natural-light">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>.
Markdown
[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-closeup-macro-shot-morning-natural-light) by [UtilizAí](https://xn--utiliza-eza.com), CC BY 4.0

License: CC-BY-4.0

Tags

Related images