Decentralized Exchanges: What’s the best formula?

Manish Agarwal
TokenMonk
Published in
6 min readOct 5, 2017

Last two years have seen launches of large number of centralized crypto exchanges — most of these developed and deployed in a relatively short span of time. Given the relatively higher complexity of assets being dealt with (crypto tokens vs equity shares) and unavailability of history of issues and exhaustive test cases, most of these exchanges are vulnerable to attacks. In fact most of the key centralized crypto exchanges have faced some or the other kind of attack in the last two years, leading to loss of funds — key among them being Bithumb, MtGox, ShapeShift, Bitfinex, Yapizon etc.

Given the vulnerability of centralized exchange, and the very fact that this goes against the principle of “trustlessness” of blockchain, decentralized exchanges (or dexes) have been a key area of interest among the developers as well as the investor community. Last two years have seen multiple new launches— including whitepaper releases, token sales to even deployment in few cases. While there are few dexes which support bitcoins, here we discuss the key exchanges supporting ERC20 tokens — primarily EtherDelta, 0x, Kyber, Swap, OmegaOne and to some extent Bancor. Some of these exchanges have in fact plans for atomic swaps in some later phases of development, but that is still some time away.

Pros and cons of centralized exchanges: There are three key roles of an exchange 1) liquidity — providing a counterparty quickly for trade; 2) price discovery with minimal spread leaving little room for arbitrage and; 3) a quick settlement. A centralized crypto exchange is able to provide speed in finding the counterparty as well as a settlement by having a large centralized off-chain order book and an off-chain settlement. Good price discovery on exchanges is largely a function of volumes on the exchange. On the flip side, these have issues of security (single point of failure) as well as lack of trustlessness (fraud by the exchange, risk of front running).

So how are decentralized exchanges trying to address these issues?In decentralized exchanges, the issue of security is addressed by providing control and direct authorization of funds for on-chain settlement (though this is a bit slower). The other issues are a bit more complex, which these new Decentralized Exchanges are trying to solve.

Liquidity or finding counterparty quickly: Order matching for trade could be done either through maintaining an order book (would involve some degree of centralization and time gap between ordering and settlement leading to stale orders), maintaining reserves (should require balance sheet support) or direct Peer to Peer negotiation (difficult to find counterparty, could be slower).

  1. Order book: Order book can be either off-chain or on-chain. Maintaining off-chain order book (EtherDelta, 0x) is easier, but it again brings in some degree of centralization. To alleviate this issue, these exchanges do not provide automatic match-making (reducing any third party involvement)- the taker has to sign an exact counter order which is then sent to a smart contract – this should have some impact on the liquidity of the exchange. 0x has gone a step further, by allowing relayers (who could be anyone) to host multiple order books vs single centralized order book of EtherDelta. On-chain order book (OasisDex), on the other hand, though ideal for an decentralized application, is a costly affair, as even the modification of order book (addition, cancellation, price change) would cost “Gas”.
  2. Reserves: Trade orders can be quickly settled against reserves (Kyber, Bancor Protocol), however this would require balance sheet. Kyber tries to alleviate this problem by allowing third parties to create reserves who could either pool tokens from others or backed by other centralized exchanges.
  3. Peer to peer: Direct price negotiation (Swap, even 0x has this functionality) through some private messaging platform is another route — but this could be a very slow process. Also matching would require some third party (issue of centralization) as well as price discovery could be difficult.

Reference price: Most of these decentralized exchanges would have to rely on order books/reserve prices for reference price while making a trade. However, till the point there is not enough volume and competition on the exchange, the price discovery might not be optimal, and one would have to depend on reference or suggestions of fair price by the exchange (which might source from other centralized exchange). P2P exchanges on the other hand will always have to depend on some third party (centralized exchanges) for price reference.

Below we broadly compare the key decentralized exchanges on the above metrics.

So which of these is likely to succeed? All these exchanges provide higher security than centralized exchanges, hence it is not a differentiator. What users will look for is speed , risk of market manipulation as well as transaction cost.

1) Speed: On-chain order book models (OasisDex) and P2P models (Swap), should inherently be slow, and are unlikely to meaningfully improve even with increase in volumes. Speed of exchanges with off-chain order book (EtherDelta, 0x) should be slow however, it should improve with increase in volumes. Requirement of taker signing the contract of the same size of the maker should however, have some impact on the speed. Transaction on the exchanges with reserves (Kyber) , should be instantaneous, however, this wis with an assumption of availability of adequate reserve liquidity.

2) Trustlessness: For the off-chain order books (EtherDelta, 0x), there is risk of denial of service by the order book managers, as well as potential for arbitrage for orders which have become stale on the order book. In Swap, one needs to trust the service which helps find counter parties (Indexer) as well as the API which suggests price (Oracle). In Kyber, in the initial phase, Kyber is itself the reserve provider as well as Kyber network operator decides what reserve providers to keep and what not to. Also, there is significant potential for new issues with regard to how the reserve provider will price the tokens. So all these exchanges have some degree on issue with regard to trustlessness, at least in the initial phase.

3) Finally on costs: All these exchanges with the exception of the ones with on-chain order book are likely to have low costs (exchange membership fee and/or execution fee) in addition to the gas fee for actual on chain settlement. On-chain order book exchanges have higher cost as it involves gas payment for modifying the on-chain order book.

While none of the above exchanges is without shortcomings, I believe that speed and liquidity will matter the most, which is where Kyber is better placed than the rest. However, its ability to provide adequate reserve initially (which it intends to from 50% of funds raised through ICO) and to attract additional reserve providers subsequently who can offer at competitive pricing will be the key for it to grow.

Other than the ones discussed above, there are few other interesting protocols/exchanges, which should provide speed, but would require balance sheet support — key among them are Bancor (protocol) token changer and OmegaOne. OmegaOne basically acts as an aggregator of centralized exchange, which provides users the benefits of decentralization through taking on the risks itself by balance sheet support. Bancor on the other hand uses the concept of reserves to provide liquidity. This is a very a new and out of the box concept, which I will discuss in a separate article.

--

--