Nearly everyone in the blockchain space agrees that decentralized exchanges (DEX) are the future of crypto trading. That’s because, even now in 2020, trading digital assets on centralized crypto exchanges can be a headache.
To start trading, you must first buy assets with a fiat currency (USD, EUR, GBP, AUD, etc.) through fiat gateway services, which often charge high fees and/or offer poor exchange rates. Oftentimes, only a small handful of major digital currencies are available. Moreover, the exchange will hold the private keys to your coins and tokens for you. This is what's known as a custodial exchange.
This custodial system forces centralized exchanges to be responsible for holding and protecting all users’ funds. As a result, exchanges must manage a few centralized wallets that control huge amounts of wealth. This concentration of wealth makes exchanges the perfect target for bad actors. Hackers have stolen billions of dollars worth of digital assets over the last few years, underscoring an enormous security problem for the entire blockchain industry.
The solution is decentralization. If all trades are fully peer-to-peer, as on a decentralized crypto exchange, then intermediaries will no longer need to hold and manage users’ funds. It makes cryptocurrency trading far more secure. It also promotes adoption by simplifying the trading process. Although many projects are working on various DEX protocols, few of them have developed a DEX that meets all 4 core requirements of a truly decentralized exchange.
This article will examine and compare the protocols of the 8 best decentralized exchanges: 0x, IDEX, Waves, Loopring, Kyber Network, Decred, Nash Exchange, and AtomicDEX. After a thorough analysis, we will be in a position to evaluate the relative merits of each DEX and discover which one has the most to offer its users.
Before we get to decentralized exchanges, let's understand the traditional cryptocurrency exchange. An ordinary exchange is a web application that runs on centralized servers. It is typically not open source. It must manage users’ login data, such as their email addresses and passwords, as well as their KYC documents (if the exchange requires them). We can refer to exchanges of this variety as centralized exchanges (CEX).
To make trades on a CEX, users must deposit funds upfront. It’s clear why this is a requirement, as users should not be allowed to make trades with funds they do not have.
However, the deposit process can take up to an hour or more, as most exchanges require a high number of block confirmations before the funds are considered safely deposited. This model also forces users to forfeit control of their funds when making a deposit to a CEX.
As such, a traditional centralized exchange controls all of the funds deposited by its users. All funds are controlled by a few (or in some cases by just one) person(s). This forces them to manage many different crypto wallets, as no wallet can hold all every digital asset in existence. So an ordinary CEX must manage many high-value wallets to securely store their users’ funds while the users trade.
Centralized exchanges use a credit system, sometimes called an IOU system. This means that when a trader deposits funds, her account gets credited accordingly, and then she can create buy and sell orders.
So, if Alice deposits BTC, she can place a buy order for another digital asset, like KMD. This can be thought of as buying KMD with BTC, or it can be thought of as selling BTC for KMD. Once the trade is complete, Alice can submit a withdrawal request and have her KMD sent to her personal wallet. This is essentially “cashing in” the IOU that the exchange issued to her.
What’s wrong with centralized exchanges?
Now that we’ve covered what centralized exchanges are and how they work, we can begin to understand their limitations and challenges.
As described above, all CEXs take custody of traders’ funds. All the funds are consolidated into a few high-value wallets. These wallets’ private keys are always under the control of the exchange’s leadership.
When you consider that CEXs might have tens or hundreds of thousands of users, it’s easy to see how these wallets quickly become a liability. Taking custody of users’ funds forces CEXs to manage and safeguard massive amounts of wealth, making them an extremely lucrative target for hackers and bad actors.
Security is a huge concern for CEXs. Over the last 10 years, hackers have stolen more than $1.5 billion from centralized exchanges. In fact, research groups estimate that hackers stole somewhere between $950 Million and $1 Billion from centralized exchanges in 2018 alone. Many exchanges— Mt. Gox, Youbit, Cryptopia— were forced to file for bankruptcy and shut down as a result of hacks.
If a retail bank gets robbed, and all of that bank’s money is stolen, the customers of that bank still get their money back. This is true because, in most developed nations, banks are insured by the government.
In the United States, for instance, the Federal Deposit Insurance Corporation (FDIC), established by the 1933 Banking Act, in the midst of the Great Depression, provides insurance to all licensed commercial banks, insuring each account holder up to $250,000 USD.
For better or for worse, none of this holds true for CEXs. If a centralized exchange is hacked and goes bankrupt, all of the users who had funds on that exchange are not guaranteed reimbursement. Their funds may be gone forever. That’s why it is so crucial to take security very seriously, and why many savvy users refuse to keep their coins on a CEX.
Deposits, Withdrawals, and Fees
Before making trades on a CEX, users must deposit their funds to the exchange itself. This process is free but it generally takes time. Exchanges force users to wait for a high number of block confirmations before giving them access to their funds for trading.
When a user wants to stop trading and withdraw their funds to a private wallet, they need to create a withdraw request and pay a fee. Withdrawal fees are paid in addition to trading fees. While trading fees vary from exchange to exchange, they are typically 0.2% of the value of every trade for both the buyer and the seller. You can imagine how quickly these fees add up.
Binance, for example, was reportedly more profitable than Deutsche Bank, the largest bank in Germany, in 2018. Despite a prolonged bear market, Binance collected $200 Million in profit in the second quarter of 2018 alone.
Decentralized Exchanges Solve All Of These Problems
For a truly decentralized exchange, all of the challenges described above are overcome.
There are approximately one hundred decentralized exchange protocols in development or available for live trading. However, many projects calling themselves a decentralized crypto exchange are not actually decentralized.
With a decentralized exchange (DEX), your funds are always in your custody, thus eliminating the security issues that plague centralized exchanges. This means your funds are in your control and remain much more secure. Real decentralized exchanges must also be permissionless because, if a DEX requires users to receive permission, then there must some centralized entity controlling it.
Users never need to deposit or withdraw funds to trade on a true DEX. On top of that, DEXs provide better privacy, transparency, and censorship-resistance, and allow unlimited trading pairs using technologies like atomic swaps. With atomic swap technology, traders can make cross-chain exchanges between any two listed assets.
To see how the most prominent DEXs in the industry compare, let’s have a closer look at their underlying DEX protocols.
A Technical Comparison of Decentralized Exchanges
Now that we’ve covered the issues with centralized trading and some decentralized exchange terminology, let’s dive deep into the finer details of 8 major decentralized exchange protocols: 0x, IDEX, Waves, Loopring, Kyber Network, Decred, Nash Exchange, and AtomicDEX.
0x Protocol - ERC-20 DEX
0x is a hybrid decentralized exchange model. The 0x website describes the project as “an open protocol that enables the peer-to-peer exchange of assets on the Ethereum blockchain.”
From a high level, 0x is a collection of smart contracts deployed on the Ethereum blockchain, which specify the order format and trade execution process. In simple terms, the protocol tells you what these smart contracts know and how to execute a trade using them.
On-chain order books are costly and slow, so 0x relies on a relayer model. In 0x’s lexicon, the Relayer is a process that hosts order books in a centralized database and matches orders between two traders. There are a number of Relayers to choose from— Radar Relay, ERC dEX, Paradex, DDEX, and more. In effect, these are the apps built atop the 0x protocol.
Let’s understand 0x architecture with an example. Bob creates an order using a Relayer GUI, which then goes to the relayer’s order book (centralized database). A relayer can share this with other Relayers so that more traders can see the order.
Now, Alice wants to accept Bob’s order. She executes the order using the Relayer’s GUI. Then, the relayer matches the request and sends it to a 0x smart contract to complete the order.
While creating/executing these orders, Bob and Alice allow 0x smart contracts to deduct the funds from their respective wallets. 0x smart contracts now verify the order and complete the token transfer on-chain.
The 0x protocol created the ZRX token, which is used to pay trading fees. So if you are using 0x Relayer, you need some ZRX tokens to make or take an order. The Relayer also collects some part of the fee to host order books.
The 0x protocol is one of the most widely-used decentralized exchange protocols in the industry today. Third-party projects can build atop the 0x protocol, meaning that a number of different DEXs and Relayers can all exist while sharing the same protocol and liquidity pool. This is a huge benefit to 0x.
However, the 0x protocol only works for Ether and assets issued on the Ethereum platform (ERC tokens). It is not compatible with Bitcoin protocol or the protocols of other blockchains, like EOS, Monero, Stellar, Cardano, NEO, or Tezos. This severely limits the utility of the 0x protocol and clearly prevents it from becoming an industry-wide solution.
IDEX - ERC-20 DEX
Like the 0x protocol, IDEX only supports Ethereum ecosystem tokens. In fact, the IDEX website describes the project as “a decentralized exchange for trading Ethereum (ERC-20) tokens.”
To use IDEX, you need to deposit funds, but unlike centralized exchanges, smart contracts control funds (rather than one or several individuals). It makes IDEX more secure in comparison to centralized exchanges but it is far from being fully decentralized.
IDEX uses the Ethereum blockchain as a settlement layer, yet everything is first updated on a centralized database before being written onto the blockchain. Smart contacts control real funds, but the IDEX database controls how these funds are distributed.
This architecture helps IDEX to provide better UX, and that’s why IDEX has comparatively high liquidity. However, pushing every trade on the blockchain is costly, and having a centralized database creates a risk of censorship while also jeopardizing user privacy.
At the same time, the IDEX model eradicates the security problems of centralized fund storage, so it’s more secure than a CEX. They also have a utility token, called IDEX, which is used to secure the network on which IDEX runs.
Since IDEX only works with ETH and ERC-20 tokens, IDEX shares the same limitations as the 0x protocol. It may be a reasonably decentralized trading option for the Ethereum ecosystem, but IDEX is not an industry-wide solution.
Moreover, IDEX started enforcing user registration and KYC on the platform from August 2019. While the protocol itself is still somewhat decentralized, this creates a counterparty risk and raises questions about the future of the platform.
The Waves DEX was introduced by Waves project. Waves has its own blockchain and a token with the same name (WAVES) which is an integral part of its decentralized exchange platform.
All the fees are paid in the WAVES token, and you can create your own token by paying 1 WAVES, which automatically gets listed on the Waves DEX. Waves DEX has optional KYC but, if you want to make fiat on-ramps available, then KYC is mandatory.
While Waves’ order matching engine is open source, order matching is still centralized. The Waves DEX documentation admits the order book Matcher is “the only centralized design element of our DEX.”
Independent nodes can match orders to earn fees in Waves. These order-matching nodes match orders and sign them using their own private key. Mining nodes validate each Matcher’s signed transactions and send them to the Waves blockchain. At that point, the user account balances are changed according to the amount and price of the order, and the trade is settled.
Waves DEX is a non-custodial exchange but it is centralized in several other respects.
Specifically, the order books and order matching processes are both centralized. This means that trades are not directly peer-to-peer. Instead, trades are made through a Matcher, an intermediary of sorts, are therefore not made on-chain. The Matcher makes the transfers on-chain before settling the swap between the two traders.
Anyone can set up a Matcher node so this process is not fully centralized but it is certainly not fully decentralized, either. It seems most accurate to call Waves a distributed exchange, rather than a decentralized exchange.
Loopring - Layer 2 Scaling Protocol for Ethereum
Loopring is not exactly a decentralized exchange. Rather, similar to the 0x project, it’s a modular protocol for building DEXs on multiple blockchains. The Loopring website simply calls it “the protocol for decentralized token exchange.”
Using a wallet interface (Metamask, for example) integrated with Loopring, you can create orders and sign them with your private key, which allows the Loopring protocol to withdraw funds at the time of trade execution. In other words, funds aren’t withdrawn until the order is matched, thus you have control of funds even after placing an order.
Relayers host order-books and look for orders to share with other relayers to pool liquidity. Loopring provides a consortium blockchain to enable liquidity sharing but it’s at each relayer’s discretion to use this blockchain, or whether to even share liquidity with other relayers at all.
Loopring enables something called the UniDirectional Order Model, which can match 16 trades at a time, in comparison to single buy/sell order matching like most other exchanges. Loopring calls it “order-ring.” These order-rings get processed by ring-miners through a resource-intensive process called ring-mining. The Loopring protocol incentivizes ring-miners and relayers for network participation.
When orders are matched, ring-miners sign the orders and send them to the Loopring protocol for settle transaction settlement. Loopring protocol smart contracts also verify different aspects of this order-ring and settle trades on-chain.
Loopring is currently available only for the Ethereum ecosystem, though it can also be implemented on any public blockchain with smart contract support. While this seems like a feature, it can also be a drawback, as it may result in users having to pay a number of gas fees in a number of different currencies just to complete a single trade.
This isn’t a flaw with the Loopring protocol as much as it is one of the limitations of smart contract platforms in general but, regardless of where the fault lies, it makes Loopring and other smart contract based DEX protocols somewhat inconvenient and costly. Loopring, like many other DEX protocols, is also limited to the Ethereum ecosystem, at the time of writing.
Kyber Protocol - ERC-20 DEX
The Kyber Network website describes the project as an “on-chain liquidity protocol that aggregates liquidity from a wide range of reserves, powering instant and secure token exchange in any decentralized application.”
The Kyber protocol is a set of smart contracts that provide a decentralized method for performing on-chain token swaps. It doesn’t have order book functionality, so it is technically not an exchange (even if it’s possible to post limit orders). Rather, Kyber is a decentralized version of instant swap services like Shapeshift or Changelly.
In Kyber’s terminology, a reserve is simply someone who provides liquidity. By implementing the Reserve interface, the Reserve (liquidity provider) can register to the protocol’s smart contracts and offer its liquidity for takers (traders who accept existing trade offers) to buy.
For now, you need approval from Kyber team to become a Reserve, so it is not a permissionless system. In general, anything that is permissioned is not decentralized. If something is truly decentralized, then there is no authority to prevent people from using it.
The details on how Reserves determine the prices and manage their inventory is not dictated in the protocol and is entirely up to the Reserves themselves, as long as the implementation complies with the Reserve Interface. This can potentially lead to non-competitive markets.
Let’s understand Kyber with an example. Suppose you want DAI tokens in exchange for 1 Ether. First, the Kyber smart contract asks different reserves to get the best exchange price. Then, you’ll see the exchange rate and decide whether or not to go through with a swap. If you proceed, you will send 1 ETH to a Kyber smart contract. Once received, the reserve will do an on-chain exchange and your account will be credited with DAI.
But for Token A—>Token B swaps (where neither Token A nor Token B is Ether), Kyber uses Ether as a proxy token internally (TokenA →Ether→TokenB).
Kyber presents a unique DEX protocol. While Kyber has plans to enable P2P trading for different smart-contract blockchains in the future, it is currently limited to the Ethereum network and ERC tokens. Like other token exchanges, this severely limits the potential of the protocol.
The Nash Exchange is a decentralized bitcoin exchange project that describes itself as “a fast and user-friendly non-custodial exchange.” Launched recently, on August 24, 2019, the Nash Exchange is yet another hybrid DEX with off-chain order matching and trade settlement through a series of smart contracts.
The Nash team says the off-chain order matching engine is “the heart of Nash,” but also notes that “it is not a blockchain” and that the “order matching engine is a distributed system, designed to run initially with five nodes.”
There is no information available about becoming a part of this distributed order matching system or how to add a node to the engine. Thus it appears that all 5 order matching nodes are currently run by the Nash team, which means the system doesn’t seem very distributed at all.
The Nash website says that the protocol “is constructed with a view to upgrading to a fully decentralized system in the future,” but no details are offered about how and when the order matching engine will become decentralized.
To make trades on Nash Exchange, users must first lock their funds into a smart contract. The Nash team states that users are “free to withdraw their funds from our trading smart contracts at any time.”
After funds are locked into a smart contract, the off-chain order matching engine relays data between the smart contracts and the relevant blockchain's peer to peer network. Once on order is matched, users must sign off on the trade again before it is settled. Then the funds are exchanged and automatically transferred back into the user’s wallet.
The Nash Exchange is compatible with more than one protocol, a significant advantage over all of the decentralized exchanges covered thus far. Nash supports Ethereum ecosystem assets and NEO-based assets.
However, Nash is not currently compatible with the Bitcoin protocol, so many major digital currencies-- BTC, LTC, BCH, DASH, ZEC, etc.-- are not supported. This dampens Nash's ability to gain widespread usage throughout the industry. Further, Nash exchange requires KYC and notes that "Nash aims to be maximally compliant." While regulatory compliance is important, forcing users to undergo an intensive registration and KYC process is not indicative of decentralization.
Decred - Atomic Swap DEX
On July 31, 2019, Decred entered the decentralized crypto exchange space with the release of specifications for a DEX protocol. These specifications describe the project as "a system that enables trustless exchange of different types of blockchain assets via a familiar market-based API." The official Decred Twitter account stated that the “Decred DEX will be permissionless. It will be non-custodial, peer-to-peer using Atomic Swaps.” It also added that the Decred DEX “will have no trading fees, no intermediary coins or tokens.”
Since the Decred DEX is only at the specification stage, without an alpha product to test, it’s difficult to assess some of these bold claims. From the information that is available, a few things are apparent.
First, to Decred’s credit, their DEX protocol does appear to use rudimentary atomic swap technology. It's a rudimentary atomic swap implementation because it currently only supports assets of the Bitcoin protocol.
Nonetheless, using atomic swap technology does mean that Decred's protocol will be non-custodial, fully peer-to-peer, and asset-agnostic. These characteristics, right off the bat, satisfy 3 out of the 4 core requirements of a true DEX.
However, there are several obvious issues with the Decred protocol.
For one, the protocol only supports UTXO-based assets. Whereas most hybrid DEX protocols only support Ether and ERC tokens, limiting their capabilities, the Decred DEX falls on the opposite side of the fence but runs into the same problem— only supporting UTXO coins excludes support for the Ethereum ecosystem, as well as a number of other prominent blockchain protocols and platforms.
Second, the claim that Decred “will have no trading fees” is dubious for several reasons. For starters, the Decred DEX white paper states:
“The DEX collects no trading fees. ... Instead, a one-time fee is collected by the pool during registration. Registration fees discourage certain spam attacks, enable punitive actions when conduct rules are violated, and help to cover DEX operating expenses. Registration fees will be configurable by the exchange operator.”
So, even if it is true that there are no trading fees, users must pay a one-time registration fee. If users must pay a fee to use it, the DEX is clearly permissioned and thus not decentralized. Plus, the registration fee may or may not be a substantial sum. It isn’t yet clear how much the fee will be and it seems the exchange operators will get to set their fees independently.
Moreover, the claim that there will be no trading fees is still suspect because someone needs to run the order matching nodes that broadcast buy and sell orders and connect peers that have agreed upon a specific swap.
If there are no trading fees to collect, then there is no incentive for users to set up their own order matching nodes. And if there are no users setting up order matching nodes, that means the Decred team would need to set up, manage, and maintain all the order matching nodes themselves, which makes the entire system quite centralized.
The Decred DEX specification is relatively new so it’s probably best to wait on passing a final judgment. As things stand now, the Decred DEX shows a lot of promise and is pursuing the right technology— i.e., atomic swaps— but there is still a lot of room for improvement in both the technology and the fee structure.
AtomicDEX - World's Best Atomic Swap DEX
AtomicDEX is a third-generation decentralized crypto exchange, developed by the Komodo Platform team. The AtomicDEX website states that it’s a “mobile-native asset-agnostic atomic swap DEX.”
Komodo, the team that developed the AtomicDEX, is widely recognized as the industry leader in atomic swaps. An article published on Forbes magazine called Komodo “an atomic swap early adopter.” Binance Academy states that “the first peer to peer atomic swaps started to take place in 2014” and links to a discussion on an old NXT forum in which Komodo’s Lead Dev James ‘jl777’ Lee describes one of the very first atomic swap protocols.
In fact, Komodo’s atomic swap protocol idea is an extension of Tier Nolan’s atomic swap idea proposed in 2013. AtomicDEX is the third-generation of Komodo’s DEX technology. The first generation being the Multi-Gateway proxy token DEX, built on NXT, and the second generation being BarterDEX, an early atomic swap DEX that is now retired in favor of AtomicDEX.
Today, AtomicDEX uses a state-of-the-art networking layer known as Market maker 2.0. Market Maker 2.0 allows AtomicDEX to provide non-custodial, secure, and fully peer-to-peer trading of digital assets. It also enables cross-chain and cross-platform atomic swap protocol that executes swaps on-chain, even when facilitating swaps between assets of two different protocols. Traders can swap from ETH or ERC tokens to BTC or other UTXO-based assets.
AtomicDEX also offers an open API, to which any existing exchange, wallet provider, or blockchain project can integrate. It is an open source and permissionless protocol that offers a shared liquidity pool to create a network effect and maximize benefits for each adopter. Read more about AtomicDEX API here and check out the AtomicDEX documentation to learn more.
While all of the projects outlined in this article are making meaningful contributions to decentralized crypto exchange technology, Komodo is leading the space. AtomicDEX boasts cutting-edge atomic swap technology that overcomes all of the major problems with trading digital assets.
As this analysis has shown, most DEXs are focused exclusively on the Ethereum ecosystem and only allow swaps between ERC tokens. The few DEX protocols that are not exclusive to the Ethereum ecosystem are still limited. Many of them rely on smart contracts, which may introduce security vulnerabilities, force users to relinquish control of their funds, add costs to trading, and prevent direct peer-to-peer swaps.
There are also elements of centralization in nearly every DEX available in the space today. Some rely on a small number of centralized, project-controlled order matching nodes to broadcast buy and sell orders and match users. Others require registration, KYC documents, and/or payment of one-time registration fees.
In short, AtomicDEX is the only DEX on the market that meets all 4 of the core DEX requirements. It is the only decentralized exchange that offer secure, cross-platform trading through atomic swap technology.
Try AtomicDEX on Android or iOS now to start making your very first atomic swaps.
Join the decentralized finance revolution with Komodo and the industry-leading AtomicDEX.