Home » AMM

AMM

« Back to Glossary Index

An automated market maker (AMM) is a system that provides liquidity to the decentralized exchange (DEX) it operates in through automated trading. The AMM powers decentralized exchanges and completely negates the need for centralized exchanges and their related market-making abilities.

Users can simply trade directly from non-custodial wallets. The protocols use smart contracts to provide liquidity and define the price of various assets. So, instead of trading against counterparties, the users trade against the liquidity locked inside smart contracts called liquidity pools. 

Uniswap is an automated liquidity protocol powered by a constant product formula and implemented in a system of non-upgradeable smart contracts on the Ethereum blockchain. It obviates the need for trusted intermediaries, prioritizing decentralization, censorship resistance, and security. Uniswap is open-source software licensed under the GPL.

Each Uniswap smart contract, or pair, manages a liquidity pool made up of reserves of two ERC-20 tokens.

Anyone can become a liquidity provider (LP) for a pool by depositing an equivalent value of each underlying token in return for pool tokens. These tokens track pro-rata LP shares of the total reserves, and can be redeemed for the underlying assets at any time.

(Uniswap documentation)

Trading pairs exist as individual liquidity pools in AMMs. Anyone can provide liquidity to these pools by depositing the assets represented in the pool. The ratio of the assets in the pool is based on a predetermined equation. For example, Uniswap and many protocols use the x*y=k equation to set the assets in the pool.

Pairs act as automated market makers, standing ready to accept one token for the other as long as the “constant product” formula is preserved. This formula, most simply expressed as x * y = k, states that trades must not change the product (k) of a pair’s reserve balances (x and y). Because k remains unchanged from the reference frame of a trade, it is often referred to as the invariant. This formula has the desirable property that larger trades (relative to reserves) execute at exponentially worse rates than smaller ones.

In practice, Uniswap applies a 0.30% fee to trades, which is added to reserves. As a result, each trade actually increases k. This functions as a payout to LPs, which is realized when they burn their pool tokens to withdraw their portion of total reserves. In the future, this fee may be reduced to 0.25%, with the remaining 0.05% withheld as a protocol-wide charge.

Because the relative price of the two pair assets can only be changed through trading, divergences between the Uniswap price and external prices create arbitrage opportunities. This mechanism ensures that Uniswap prices always trend toward the market-clearing price.

See the detailed explanation about how Uniswap works, here.


« Back to Glossary Index
Scroll to Top