How Uniswap liquidity pools work

Each pool is a smart contract on the Ethereum blockchain that creates an exchange pair between two ERC-20 tokens.

Therefore Uniswap liquidity pools are token exchange pairs on Ethereum.

At first, once the smart contact is created, the pool actually has no liquidity because it still has no deposits. That is, the balance of each of the two tokens on which it is based is zero.

In order to make it operational, it is necessary that someone Bitcoin Machine deposits funds for both tokens in the smart contract, and this first provider of liquidity is in fact the one who sets the initial price of the pool.

In fact, users are incentivised to deposit a volume of equal value for both tokens, thus establishing an initial exchange rate.

If, for example, the first liquidity provider deposited tokens on the exchange pair in a ratio different from the current market rate, it would immediately create a profitable arbitrage opportunity for other users, who would easily take advantage of it and thus bring the exchange rate back to the market rate.

This rule always applies, so all liquidity providers have an incentive to deposit tokens in proportion to the market exchange rate.

On the contrary, since the latter varies continuously, it is precisely by depositing tokens in a different proportion with respect to the market rate that they can actually be sold or bought.

In fact Uniswap, like many other DEX, does not use an order book to get the price of an asset, or to match buyers and sellers, but instead uses the liquidity pools as explained above.

This, however, means that on Uniswap, for example, it is not possible to create limit orders, i.e. by setting a certain exchange rate for buying or selling, but the exchange takes place spontaneously when the exchange rate differs from the market rate.

Uniswap liquidity pool tokens
In addition, each time liquidity is deposited in a pool, special tokens, known as liquidity tokens, are minted in proportion to the amount of liquidity deposited in the pool. These tokens represent the contribution made to the pool by the liquidity provider (LP), and each time an exchange occurs, a fee of 0.3% is levied from the pool, which is distributed proportionally to all LPs in the pool at the time of the exchange.

To take back the amounts deposited, plus any fees accrued, the LPs must burn the liquidity tokens.

However, these liquidity tokens are also freely exchangeable.

Therefore, the use of Uniswap’s liquidity pools is not particularly difficult, although the concept on which its operation is based is by no means trivial.