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.