Decentralised Exchanges (DEX): What? Huh? How? Why? Oh!… Huh…?

Colin Platt
Sep 5, 2018 · 8 min read

Continuing on my mini-mission to create a mini-series of crypto financial markets related posts, I wanted to embark on the topic of decentralised exchanges (“DEX” for the cool kids).

The two themes that stood out for me in 2018 in the world of crypto as being “hot shit” and equally “hot turds”, are stablecoins and decentralised exchanges. My friend (and Marmot aficionado) Preston Byrne, amongst others, have written far more coherent reviews of why stablecoins may not be the Land of Milk and Honey that Silicon Valley VCs with more Dollars than Sense looking for…

Alas, that leaves me breathing room to attempt to evaluate the dumpster fire that is DEX. So let’s first lay down a short history of what decentralised exchanges are, and where they came from.

Dan Larimer and his projects (https://hackernoon.com/dan-larimer-visionary-programmer-of-bitshares-steem-and-eos-7e6d94b241d7)

According to my history books, the first attempt to create a decentralised cryptocurrency exchange of any description was the Dark Exchange in 2011, though you could argue that early attempts to transact for Bitcoin and cash in person, or even pizza could also fit some people’s definition of the term. A few years later, in early 2015, the first implemented decentralised exchange was Dan Larimer’s BitShares. Fundamentally, decentralized exchanges, such as BitShares sought to move away from the risks of centralised exchanges (see Mt Gox) and open the floodgates to new trading pairs (including stablecoins).

The more astute reader will know the name Dan Larimer, from other projects, such as EOS and Steemit, and some of you may even know of his famous interaction with Satoshi Nakamoto, in which Satoshi said to Dan: “If you don’t believe me or don’t get it, I don’t have time to try to convince you, sorry.” Fun crypto-trivia, this comment came on the back of Dan arguing for a “bit-bank” which would move transactions off chain and into a form of centralised custody, requiring “some level of trust” due to inherent scaling and transaction rate issues in the Bitcoin blockchain. Plus ça change…

As we saw in my last post, the cryptocurrency world has built itself around the model of the “fully-integrated” exchange-clearinghouse-custodian, which farts in the general direction of the common wisdom developed by the financial markets from literally centuries of painful and expensive lessons. With this context in mind, the goals of decentralised exchanges boils down to two objectives. Removing the centralised entity which operates the life cycle of a trade, and reducing the need for custody by a third party entity (and thus removing the ‘honey pot’, where a bad actor can steal your, and everyone else’s coins). Having watched Mt. Gox’s collapse, Bitfinex and Coincheck hacks, it’s more than understandable why some are seeking to improve the model.

This brings us to definitions. Considering the millions being poured into these solutions, it is surprisingly difficult to find a decent definition for what a DEX is, so here’s what I grabbed from CryptoCompare:

A decentralized exchange is an exchange market that does not rely on a third party service to hold the customer’s funds. Instead, trades occur directly between users (peer to peer) through an automated process. This system can be achieved by creating proxy tokens (crypto assets that represent a certain fiat or crypto currency) or assets (that can represent shares in a company for example) or through a decentralized multi-signature escrow system, among other solutions that are currently being developed.

The main takeaway from this crude (and really rather broad) definition, is that DEX seem to rely on the “Hinman Test” of “sufficiently decentralized” to form an orderbook, match orders and execute trades, or some combination or subset of that list. Though I suspect that we will ponder the exact specs of this test, what it seems to mean is that when the proverbial shit does inevitably hit the fan on these platforms it is less obvious who will/can fix the issue.

Since the 2015 launch of Ethereum, the hype and hubris around DEX seem to have only grown louder. This kind of makes sense, Ethereum (ETH) became the de facto home of ICO tokens in 2016 following the formal codification of the ERC-20 token standard, coupled with the quasi-Turing complete functionality built into the Ethereum platform which allowed for DEXs to be written in just over 300 lines of code.

Three varieties of the first generation DEXs on Ethereum, EtherDelta, 0x and Radex have been built around different models (there are arguably other models that exist, such as Bancor, but perhaps another day):

  • EtherDelta (ED) — Is very much a hybrid between the Centralised Exchange world and the DEX world. ED relies on Ethereum to offer a majority of the post trade functions within an exchange, whilst building an orderbook on a centralised service. In short you keep you stash of coins in your wallet, then lock them in escrow which can be used to facilitate a (delivery versus payment) DvP transfer of tokens. At its base, the idea is kind of logical and not immediately craptacular, though it falls down when you consider that just logging into that centralised service brings about the same security implications as centralised exchanges with none of the protections offered by someone with a kill switch (even if we can debate the efficacy of such functions)… SFYL. Since the hack, and change of direction away from open-source a copycat of ED, ForkDelta has displaced ED… SF-their-L… Another issue to point out is that if you submit an order to ED then decide to cancel it you need to pay a mining fee (gas), which means that market making on highly volatile assets is not only dangerous but expensive. IDEX, currently the most popular DEX on Ethereum, utilises a similar model to ED but moves even more services to the centralised service, placing the entire order life cycle off chain, then facilitating the transfer through the blockchain, and requiring a mining fee for every successful transaction… ka-ching!
EtherDelta: SFYL-as-a-Service?
  • 0x Protocol — One of the more intellectually interesting platforms takes the ED model of routing post trade operations on the Ethereum blockchain, and then moves the orderbooks to a new network of relayers. These relayers are themselves a cartel of centralised services that work together (at least in theory) to form a “shared liquidity pool”, neologism for something like a multi-dealer platform (MDP). Much like ED, these services themselves risk being compromised, but with the kicker that the 0x protocol be found to have a bug that replicates across the entire network compromising a larger network, somewhat akin to the DAO exploit. YAY! The other fundamental question here is why a relayer would want to share their liquidity with other exchanges when this is generally what most exchanges zealously guard as it is literally how they make money, but whatevs… kumbaya capitalism!
  • Radex — The absolute dunce of the group, Radex decided that absolutely everything needed to be trustless and slapped it up on the Ethereum blockchain, and just to make sure they did it on Ethereum Classic too. Radex uses smart contract calls to a blockchain for everything. single. thing. it. does. This means that if you want to submit an order, you send it to Ethereum and pay a miner, Change your mind and want to cancel, that’ll be another mining fee. Partial order execution, pay a few more mining fees. Another added benefit to using a blockchain to post your orders (from the same address where you hold your coins) is that literally anyone can see all the details of your order history and trading intention, making it quite easy to determine your position and intentions. If, against all odds Radex ever had any liquidity to speak of, any miner plugged into this platform could also decide to process their own orders ahead of those coming from the market, free money. As you could imagine, any serious (or half-competent) market maker considering this platform should have their head checked. I guess that it isn’t surprising that their ICO only raised about 5% of their initial target, and decided to move their ICO over to Ethereum Classic for another go. Well done everyone!
DappRadar DEX volumes (3 Sept 2018)

So let’s recap. All current DEXs rely to some degree, on using a blockchain to move some, or all of the processes within the life cycle of a trade (Execution, Clearing, Settlement) onto a blockchain. As I have pointed out previously, actually using a blockchain is bloody expensive. Perhaps this partially explains why, though they both generally ignore regulations, Binance has managed to garner the more liquidity than any DEX, despite having been around for less time. And while they may reduce the likelihood of a bad actor accessing an omnibus wallet of custodied coins (many coins held on behalf of multiple clients) within a centralised exchange, they may not be impervious to other equally devastating attacks. Given their early stage of development, regulations have yet to consider the implications of abuse on these platforms, some of which seem to have been designed specifically to facilitate.

Naturally the next question, is: “but this is only what exists today, couldn’t it improve in the future?” No, no it can’t.

Whilst promises of scaling to blockchains may eventually be delivered making transactions cheaper and faster, using a blockchain for anything earlier than the clearing and settlement process will allow for an unaccountable network of miners/stakers to decide which transactions get processed and which ones don’t. The fact that these validators are dispersed across the globe mean that there is no way to tell where your transaction will be received for validation. If meaningful liquidity ever did appear math for co-location becomes even more exaggerated than under the assumption of a centralised order matching process, but that’s another post for another day…

Bottom line, DEX probably won’t go away, but their future is likely built around either ideological types (until they run out of money for throwing it at ideological solutions + trading too many shitcoins), extremely small transactions between otherwise unquouted trading pairs, and traders who cannot manage to get KYCed on even the more lax of exchanges. The last group actually get the reason for using a blockchain (hint: censorship resistance).

So in conclusion, I leave you with my DEX investment thesis:

Next up: You, me and custody…

Colin Platt

Written by

Et c’est une folie à nulle autre seconde — De vouloir se mêler de corriger le monde. PTK.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade