A Brief Primer on Hybrid DEX Protocols

Adam Browman
Crypto Terminal Research
5 min readNov 6, 2018

With the rise of bitcoin and other digital currencies, there has been a large demand to exchange these assets with another counterparty. As there are now over 1000 cryptocurrencies, the need to trade these tokens for speculation, or use on a network has dramatically risen. The clear winner in crypto trading are the centralized exchanges, as they are on pace to make a billion dollars in fees this year.

Until now, crypto traders have been settling, placing trust in these centralized exchanges to custody their funds in an honest manner. These centralized exchanges are central points of failure, as we have seen enormous value stolen in Mt. Gox and Coin Check hacks. This has been a costly endeavour for traders as over $1 billion has been hacked on exchanges.

Figure 1: Largest centralized cryptocurrency exchange hacks. Source

The removal of trust may alleviate some of the current pain points in trading — DEXs may provide the proper solution. To understand the benefits of decentralized exchanges, we must first explore the disadvantages of the current process.

PROBLEMS WITH CENTRALIZED TRADING

  • Security: Trading digital currencies on centralized exchanges is fundamentally flawed. As these centralized entities are always in control of user’s digital assets. Some exchanges hold upwards of hundreds of millions dollars in assets on their servers in a “hot wallet” — making it a hackers dream to steal these centralized honeypots. These exchanges are attacked day and night, leaving users funds at constant risk.
  • Transparency: Users lack transparency in how these exchanges operate. When a trader sends their coins to an exchange, they are depositing their funds into a pooled wallet. When a user trades tokens, they are merely exchanging IOUs for IOUs, which is tracked on a centralized database by the exchange. While users trust exchanges to have no malicious intent — this amount of trust provides major downside risk for users. By operating in the dark, these exchanges can wash trades, freeze user accounts and front run orders as they please. Or worse, these exchanges can be shut down by governments or even disappear with funds overnight.
  • Liquidity: Order books are siloed to each individual exchange. This fragmented liquidity leaves traders with less favorable prices.

DECENTRALIZED EXHCANGE SOLUTIONS

“Trust minimization is reducing the vulnerability of participants to each other’s and to outsiders’ and intermediaries’ potential for harmful behavior” — Nick Szabo

One solution to this legacy process is with a decentralized exchange, removing centralized trust in middlemen. There are many DEXs, all with different approaches. What they do share in common is that users never give up custody of their funds and trades are executed from users own private wallets.

Blockchains are slow and do not scale well. Placing order books on-chain, is an inefficient process because it results in —

  • Delays in execution
  • Costly modifications
  • Congests blockchain
Source

0x PROTOCOL

0x’s hybrid solution allows for off-chain order relay, with on-chain settlement — offering a more seamless execution. Trades are made using non-custodial smart contracts. A ‘maker’ creates an order that is cryptographically signed. This order is hosted and maintained by a third party called a ‘relayer’. ‘Relayers’ help aggregate orders in a clear fashion, similar to Craigslist. Once the order is posted, ‘takers’ can fill that order by signing the corresponding ‘maker’s’ smart contract. Trades are then settled on the Ethereum Blockchain at the agreed upon exchange rate.

0x’s design allows for different relayers to share order books in a networked liquidity. The result is a deeper pool of orders, which benefits traders.

Source

LOOPRING PROTOCOL

Loopring, a protocol solution for DEXs, expanded on 0x peer to peer model. Instead of trading token A for token B, Loopring Protocol allows up to 10 parties in a single trade in a circular fashion. This is called an order ring. Miners mix and match pairs and stitch them together.

Figure 2: Ring Settlement. Source

This multiple party design allows for better prices. Trading through BTC and ETH are no longer required, as there are more possible outcomes for trades. This greatly reduces trading time and fees while improving liquidity.

DEX LIMITATIONS

DEXs are far from perfect. Some of the problems with DEXs include —

  • Speed and execution are compromised
  • Poor user-experience
  • Minimal trading features

DEXs also lack proper scalability. 0x and Loopring are built on top of the Ethereum blockchain. Currently Ethereum would be unable to support a centralized exchange like Binance, better yet a digital kittens application — which clogged the network. DEXs will need to scale to survive. State channels and side chains are two solutions that are currently being explored by these protocols.

ARE RELAYERS PERMISSIONLESS?

Relayers in the 0x and Loopring ecosystem are centralized players operating in a decentralized world. These relayers permission liquidity, and while they can’t control user funds, they have the ability to front run trades and ignore orders.

WHEN WILL THE VOLUME COME?

It is no secret that there is little to no volume on decentralize exchanges — and the liquidity that is present, is fragmented over multiple different DEXs. It is hard to predict what will catalyze DEX trading growth. For the time being, it is a very crowded space as there are many agents vying for the same customers.

Figure 3: 0x Relayer Volume. Source

FRICTIONLESS FUTURE

0x and Loopring protocols are both open-source, allowing anyone to use its code. They are non-rent seeking which should align every party in the trade. Their open-order book design in which liquidity is shared, offers a true competitive advantage over other crypto exchanges.

We are entering a world where value will flow freely, and where traditional assets are becoming tokenized and traded on. The climate is enabling global liquid markets for loans, derivatives, prediction markets, stable coins, gaming collectibles, sports betting and real estate to thrive. Decentralization offers a brighter future for digital asset trading in which users may choose to maintain custody of their funds while benefiting from a global liquidity pool.

--

--