A Brief History of Decentralized Exchange

WTF
DeFi.WTF
Published in
13 min readNov 7, 2019
DeFi.wtf | A Brief History of Decentralized Exchange: Tom Schmidt

In his talk, Tom Schmidt from 0x gave an in-depth but candid overview of evolution of decentralized exchange architecture. Starting from the pre-ethereum era decentralized exchange in a broad sense: the HTLCs, the Ring Exchanges and the Native Exchanges, to the current DEX models and their respective design trade-offs.

DeFi.wtf | A Brief History of Decentralized Exchange: Video Recap

Direct link to slides here. WTFdao has edited the abridged transcript below.

I’m going to be giving a very brief history of decentralized exchange. (Some stuff had to get cut, so don’t be mad if I cut out your favorite decentralized exchange topic or protocol.) So we will be talking about:

  • Why decentralized exchange?
  • WTF does “decentralize” even mean on a spectrum?
  • The early beginnings of decentralized exchange in pre-ethereum era.
  • Decentralized exchange in the current era.
  • Where things are going and what we are seeing as trends in the industry.

Why decentralized exchange?

I’m assuming people know who this is. You are right. This is Mark from Mt. Gox. So why decentralized exchange? On centralized exchange, hacks are rampant and historically there’s been worse things like Mt. Gox, CoinCheck and Bitfinex hack, and last year Binance was hacked for quite a bit of money. Historically, custodies raised concerns. Also historically, lots of decentralized exchanges have been focused around the lack of KYC. It’s very cheap to set up a decentralized exchange and as a result you can list different types of assets and skirt somewhat regulatory barriers that might exist if you actually had to go through setting up a proper centralized exchange with proper custody.

Practically speaking, the trends that we’re seeing now is centralized exchange world where everything is insured and KYC’ed.

“I don’t really care about self custody, if my funds gets hacked, they are going to cover me anyway. So I don’t really care what their security system looks like.”

Frankly we’re seeing that the regulatory crack downs on this lack of KYC and so that even isn’t really that much of a note anymore.

So, why DEX?

  • Programmatic access to liquidity. Someone used the term “Money K’Nex”, so we’re gonna use that.
  • Simultaneously enabling the long-tail and and ephemeral markets such as Augur shares and NFTs, things that might only exist for an hour or so, or maybe even a small amount of time that just don’t make sense to go through a listing process for centralized exchange.

What does “decentralized” mean?

There’s a lot of different elements to a decentralized exchange that can be either centralized or decentralized: custody, listing, liquidity, trade execution. These are all different things that can be, trusted to a centralized entity to perform, or consider decentralized and trustless. These different approaches have different trade offs but we’re going to sort of lump all these under “DEX” for now. I think a lot of people use different terms like hybrid exchange and things like that.

From a timeline taxonomy perspective, post Mt. Gox, there’s basically three different sort of flavors of DEXes:

  1. Different types of HTLCs that enabled decentralized trading.
  2. What I would call as “native” decentralized exchange.
  3. Ring exchange such as Shapeshift and Changelly.

The first wave of of decentralized exchange i would say are in this flavor of HTLCs. It’s a way to trustlessly perform atomic swap of two different assets, without having to go through a centralized party to do so. So you have companies like LocalBitcoins and Bisq, that basically allowed two different people to find each other off-chain, and then use an HTLC to actually performed the swap.

So, you get this decentralized approach where I can custody my asset, I just find someone else and then we trade directly peer-to-peer, and these are platforms really simplify it and provide a platform for finding a counterparty. So functionally speaking actually works quite well. I think practically speaking, it’s expensive, slow and inflexible. It is still used today.

LocalBitcoins actually had a record volume about couple months ago. So, from just a pure functional DEX perspective, HTLCs are still pretty widely used, and somewhat popular.

The other flavor of DEX are these ring exchanges. Simply, you send funds to a centralized entity, they wait for sort of a counter trade to come in and then match the two together.

So I want to trade my Bitcoin for ETH, I sent my Bitcoin into Shapeshift, someone else wants to trade ETH for Bitcoin and send their ETH into Shapeshift, and then Shapeshift simply switches them for us. It’s not really decentralized or trustless.

But previously this was thought to be on a non-custodial exchange and therefore not regulated under a lot of the same rules that normal exchange might be. And what we’ve seen is that is actually not the case. They are custodying your assets, even just for a brief period of time, so they’ve now started to implement KYC that you know normal exchange would have to implement, and as a result I think we’ve seen volume drop off precipitously for things like Shapeshift and Changelly.

The last bucket in this early wave of DEX is what we call a Native DEX. So, these are actual blockchains that are built for the specific purpose of being a decentralized exchange. So these are things like BitShares or Waves, where it’s a DPoS blockchain so you have the throughput that you need to actually operate an exchange. But it’s a custom blockchain. It’s the BitShares blockchain that is just created to actually facilitate decentralized exchange. As a result, you do have this separate blockchain you need to find some way to, get assets onto it that people actually want to trade that are interesting in some way. There’s really a lack of native tokens.

  • One way is these usually get created through custody. For example, on Stellar DEX there is a number of different custodians that will mint you Bitcoin or mint you USD that you can then go use to trade.
  • Or through synthetics. so actually the first synthetic US dollar was actually on BitShares, but I think at the time you know the market was not really robust and we’ve seen that it actually really struggled to hold its peg. I think it’s still frequently trading either massively blow or massively above its peg. BitUSD that is. So you get sort of that decentralized element that you want. But, you’re missing a lot of the actual assets that people want to trade which sort of defeats the purpose of having a decentralized exchange.

So, if you look forward to to the current day, HTLCs and using HTLCs is to perform decentralied exchange still very popular method, and we see Arwen, Summa, Sparkswap, still pursuing this and seeing good volume with it.

Out of the early wave of native DEXes in the post ethereum world, we see two different technical approaches to DEXes come out of it. One being an entirely on-chain approach, and one being some sort of off-chain or hybrid approach. So on-chain being OasisDEX, off-chain being EtherDelta.

So, OasisDEX’s completely on-chain order book, built by Maker to ensure liquidity for DAI and MKR, migrated their contracts in early 2019 to remove MKR, transitioned to ETH2DAI. but surprisingly these old contracts are actually still alive and still get used to like a minor extent to to trade MKR. So, you sort of have the philosophy and architecture of someone like BitShares or Waves, but built on top of Ethereume . So you get totally decentralized, censorship resistance. But with this minor cost of actually having to pay transaction fees constantly on Ethereum, which is much more expensive blockchain to use than any of the DPoS chains that we have seen coming out.

The other fun fact about Oasis is that it is still the largest ethereum DEX by volume. They do more US dollar volume than like any other DEX, which is pretty strong testament to the power of DAI and the power of liquidity.

The other sort of DEX architecture is EtherDelta that really pioneered this off-chain relay, on-chain settlement methodology which we will get to in a little bit. This was a breakthrough in that you get performance and you get sort of the flexibility that you would want from a centralized exchange.

We started this self custody, that you want from a decentralized exchange. So in many respects you get the best of both worlds. Practically you still need a centralized order book operator but you know there’s not custody risk that you had with some early centralized exchanges that got hacked. The worst decentralized order book operator can do is censor you or take away your ability to trade but they are never going to be able to steal your assets.

I think what we’ve seen is that you know the regulatory status for some of these things are kind of unfavorable, as we saw with the SEC settlement with EtherDelta. So you really need to separate actually building the software from actually operating the software, in order to get a true argument for decentralization, especially when you’re the one actually matching or filling orders. So I would say again, you know, these are sort of the grandaddies of Ethereum DEXes, and then came a couple different sort of flavors.

So on the on-chain side you have AMMs like Bancor and Uniswap. You’ve more on-chain orderbook-esque DEXes like Kyber, and the auction world you have people who end up fully verticalized, building protocol, UI and an application such as Airswap and Ddex. And then you have projects that take more of a platform approach, like 0x. So, the off-chain relay and on-chain settlement protocols are great: really flexible, really cheap way to actually be trading and double down on it.

So even within the on-chain order relay, there are many different ways actually do off-chain relay: through open order book, quote providing, and order matching etc.. But all under the same flavor. I think the downside here obviously is that you still have this centralization risk where someone with some server is actually do like hosting this order book somewhere and you don’t need market makers to provide liquidity. It’s a lot more like decentralized exchange in that respect.

Again, I think sort of flavors that we’ve seen are either: I’m coming up purely with protocols such as 0x or Loopring, and then allowing other people to go out and build applications on top of it.

Or people like DDex and Airswap which had built an protocol and an application and gone totally vertically integrated. Again the benefit being, you get full control over the user experience, full control of the liquidity. But the downside being it might be not as regulatory favorable approach to just building the software.

Some of the other flavor on the on-chain side that we’re seeing that get a lot more popular a lot more exciting these days is automated market makers. So, off-chain order book models still require market makers, and central operators to actually, make these things usable, can be kind of expensive and difficult to start, you can’t just put the software out there and let it go.

There needs to be taking a lot of massaging to make this whole system work really well. AMMs on the other side, once you deploy the contract and put some funds in it, it just sort of works right, anyone can provide liquidity, and you can trade on it on it. It’s actually very simple. The downside here obviously being that it’s not super capital efficient so you do get pretty high slippage for reasonable orders. You also get sandwiching and front running. We’ve seen a couple interesting blog posts about how to sort of breach these kinds of systems when all the logic and all the trades are transparent, but these are being mitigated over time and slowly going away. It also requires large amount of retail volume to remain profitable, which is true for market makers in general but I think it’s especially true for AMMs.

As I mentioned Bancor really popularized this approach. But in my opinion it was really handicapped by its really poor token model, and a couple hacks that revealed vulnerabilities the contracts with the BNT token. And as a result, its market share now is quite small things around 2% per day. Uniswap on the other hand, sort of took what I think the strength of an AMM approach, and really build it more as an open source software that anyone can use it. It’s really more of a public good. And now we’re even seeing people like balancer taking Uniswap model and extend it to indices of tokens so it’s no longer just on a single pair.

On-chain order books, take what Oasis really popularized with respect to like putting order book on chain, and sort of generalize it. So it no longer literally just an order book but it’s any sort of on-chain liquidity can be wrapped on and deposit it and serviced through Kyber. You also get the always-on contract-fillable liquidity. But with it with the cost of having on-chain updates all the time. There’s a version also seem to be pretty popular in that Kyber does about 10% of Oasis or Uniswap volume on any given day. So you abstract out all the other liquidity providers and you can sort of own the top of the funnel.

Where we are going when we’ve seen getting a lot of traction in the past couple months is aggregation . People like 1inch, Totle or Dex.ag. We’re seeing people become a lot more price sensitive and UX sensitive go for aggregation.

This is sort of obvious in retrospect. This is aggregation theory, which is, we can commoditize supply by owning the top of demand. And this is the way the internet operated for the past 20 years, for those of you who booked flights today you probably don’t go to United.com, but you go to Expedia or Google Flights, and just search for the best flights. You just want the cheapest price, the best price. So think Expedia amazon for suppliers, Facebook for news etc. You can own the top of the funnel, own the demand and you sort of commoditize out all the suppliers underneath yourself. So you really want to be above the API here, and I love the API.

You know when applied to DEXes, it’s really all about the interface and how people actually end up going, consuming liquidity. So DEX has really become liquidity suppliers in this world, and really need to compete on the best prices, and the best assets to actually survive.

DEX.AG and 1inch comprise about 4% of all DEX volume, which is a pretty tremendous rise given that they really just launched two months ago, three months ago. So people are moving towards this model where they put in a single type of trade they want to make. And these products are able to multiplex their their fills and their orders across all the DEX protocols to ensure they get the best price, similar to how I say, I want to go from SFO to Tokyo, and I get the best price from all the airlines that exist. So you have this liquidity arena where all the different DEXes compete to offer up the best prices, so that it gets selected and it can do the most volume.

What does the future hold? Post aggregation for Ethereum going forward. I think a lot of the layer 2 developments break a lot of assumptions assumptions that we had today about DEXes, with respect to, easy to facilitation of contract fillable liquidity across different DEXes across different protocols. That’s probably problematic because a large increasing percentage of DEX volume is being filled by other smart contracts. This looks like DyDx, for example, using Oasis or using 0x to actually rebalance or open positions. That becomes problematic when these different types of contracts are hosted on on different chains or different shards.

I think also what we’ve seen is DEX volume is still quite a ways off from actually matching CEX volume. I think we need to, you know, take some the different value props of decentralized exchange or actually make this really compelling to people: that we can no longer rely on self custody and lack of KYC.We are seeing those sort of advantages, those sort of those notes are going away, and really what’s going to look like for next going forward is being able to serve programmatic liquidity and access to the long tail markets.

Please contact@tzhen on Twitter for corrections.

DeFi.WTF Osaka was the first of a series of WTF events, traces the emergent DeFi stack and explores its implications through in-depth conversations with the space’s main actors.

About WTF — the Power of Asking: a modern resurrection of the Greek Pnyx, to build a supportive space for open, inclusive, informed, and thoughtful exchanges of ideas, for the practice of the ancient art of asking the right questions to move beyond hype and arrive at knowledge.

Stay in Touch:

--

--