Although Centralized Exchanges (CEXs) have the possibility of large trades with plenty of liquidity, it is still risky because users do not have ownership of their assets in exchanges. There are a lot of examples of leaked login information and stolen cryptocurrencies in these days. Decentralized Exchanges (DEXs) decrease such risks by using of smart contracts and on-chain transactions to reduce or eliminate the need for an intermediary.
There are two types of DEXs as follow:
1.Order book-based DEXs.
Order book DEXs like dYdX and dex blue operate similarly to CEXs in which users can buy and sell at either their chosen limit prices or at market prices while the main difference is that for CEXs, assets for the trade would be held on the exchange wallet whereas for DEXs, assets for trade can be held on users own wallets. The most important problem of this type of DEXs is that users may have to wait a long time for their orders to be filled in the order book because of liquidity. To solve this issue, liquidity pools-based DEXs were introduced.
2.Liquidity pool-based DEXs
Liquidity pools are essentially reserves of tokens in smart contracts and tokens can instantly be bought or sold from the available tokens in the liquidity pool. The prices are determined algorithmically and increases for large trades. We can share DEXs liquidity pools across multiple DEX platforms and this pushes up the available liquidity on any single platform. Kyber Network, Bancor, and Uniswap are some examples of liquidity pools-based DEXs.