What is a Decentralized Exchange (DEX)?

DEXs are a new type of platform that has come to compete with traditional marketplaces. Their particularity is to be pair-to-pair, i.e. they allow direct exchanges between users.

Decentralized exchanges (or DEX) are a particular type of dApp (decentralized application) which allow direct transactions (peer-to-peer) of cryptocurrencies between its users, in a secure way and without intermediaries. They are the decentralized version of marketplaces, directly competing with the biggest players: exchanges like CoinBase, Binance, Kraken, KuCoin etc.

The User Transfers his Funds to the Exchange

The user must be able to transfer his funds to the exchange before being able to exchange them, which implies the cooperation of banks, payment systems, governments, in order to authorize this transaction and secure it. Exchanges are generally required by governments to implement KYC procedures, in order to collect and record information about their customers, as anonymity can encourage tax evasion or the laundering of dirty money.

The user Exchanges His Funds

Second, the exchange provides a marketplace for exchanging user assets for others (cryptocurrencies). To do this, he will choose a pair of assets (for example, if he has BTC and he wants to exchange them for ADA, he can choose the BTC / ADA pair if the exchange offers it), then realize the exchange.

The operation of trading on each pair requires liquidity on it. Simply explained, if you want to trade BTC for ADA, someone has to want to trade ADA for BTC for the trade to happen.

For the most traded pairs, liquidity is sometimes simply provided by users among themselves, via the order book. When “natural” liquidity is not sufficient (on most pairs), it is then ensured by market makers: brokers or investment banks who transmit their buy/sell price in real time. These actors are diverse and varied in their operations (sometimes simple intermediaries for their clients, sometimes financial companies applying a defined market strategy).

User Gets Their Funds Back

Once the exchange is completed, users can withdraw their cryptocurrencies to their wallets. Transactions are usually recorded by exchanges, for legal reasons. They therefore find themselves able to associate a cryptocurrency account address with one of their users, whose KYC information they know.

Exchanges, Towards 2.0 Banks?

This last step is not mandatory, however, because it is possible to leave your funds on the exchange. Some exchanges offer a whole set of financial services in order to offer the user to earn interest thanks to their assets. It is possible, for example, to temporarily lend your cryptocurrencies to traders (who do leverage trading or shorts), or to participate in staking protocols on certain blockchains. Interest is then collected by the platform, which pays part of it to its users.

In addition, the arrival of crypto bank cards, allowing you to pay with your cryptocurrencies (in reality, cryptocurrencies are sold at the time of payment) on the majority of the big players suggests that their strategy would be to position themselves in time as banks.

How a DEX Works

Decentralized exchanges are fundamentally different in their operation, as users exchange funds directly with each other. There is no transfer of funds to the DEX, or from the DEX: it simply connects two users wishing to exchange their funds.

The exchanges are therefore carried out directly from the crypto currency hokk wallets of the users and for all meme token. This feature is fundamental in differentiating from exchanges: it isolates users with some effectiveness from the risks associated with piracy. DEXs therefore represent a much less juicy target for hackers, since there are no funds stored on the servers.

As in any marketplace, DEXs operate with makers and takers. The Maker is the one who creates an offer on the market, either to buy or to sell (for example, “SELL 1 BTC FOR 42 ETH “). The taker is the one who will fulfill this offer (and therefore here, exchange his 42 ETH against 1 BTC).

Exchanges in DEXs are governed by smart contracts, to ensure that the funds arrive in the hands of the various recipients. We trade millions around here, we want to be sure that it doesn’t play the LeBonCoin-style trick opposite.

Each DEX has its own smart contracts. Here is the one from EtherDelta , open source, for example. Let’s take a look at how it works (simplified):

The Maker creates an offer and saves it in the smart contract. He signs this offer with his private key. The maker’s offer and his funds are stored in the smart contract (he can make a request to cancel his order and withdraw his funds).

The Taker chooses the offer and decides to fulfill it. He will also send his order signed by his private key, as well as his funds, to the smart contract.

The smart contract verifies the signatures and verifies that the offer has not expired or has not been fulfilled. If everything is valid, it proceeds with the exchange and sends the respective funds to the maker and the taker, deducting the fees (platform and transaction fees) that have been declared in the orders.

So are DEXs Decentralized?

It is certain that DEXs are more decentralized than traditional exchanges. On the other hand, they do not require the use of KYC to work (in any case, for the moment!), because they do not particularly manage the transfer of funds.

But that does not mean that they are completely decentralized, there are still several points to be addressed that each DEX can approach differently.

DNS Management

While certain domain name protocols are beginning to emerge, the Internet still operates centrally today. Also, when you visit Uniswap.org, be aware that this domain name may be controlled (by the Public Internet Registry, or ICANN, both based in the USA).

The Independence of the DEX

The developers themselves have control over what happens on the platform, so it’s important to see how the project is governed and who decides on integrations. Uniswap, for example, is an open-source project, which is a great point (in case of disagreement with the founder, the project can be forked), and the governance of the project will now be governed by the UNI token holders. But this is not necessarily the case for all DEXs (Binance DEX is not open-source).

Conclusion

Decentralized exchanges are probably the next stage in the evolution of marketplaces. If these concern the world of cryptocurrency, some decentralized marketplaces for other resources are beginning to emerge (we can cite iExec for example for IT and cloud resources).

As everywhere, smart contracts remove the need for a trusted intermediary, which can only be a positive development for the efficiency of society. Now, society must be given time to grasp and take hold of these new concepts.