Antlia Media

What are Decentralized Exchanges and How do they Work?

Untitled

Cryptocurrencies are volatile in their market value. And this can make them both very profitable and very risky to invest in. However, the ‘very profitable’ part is enough to entice thousands of crypto users into investing in these currencies. This buying, selling and trading of crypto assets has to be done on specified platforms called exchanges which are basically of two types: centralized and decentralized. 

To understand decentralized exchanges (DEX), it is important to know what centralized exchanges (CEX) first.

Centralized Exchanges (CEX)

Centralized exchanges like Binance allow users to register on their platforms, add funds to their account wallet, and start trading currencies with other users. Users give custody of their funds to the platform and trades are conducted based on the platform’s order book. This means that a user willing to sell an X asset at an Xp price is matched with a user looking to buy that same X asset at that same Xp price. 

These exchanges are efficient, user friendly, and are run by trusted companies. But they have some drawbacks too: they are run by centralized companies who store users’ funds in their own databases. This means that those companies, out of malicious intent or because of some legal issue, can freeze their users’ funds and/or direct them to another location. These centralized entities are also prone to hacks that can result in losses amounting to millions.

It was due to some of these concerns, and the rise of DeFi, that the concept of decentralized exchanges was put forward. 

What are Decentralized Exchanges (DEX)?

Decentralized exchanges are not run by centralized entities, instead they are collectively run by its users on the blockchain with the help of automated processes called smart contracts. In short, decentralized exchanges are platforms that enable users to exchange cryptocurrencies over automated software applications without the need for a centralized authority watching over the whole process.

How are decentralized exchanges different?

Decentralized exchanges differ from their centralized counterparts in multiple ways:

  • They are not run by any centralized authority so the user will not need to have to entrust her funds to any organization, in fact, no user would have to entrust funds to anyone and will keep custody of their own funds at all times. This means that instead of the authority, the user will be responsible for her own funds. 
  • Decentralized exchanges could be faster in the sense that they do not require lengthy processes of registration and authentication etc (which could take days in some cases), but are also slower in their transaction speeds when compared to centralized exchanges (especially if the entire exchange process is happening on chain).

How do Decentralized Exchanges work?

The basic working principle of decentralized exchanges has already been explained: currency exchanges happening on the blockchain, run by automated smart contracts, and managed collectively by its users/nodes on the blockchain. But there are more than one type of decentralized exchanges, and the exact working of the platform depends on its type.

Types of Decentralized Exchanges

At the most basic level, there are three types of decentralized exchanges:

  1. On-Chain Exchanges

These exchanges exist completely on the blockchain. All the stages of the exchange process are conducted on-chain. This makes it very slow. Due to the limited transaction speeds of blockchain (15 TPS in the case of ethereum), users will not be able to see the exchange completed until a miner writes that transaction on a block. Apart from the significant amount of time this takes, the blockchain will also charge a fee for conducting such a transaction completely on chain.

  1. Hybrid Exchanges

A comparatively less decentralized alternative to on-chain exchanges are hybrid exchanges. The order book for these exchanges is stored off-chain on the platform’s own database, and this makes them slightly more centralized. But this also results in better speeds and a more smooth process.

  1. AMM-based Exchanges

A completely different variant of decentralized exchanges is the ones based on Automated Market Makers (AMM). Now AMMs are a complicated tool to understand, but at the most basic level, they are automated determinants of the market price of exchanged assets that don’t require order books. Instead they use liquidity pools to determine the value of each asset. AMMs are also completely decentralized entities and also subscribe to DeFi’s ideal of a trustless financial system.

Conclusion

It is clear from the entire discussion that decentralized exchanges are far from perfect. They have multiple problems: slow transaction speeds due to the limitation of the underlying blockchain technology, less developed UI that makes users reluctant to use DEX platforms, and the possibility of smart contracts/blockchain being compromised and the whole system tumbling down on itself.

But the concept provides unprecedented opportunities for the future. DEX platforms are free from KYC/AML regulations as they never actually take custody of their users’ funds. Also they provide much better security from hacks and malicious intent of the authorities. Decentralized exchanges contribute toward the futuristic concept of a completely decentralized of finance that we here at Antlia are working to achieve. The concept is still in its infancy, and will require a number of improvements before it becomes part of the mainstream crypto market. 

Back to list