Introduction

A liquidity pool (LP) is a smart contract that contains a reserve of two or more cryptocurrency tokens in a decentralized exchange (DEX). Liquidity pools enable cryptocurrency buyers and sellers to trade tokens on a DEX without needing a centralized order book or traditional market maker. Instead, the smart contract that controls the pool handles all the trading activity. Liquidity is provided by the users of the DEX and are rewarded by receiving a share of all fees earned by the LP. Additional incentives, such as APR bonus can also be provided by the DEX.

How do LPs Work?

Each pool requires two CRC20 tokens. When a pool contract is created, the balances each token are 0; in order for the pool to begin facilitating trades, someone must seed it with an initial deposit of each token. This first liquidity provider is the one who sets the initial price of the pool. They are incentivized to deposit an equal value of both tokens into the pool. When other liquidity providers add to an existing pool, they must deposit pair tokens proportional to the current price.

<aside> 🛠 Example: If I want to create a FRTN/CRO pair, I would have to deposit both tokens into the pool at equal value. [At time of writing, CRO = $0.15 and FRTN = $0.033]. So if I add $100 worth of CRO, I would also need to add $100 worth of FRTN. In this example, I would add roughly ~666 CRO and ~3,030 FRTN to create LP Tokens with a value of ~$200. Our DEX automatically makes this calculation for you.

</aside>

Untitled

Liquidity Pool Tokens

Whenever liquidity is deposited into a pool, unique tokens known as liquidity tokens are minted and sent to the provider's address. These tokens represent a given liquidity provider's contribution to a pool. The proportion of the pool's liquidity provided determines the number of liquidity tokens the provider receives. If the provider is minting a new pool, the number of liquidity tokens they will receive will equal sqrt(x * y), where x and y represent the amount of each token provided.

Whenever a trade occurs, a 0.15% fee is charged to the transaction sender. This fee is distributed pro-rata to all LPs in the pool upon completion of the trade.

To retrieve the underlying liquidity, plus any fees accrued, liquidity providers must "burn" their liquidity tokens, effectively exchanging them for their portion of the liquidity pool, plus the proportional fee allocation. Burning of LP tokens is automatic and happens upon “removing” liquidity from a pool.

Untitled

Liquidity Provider Fees

There is a 0.15% fee for swapping tokens. 0.1% fee is split by liquidity providers proportional to their contribution to liquidity reserves. 0.05% is a protocol fee that also remains in the pool.

Swapping fees are immediately deposited into liquidity reserves. This increases the value of liquidity tokens, functioning as a payout to all liquidity providers proportional to their share of the pool. Fees are collected by burning liquidity tokens to remove a proportional share of the underlying reserves.

Impermanent Loss

Providing liquidity to a pool exposes your assets to certain risks. Impermanent Loss is an effect of the constant changes in the prices of the tokens you provided to a pool. It is a phenomenon with a potentially significant impact on a your portfolio. It refers to the temporary loss of value that occurs when a user provides liquidity to a liquidity pool or yield-farming protocol. This loss is termed ‘impermanent’, as it is only realized if the user withdraws the assets from the pool.

To better understand IL, it is recommended that you take the time to do your own research. Crypto.com provides a basic understanding of IL in the following link: https://crypto.com/university/what-is-impermanent-loss .