Deconstruction of Decentralized Exchanges

Last Modified:8 Oct 2020 12:30:45
Deconstruction of Decentralized Exchanges

The architectural structure of decentralized exchanges and the performance, as well as security tradeoffs related to different architectural choices, are delineated in the present article. Decentralized exchanges are critical in the process of cryptocurrencies transactions. By “decentralized exchange” we mean distributed ledger protocols and applications to transact cryptocurrencies without the requirement of any trusted centralized entity as an intermediary.

The benefits of decentralized exchanges include:

 

  • Lower counterparty risk
  • Lower transaction fees
  • More diversity in trading pairs which leads to riskier cryptocurrencies and those with less liquidity.

Moreover, this type of exchange is empowered by regulatory and industry trends like:

A) the increase of different cryptocurrencies which prevents forming a comprehensive list of them.

B) regulatory risks of listing cryptocurrencies on decentralized exchanges

C) the users’ tendency to avoid know-your-customer requirements in centralized exchanges for more privacy in the transaction.

The purpose of this paper is to help users to understand the best-decentralized exchanges optimized for each case.

The term “decentralized exchange” describes blockchain-based exchange protocols and application that leverage them. A decentralized exchange protocol is a software program, located in one or more distributed ledgers with the ability to have peer-to-peer transactions automatically settled on the distributed ledger. Users will be the only one to custody the transaction.

An application based on the decentralized exchange is constructed on top of a decentralized exchange protocol and attaches on-chain or off-chain order book database and a graphic user interface (GUI) and/or APIs in order to make the information available.

In general, a decentralized exchange application owns the following components; each one will be briefed on separately:

1.blockchain platform & technical deployment

Most decentralized exchange protocols work with tokens with similar technical implementation and on the same distributed ledger platform.

On the other hand, a few decentralized exchanges are to use atomic swaps to help users atomically trade cryptocurrencies on different blockchain networks; but these swaps’ correct function entails transacted cryptocurrencies being adhered to specific popular technical standards.

Cross-chain swap technologies are constructing tools and protocols that could be unified into decentralized exchange applications that can atomically swap tokens from different Blockchains.

However, considering the current latency of most cross-chain atomic swaps, most common decentralized exchange applications presently concentrate on the token to be traded within one chain.

2.mechanism of finding out the counterparty

These mechanisms make it possible for buyers to discover sellers with a tendency to do transactions on reciprocal agreed-upon terms. On traditional cryptocurrency exchanges, the users have the power to submit both market orders and limit orders.

Many of the decentralized exchanges have order books which can exist on-chain, or off-chain and most of these books represent distinguished orders for each counterparty. Identifying a specific order and counterparty, as a result, is a requirement for the user’s trade.

On the contrary, some others don’t have order books, and a reserve-based model is their key characteristic. This reserve is the creator of supply and demand for tokens available to be executed according to the token prices. In addition, these aforementioned reserves come into existence by on-chain smart contracts.

On-chain order book

Regarding on-chain order books, the distributed ledger network takes all orders and verifies them. Anyone can access a copy of the order book or even host it. Among its benefits are being less censorable and the need to less trust.

On the other hand, there are some tradeoffs explained below:

- Order book does have the same features defined from Blockchain as performance, cost, and security. The underlying blockchain can determine the speed and cost of an offer. The users must pay for each order book update, wait for network consensus on their updates and update secure confirmation.

- Slower updates: in case of second layer technologies absence, on-chain order books are updated based on information in the latest block or ledger; in contrast, off-chain order books support immediate updates.

- Stale orders: these exchanges usually back resting orders that the price and quantity have been fixed by the Maker (a party providing an order) in creating an offer.

Off-chain order books

They are hosted by a centralized entity outside a distributed ledger. It helps findings other offering parties on the assets. Whether to use on-chain or off-chain order book depends on the performance of the chain. On certain chains, transaction fees are so little and some seconds is needed for an order, so on-chain order book is suitable for moderate volumes of intermittent orders while on Ethereum blockchain, transaction fees are high with minutes of wait times.

Merits of having an off-chain order book are:

- Improvements in performance

- improvements in charges

- Fewer risks related to blockchain in the order book

- Adaptable to all ERC-20 tokens.

And the trade-offs include:

- Needing more trust

- more restrictions

- incorrect order books

lack of any order book or having a hidden one

in these occasions, some decentralized exchange protocols like KyberNetwork, Bancor, etc. make and/or leverage liquidity reserves available when exchanging tokens by the users. Reserve depth/ breadth and suitable pricing are effective factors on these models’ performance.

Among its merits is less friction to trade and demerits can cover issues like the need to trust in a smart contract or third party, volatile pricing, willing to enjoy large reserve contributors and last but not the least, limiting reserves solely to the most popular tokens.

3.Matching algorithm for the orders

It is the process of pairing buy orders with sell orders when they have mutually acceptable terms. Decentralized exchanges might enjoy automatic matching or need Takers (a party who fills the order).

On centralized exchanges, all orders are collected, and users are allowed to submit market orders (a buy or sell order immediately made considering the current market price) and limit orders (a buy or sell order wherein the user determines the highest purchase price or the lowest sale price). Most decentralized exchange protocols which are based on non-reserve condition do not own market orders or limit orders.

It is of utmost importance to analyze a decentralized exchange’s order matching algorithm since it influences its comfort in use, the possibility of fair exchange rates, and wait time between creating and fulfilling an order.

Filling an order manually

Takers must find and submit a counterparty order beforehand. It gives more latency in order filling, but there usually needs less trust, and in case the users are urged to rely on a centralized or smart contract-based matching algorithm they will have more control.

Filling an order automatically

In this situation, an algorithm automatically matches orders. Hence, it can decrease the time and effort assumed to be suitable to identify appropriate trades, and consequently lowers filling latency of the orders.

 

4.The protocol of settling transaction

An on-chain settlement is something common among all decentralized exchanges and critical factor to help the users get rid of the need to trust a centralized party for controlling the assets, settling trades, and being aware of the accuracy of account balances. Decentralized exchanges don’t have the much extensive function, so the confirmation speed of a transaction lowers their performance.

Differences in features in various exchanges

- Different decentralized exchanges allow access to different cryptocurrencies.

- The security of the underlying distributed ledger determines; that is, limits the security of decentralized exchange. Transactions whose high security is vital should be settled through smart contracts completely                       audited.

- Applying interoperable decentralized exchange protocols enables collecting liquidity; albeit in a networked liquidity.

- The latency of a decentralized exchange is specified by the speed of the underlying distributed ledger.

- Decentralized exchange costs includes fees for its application, fees for making and/or taking the order, fees incurred in interacting with any smart contract and fees in settling a transaction.

- Different decentralized exchange applications require different levels of user trust.

About Athour:

https://www.linkedin.com/feed/update/urn:li:activity:6490925115348480000/