Decentralized Exchange

Will be going through in detail what exactly are DEX's and what role they play when it comes to the web3 world.

We briefly talked about Decentralized exchanges when we covered the section about Centralized exchanges, here we will go in depth and give you much more detail about how it actually works. Decentralized exchanges are peer-to-peer marketplaces where cryptocurrency traders make transactions directly without handing over management of their funds to an intermediary. These transactions are facilitated through the use of self-executing agreements written in code called smart contracts.

Decentralized exchanges were created to remove the requirement for any authority to oversee authorize trades performed in a specific exchange. These peer-to-peer exchanges refers to a marketplace that links buyers and sellers of cryptocurrencies. These are usually non-custodial, which means that the users keep control of their wallets private key's.

Your private key is a type of advanced encryption that enables the users to access their cryptocurrencies.

Users are immediately able to access their cryptocurrencies once they log into the DEX using their private key.

Decentralized exchanges use smart contracts to allow traders the ability to execute certain orders without the need for a intermediary. Where as centralized exchanges are actually managed by a centralized organization/company like a bank that is involved in financial services looking to make profits. Traders guard their funds and are held responsible if they make a mistake like forgetting their private keys or sending funds to the wrong address, that puts their assets or security at risk.

The customers' deposited funds or assets are issued an "i owe you" (IOU) by decentralized exchange portals, which can be freely traded on the network. An IOU is basically a blockchain based token that has the same value as the underlying asset.

The most popular and well know decentralized exchanges are built on top of blockchains that support smart contracts and where the users have full custody of their funds. With every trade comes a transaction fee as well as a trading fee.

There are three man types of decentralized exchanges:

  1. Automated Market Makers - An (AMM) is a system that relies on smart contracts was first created in order to combat the liquidity problem. Inspiration to create these exchanges came from Ethereum co-founder Vitalik Buterin's paper on Decentralized exchanges. Which describes how to execute trades on a blockchain by using contract holding tokens. These AMM's must rely on blockchain based services to provide information from exchanges and other platforms in order to set the price of traded assets called blockchain oracles. The smart contracts of these decentralized exchanges use pre-funded pools of assets known as liquidity pools.

Liquidity pools are funded by other users who then qualify for the transaction fees that the protocol charges for executing trades on that pair.

2. Order Book DEX's - Order books compile records of all open orders to buy and sell assets for specific asset pairs. Buy orders means that the trader is willing to outright buy or just bid for an asset at a specific price. Where as sell orders indicates that the trader is ready and willing to sell or ask a particular price for the specific asset. The spread between the prices determines the depth of the order book and also the market price on the exchange.

Order book DEX's have two main types which are on-chain order books and off-chain order books. DEX's that use order books will often hold open order information on-chain, while the users funds will remain in their wallets. These exchanges may allow traders to leverage their positions by using the funds that are borrowed by the lenders on their platform. Leveraged trading has it's advantages and disadvantages, while it increases the earning potential for trades on the other hand it also increases the risk of liquidation and it enhances the size of the position with borrowed funds, that must be payed back by the traders even if they lose their bet.

3. DEX Aggregators - These make use of another of different protocols and mechanisms to solve the problems to do with liquidity. The role of these platforms is to aggregate liquidity from various DEX's to minimize the slippage on the larger orders, optimize swap fees and token prices and offer the traders the best prices possible in the least amount of time. Protecting the users from the pricing effect and decreasing the likelihood of failed transactions

With all of these allowing users to trade directly with each other through smart contracts. The first decentralized exchanges used the same type of order books, similar to centralized exchanges.

Advantages of DEX's

For many users of decentralized exchanges can be expensive especially when the network transaction fees are high at the time of the transaction. But there are a number of different advantages that come along with that.

Token Availability - Unlike decentralized centralized exchanges must individually vet tokens and make sure that they follow the local regulations before listing them. Decentralized exchanges can include any tokens that are minted on the blockchain that they are built on. Which means that the new projects will most likely list on these exchanges before being available on the centralized exchanges. Though this means that traders can get in as early as possible on projects, which leaves opportunities for all sorts of different scams that are listed on DEX's.

Anonymity - When the users exchange one cryptocurrency for another, the users anonymity is still preserved on the DEX's. Unlike centralized exchanges, the users do not need to go through a standard identification process that is called Know Your Customer (KYC). This process involves collecting traders personal information. As a result DEX's attract a large number of people who do not wish to divulge their personal information.

Reduced Security Risk - The experienced cryptocurrency users who custody their funds are at a reduced risk of being hacked using DEX'S, as these exchanges are not in control of their funds. Rather, traders have to guard their funds and only interact with exchange when they wish to do so, also if the platform is hacked then only the liquidity providers will be at risk.

Reduced Counter party Risk - These risks occur when one side of the transaction does not hold up to it's side of the deal and defaults on it's transactional obligations. But because decentralized exchanges operate without the need of a third party/intermediary and are based on smart contracts, this risk is ultimately eliminated. Users are quickly able to verify if there may be any more dangers they could come across while using the DEX's, they can simply just do a search to find out if the exchange's smart contracts have been audited or not, and can also make decisions based on previous traders experiences.

Disadvantages of DEX's

Although there are many advantages of using DEX's as we briefly talked about above, nothing is perfect and there are always some disadvantages even when we talk about decentralized exchanges.

Specific Knowledge Required - The users are allowed access to DEX's by way of their cryptocurrency wallets, that are able to interact with the smart contracts. The users must have a basic knowledge of how to use their wallets and also have a clear understanding of all of the security related concepts that are associated with keeping all of the users funds secure and safe. These wallets must be funded with the correct tokens for each network, if the user does not have the native-token to that specific network then the funds could get stuck, because the trader is not able to pay the fee that is required to move them. You must have specific knowledge of these things in order to choose an actual wallet and put the correct funds into it. Without the proper knowledge users could commit a number of different errors like withdrawing coins to the wrong network, overpaying transaction fees, and losing out on impermanent loss are a few examples of the things that could go wrong.

Smart Contract Vulnerabilities - As we have talked about before smart contracts are public and being said an be seen and reviewed by anyone, and whats more is that the larger decentralized exchanges are audited by well known reputable firms that will assist in securing the code. But some bugs may still be able to slip past audits and other code reviews. And auditors will be unable to foresee future problems.

Unvetted Token Listings - It is possible for anyone to list a new token on a decentralized exchange and able to provide liquidity by pairing it with other coins. Which can lead to one of the most popular scams seen in web3 called rug pulls, that make them think they are buying a different token. On the other hand there are some DEX's that try and fight against these risks by asking the users to verify the smart contract of the tokens that they are trying to purchase. That is where the importance of specific knowledge and having the experience to know what you are doing. There are tons of information that traders are able to search for and find about a token simply by looking at it's white paper, joining the discord community or other social media and also potential audits as we mentioned before.

Last updated