What is a Decentralised Exchange (DEX)?
Decentralised exchange (DEX) is a platform that facilitates online transactions of cryptocurrency trading without intermediaries.
Similarly to a stock exchange, DEX allows traders to buy and sell assets. Yet while the former is centralised, DEX operates as a peer-to-peer marketplace where transactions take place directly between the owners of cryptocurrencies.
DEX is an essential component of cryptocurrency transactions as they allow blockchains or secured ledgers to take over the responsibility of ensuring secure trades, instead of a central system of bank, stock brokers and government.
One of the examples of decentralised exchange is Uniswap, an exchange that runs on the Ethereum-based blockchain protocol to carry out peer-to-peer trading.
History of Decentralised Exchange
With bitcoin having been created in 2008, there appeared a need to develop an exchange platform for people to trade cryptocurrencies. Although Central Exchanges (CEXs) were facilitating these transactions, they became easy targets for hackers.
By 2014, open-source cryptocurrency and payment network NXT launched the NXT Asset Exchange, one of the first decentralised exchanges.
How does decentralised exchanges work?
The framework of a decentralised exchange is based on smart contracts. Using liquidity pools they allow token holders to lock their cryptocurrency into DEX to facilitate trade orders, and also earn returns through locking their funds in these pools.
When trading on a DEX, crypto traders essentially interact with smart contracts that are built on the blockchain ecosystem.
Types of DEX
Broadly, there are three types of decentralised exchanges which are Order Book DEXs, Automated Market Makers and DEX Aggregators.
Automated market makers
Automated Market Makers (AMM) make use of smart contracts to facilitate the working of a DEX platform. Smart contracts operate on the basis of liquidity pools, which are pre-funded pools of assets.
Crypto traders can provide funding to the liquidity pools and get rewards, usually in the form of cryptocurrency. By making use of smart contract and pre-set mathematical equations, Automated Market Making ensures the selling side matches the buying side. Some popular examples of AMM DEXs are Uniswap and Sushi.
Order book DEXs
Order Book DEXs are more traditional types of DEX. Under this system, a record of all open orders for trading different pairs of assets is maintained. The buy and sell orders suggest a trader’s intent to bid for and sell different assets at a particular price. These bid and ask prices are effectively matched on the Order Book DEX.
These are further categorised into on-chain and off-chain order books. On-chain keeps its information on chain and allows for traders to leverage their positions by using funds from lenders on their platform. Examples of order book DEXs include Stellar and Bitshares. Off-chain store order books enable transaction settlement on the blockchain. Examples include IDEX and EtherDelta.
DEX aggregators are trading protocols that channel liquidity from multiple DEXs based on specified requirements. They aren’t dependent solely on traders’ liquidity pools and can raise liquidity efficiently through different avenues. For example, Ox and Matcha.
Are Decentralised Exchanges safe?
Decentralised exchanges eliminate counterparty risks, which means there’s less fear that the other trading party will not fulfil its part of the deal. Owing to smart contracts and complete removal of intermediaries, DEX platform users can safely trade without fearing a default from the counterparty.
However, smart contracts aren’t necessarily fully proofed against slippages. There’s always a chance for bugs to exploit secure contracts, which may cause loss of tokens.