Coinmerce logo

Coinmerce App

Download

What is a liquidity pool?

Liquidity pools are an essential part of the world of Decentralized Finance (DeFi). Without liquidity pools, many decentralised exchanges (DEXs) would not function properly. Where a traditional exchange depends on a central party to bring buyers and sellers together, liquidity pools fully automate this process on the blockchain.

Instead of traditional order books, DEXs make use of liquidity pools to make transactions possible. This provides a fundamentally different way of trading, whereby users can facilitate the market themselves by adding liquidity. In this article you read what a liquidity pool exactly is, how the underlying technology works and which specific risks and advantages come with it for both traders and investors.

In short

  • A liquidity pool is a collection of cryptocurrencies that is locked in a smart contract.

  • Users who add tokens (Liquidity Providers) receive rewards in the form of transaction fees.

  • Decentralised exchanges use these pools to make trading possible without a traditional order book.

  • Automated Market Makers (AMMs) use algorithms to automatically determine the prices in the pool.

  • Impermanent loss is the most important financial risk for those who provide liquidity to a pool.

What is a liquidity pool?

A liquidity pool is a digital "pool" or vault on the blockchain in which cryptocurrencies are stored. This pool is used to make transactions possible on a decentralised exchange such as Uniswap or PancakeSwap. Instead of buyers and sellers trading directly with each other and having to wait until an order is matched, they trade directly against the reserve in the pool.

Users who place their crypto in a liquidity pool are called liquidity providers (LPs). They make their digital assets available to the market so that others can swap directly. In return for this "lending" of their capital, they receive a fee.

Why do DEXs need liquidity pools?

Decentralised exchanges work without a central authority or intermediary. On a traditional exchange (such as a stock exchange), there are market makers who ensure that there is always supply, but in a decentralised environment that is difficult to coordinate via a classic order book.

Liquidity pools solve this problem by always offering immediately available liquidity. This allows users to buy or sell crypto at any time, regardless of whether there is another individual trader at that exact moment who wants to do the opposite transaction. As long as there are enough tokens in the pool, trading can continue.

How does a liquidity pool work technically?

The foundation of every liquidity pool is the smart contract. This is a piece of programming code on the blockchain that automatically enforces the rules of the pool without a human administrator being involved.

What is an AMM (Automated Market Maker)?

An AMM is the underlying protocol that determines the prices in a liquidity pool without an order book being needed. Instead of looking at what a bidder wants to pay, an AMM uses a mathematical formula to calculate the price of the tokens based on the current ratio in the pool.

The x · y = k formula explained

Most popular AMMs make use of the constant product formula:

x · y = k

Here x and y stand for the quantity of the two different tokens in the pool (for example ETH and USDT). The value k must remain constant. When a trader buys ETH out of the pool (so x becomes smaller), the quantity of USDT (y) in the pool must increase to keep k equal. This ensures that the price of ETH automatically rises as more is bought out of the pool. This mechanism provides a natural price discovery based on the actual demand.

What are LP tokens?

When you add liquidity to a pool, you receive Liquidity Provider tokens (LP tokens) in return. These tokens are unique to the pool and function as a kind of receipt.

They give you the right to:

  • A proportional part of the transaction fees that traders pay to the pool.

  • Your original share in the total liquidity of the pool.

When you decide to stop, you hand in the LP tokens again at the smart contract and receive your original assets back, including the accrued fees.

What is impermanent loss?

Impermanent loss is the most discussed risk for liquidity providers. It occurs when the price ratio of the tokens in the pool changes compared to the moment you put them in.

When does impermanent loss occur?

Because the AMM formula always tries to keep the balance in the pool 50/50 (in value), the algorithm will sell tokens that rise in price and buy tokens that fall in price. If the price of one token in the outside world rises sharply, arbitrageurs keep the pool in balance by buying the cheap tokens out of the pool. As a result, you as a provider are left with less of the rising token.

Calculation example impermanent loss

Suppose you put equal parts of ETH and USDT in a pool.

  • The price of ETH shoots up by 100%.

  • Arbitrageurs buy the now 'cheap' ETH out of the pool until the price in the pool is equal to the global market price again.

  • If you now withdraw your liquidity, you have more USDT but less ETH than you started with.

The bottom line is that the total value can turn out lower than if you had simply left the tokens in your wallet. The loss is called "impermanent" because it is on paper: if the price ratio returns to the level of your deposit, the loss disappears. It only becomes definitive (permanent) at the moment someone takes their tokens out of the pool.

Risks and advantages of liquidity pools

Participation in a liquidity pool is a form of "yield farming" that brings both opportunities and dangers.

Risks:

  • Impermanent loss: As explained above, price volatility can negatively affect your return.

  • Smart contract risk: If there is an error in the code of the pool, hackers can steal the tokens.

  • Slippage: In small pools with little liquidity, a large trade can enormously influence the price, which is disadvantageous for traders.

Advantages:

  • Passive income: You earn a part of every transaction that takes place in the pool.

  • Access to DeFi: It enables you to participate in the decentralised financial ecosystem without the intervention of banks.

  • Market efficiency: Pools ensure that even lesser-known coins can be traded as long as a pool exists for them.

Liquidity pools vs order books

The big difference between a centralised exchange (CEX) and a decentralised exchange (DEX) lies in the execution:

  • Order book (CEX): Works via a "matching engine". A buyer and seller must agree on the price before a transaction takes place.

  • Liquidity pool (DEX): Works via a "liquidity engine". You always trade against a smart contract, regardless of whether there is a direct counterparty.

Frequently asked questions

How safe are crypto liquidity pools?

The safety depends entirely on the quality of the smart contract. Large protocols often have their code audited by security companies, but in the world of DeFi there always remains a technical risk.

Is liquidity the same as profit?

Certainly not. Liquidity is the availability of resources to make a trade possible. Your profit as a liquidity provider is determined by the balance between the earned transaction fees and any impermanent loss.

Getting started with crypto at Coinmerce?

Do you want to learn more about how the crypto market works or do you want to buy cryptocurrencies yourself to build your portfolio? At Coinmerce we offer a safe and regulated platform where you can easily get started. Whether you want to buy Bitcoin for the long term or are interested in the tokens that power DeFi ecosystems: at Coinmerce you buy and sell crypto easily with iDEAL and credit card. Create an account today and discover how all parts of the crypto market come together in one clear app.

Investing has risks. Cryptocurrencies are volatile, you could lose your investment.