What are liquidity pools and how did they solve the main DEX problem?
One of the main concepts in the DeFi segment is liquidity pools. To understand what it is, first of all, you need to know the difference between standard DEX and new DEX and why they have become so popular.
Cryptocurrency and blockchain allow the transfer of control from intermediaries and issuers to private hands, that is, the possibility of decentralization opens up. People did not immediately understand this principle, because before there was no such alternative. It was decentralization that helped the entire cryptocurrency market grow and allocated it to a new segment of the economy.
Centralization in the crypto world
However, there are still big questions about the decentralization of cryptocurrencies. There are opinions that Bitcoin miners from China hold half of the network, and a minority of addresses in various blockchains hold the absolute majority of coins (from 50% to 90%). All this raises questions about the real decentralization of cryptocurrencies.
However, this is insignificant compared to the fact that the crypto world has a huge number of centralized services that store huge reserves of Bitcoin and other cryptocurrencies. First of all, they are centralized exchanges.
To start trading on them, the user transfers funds to their account, and in return receives the convenience of using the trading terminal and other advantages of centralized services. The volume of trade on such exchanges has a share of more than 95%, which is a gigantic value. In return, we get a complete lack of decentralization.
To solve this problem, individual teams and developers began to actively create Decentralized Exchanges (DEX). They completely repeated the interface and prototype of trading operations at centralized exchanges. But, as it turned out, this is not the best solution.
The main problem these exchanges was the lack of liquidity. Users simply did not understand how it works and did not want to trade on such exchanges and did not deposit. As a result, the spreads in the order book (the difference between the closest buy and sell prices) could reach tens of percent. This was especially noticeable in pairs with unpopular assets.
And here the projects decided to resort to the second feature of centralized exchanges - to use market makers to create liquidity. Market makers create orders for both buy and sell, reducing the spread. For this, they profit from a slight difference in rates.
However, this idea also failed to take root. This is due to the fact that the throughput of blockchains is still small, and the network fees exceed the market maker's profit. This was DEX's second bug.
Over time, companies began to realize that standard DEXs could never compete with centralized exchanges. Decentralized exchanges were poorly popular and almost never used by anyone. The teams began to think about what the next generation DEX should be, and soon the answer was found.
They came up with liquidity pools. A liquidity pool is a storehouse where users add their assets to increase market liquidity. This allows for a large stock of assets and little slippage for users which to exchange an asset. The assets are frozen on a special smart contract that conducts exchange operations and protects the pool funds.
Initially, the liquidity pool consisted of two assets that can be exchanged among themselves. When creating a pool, the liquidity provider (who deposits both assets) sets the starting exchange rate. After that, anyone can add assets to this pool to increase liquidity. For this, each liquidity provider will receive a commission for trades of users with this pool.
Each exchange in the liquidity pool results in a movement in the exchange rate. This mechanism is called an automatic market maker (AMM). When making a deal, the volume of coins of the first asset increases, and the volume of the second asset decreases. As a result, the course may change.
There is a pool of ETH / BAT liquidity.
ETH price = $400, BAT = $0.25.
The asset ratio is calculated as 400/0.25 = 1600. It means that one ETH accounts for 1600 BAT. The course is 1/1600.
Then a user comes and wants to buy 400 BAT. At the current rate, he should pay 0.25 ETH ($100). After the purchase, the ratio becomes 1.25 ETH / 1200 WAT, because user adds 0,25 ETH and get 400 BAT from pool. The ratio will become 1/960.
As a result, the exchange rate increased by 67%.
This is the main problem of liquidity pools - with large purchases relative to the volume of the liquidity pool, the rate can change significantly.
However, if the volume of purchases is small, or the volume of the liquidity pool is much greater than the volume of purchases, then the difference will not exceed 0.1%. And this is already very close to the spreads of centralized exchanges.
It may be difficult to understand the first time. In this case, we advise you to carefully re-read our example again.
DEX with liquidity pools
Uniswap was the first exchange to implement this algorithm. It is because of this that it has become so popular now and has overtaken Coinbase by the trading volume.
However, there were also competitors with their own characteristics. Balancer has increased the number of possible assets in the pool from 2 like Uniswap to 8. This allows large asset options to be exchanged so that liquidity providers can earn higher rewards.
Another project is Curve. They immediately realized that trading such assets carries high risks due to the slippage and price volatility of crypto assets. Therefore, they implemented liquidity pools with stablecoins, as a result of which the exchange rate in the pools practically does not change.
All of these decentralized exchanges represent the second generation, which occupies the leading positions in the DEX segment.
Decentralized exchanges have a long history and did not immediately become popular. It took a long time before they came up with a solution to their main problem - little liquidity. Pools were the innovation that breathed life into DEX and helped them compete with centralized exchanges.
We are confident that in the near future there will be many new generation DEXs that will solve slippage problems and become a full-fledged replacement for centralized exchanges. Now we can confidently say that the future of decentralized exchanges lies in pools of liquidity.