CEX and DEX place in web3 world

Bored Founder
Sebastian Strzałkowski
July 21, 2022

In this article, we will look at centralized exchange, decentralized exchange, and some concepts related to them. We will learn how a decentralized exchange works and what mechanics it provides, how it differs from a centralized exchange, and how it works.

Centralized Exchange (CEX)

This is the place we can recommend to trade cryptocurrencies. In this case, the exchange is managed by a single entity, and exchange orders can be executed only from the interface issued by the entity managing it. In addition to the graphical interface, exchanges often provide program APIs. To use such an exchange, you need to have a user account. In addition, in order to avoid limitations, most of the CE will ask you to undergo a KYC (Know Your Customer) system check. In this step you most often provide personal data for verification which is required by security and tax regulations. .. These procedures are also aimed at weeding out potential money laundering attempts. In centralized exchanges, there is a standard order book where sellers build a wall of supply and buyers build a wall of demand by issuing their orders. Operations do not go to the blockchain and all the cryptocurrencies are held by the exchange.


Decentralized Exchange (DEX)

Compared to a centralized exchange, a decentralized exchange has a single available trading system (in the case of cryptocurrencies, it is a contract), to which each of us can create our interface and use it in any way we want. In addition, these exchanges are mostly open-source and thus we know how the written contract can behave. The main difference between this and the previous solution is that on decentralized exchanges we do not have a typical order book. Instead, a liquidity pool is used. Any user who wants to provide more liquidity on a given trading pair can add value/assets(?) to the liquidity pool. The entire operation takes place on the network on which the exchange is released. Transactions are made between users who want to swap their cryptocurrencies and the liquidity pool. As a result, we get tokens in our wallets.


Liquidity pool

A liquidity pool is a mechanism used in decentralized exchanges to provide liquidity for trading on a given token pair. Providers of this type of liquidity can be:

  • projects
  • institutions
  • private individuals.

They are called liquidity providers.

To simplify the concept of liquidity pool let's imagine two bags of tokens (a pair of tokens).  wants to exchange his tokens, he puts the A token he wants to swap/exchange into the A bag and takes the B token out of the B bag in the ratio of number_of_tokensA/quantity_of_tokensB.

Liquidity provider

A liquidity provider is a person or entity that provides liquidity (enough supply) for a pair of tokens. Thanks to such people decentralized exchanges have enough liquidity and we can make transactions virtually instantaneously. Liquidity providers, depending on the exchange, get tokens from the transactions. In the case of Uniswap, it's a 0.3% fee from transactions, and from this, they calculate their share of the pot. In return for providing liquidity, we get the token of the pair calculated quantity_tokensA x quantity_tokensB.

Yield farming

Some exchanges or projects offer additional benefits in exchange for providing liquidity. One method of rewarding users is yield farming. Basically, we make the liquidity token, which we got when we provided liquidity to our pair, available for a specially prepared contract. As a result of locking these tokens, you are additionally rewarded. The reward depends on the project and the exchange, most often we receive tokens of the project that we secure.


It is a mechanism for blocking tokens to receive rewards. From the user's perspective, staking allows us to increase our commitment to the project and in return receive even more tokens we gave to the contract.
From the project developer's perspective, it is a way to reduce the number of tokens that circulate and are traded in the network. In addition, through staking, one is given access to additional materials, features, or actions available only to those users who have blocked a certain amount of tokens. Staking can occur on both decentralized and centralized exchanges