Uniswap is a decentralized exchange that works through so-called liquidity pools.
Each pool is a smart contract on the Ethereum blockchain that creates a trading pair between two ERC-20 tokens.
In other words, Uniswap liquidity pools are token trading pairs on the Ethereum blockchain.
At first, once the smart contract 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 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.
Users are incentivized to deposit a volume of equal value for both tokens, thus establishing an initial exchange rate.
If, for example, the first liquidity provider deposits tokens on the trading 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.
Indeed, since the latter varies continuously, it is precisely by depositing tokens in a different proportion to the market rate that they can actually be sold or bought.
In fact Uniswap, like many other DEXs, 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 mentioned above.
However, this means that on Uniswap, for example, it is not possible to create limit orders, i.e. by pre-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 recover 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.