DeFi and trading assets: decentralized exchanges

This is the third part of our series on DeFi and explains why we cannot truly decentralize finance as long as we do not use decentralized exchanges. You can read our intro to DeFi here.

Centralized exchanges make crypto finance a hypocritical antithesis to its own fundamental promise. Large hacks keep stealing millions of coins and tokens from centralized crypto exchanges week after week. They show why we need blockchain technology: centralized systems are central failure points.

Preserving centralized control over the access points into the decentralized financial system is not only dangerous, but it also betrays the idea of having decentralized assets in the first place.

In the presence of Binance, Bitfinex, Coinbase and the like, access to and control over assets does not lie with the individual.

For users to abandon them, however, other models must show that they are better.

The solution is embracing more decentralization. Many different approaches to decentralizing exchanges exist. They offer security by taking away the single failure point of centralized token and cryptocurrency storage and returning control over funds to users. Through decentralized trade mechanisms, they may create a global, incorruptible, price-driven marketplace.

The Three Approaches to Decentralization in Exchanges

At a high level, three distinct approaches to decentralization in cryptocurrency exchanges exist:

  • Bancor’s unique project which has created smart tokens that hold several coins and use algorithmic price discovery mechanisms.
  • Reserves to pool liquidity with smart-contract based trade mechanisms, like KyberNetwork and Uniswap.
  • Open protocols like 0x, which allow decentralized applications to run the order books and allow for liquidity aggregation.

The order book problem

A big obstacle for decentralization of trade marketplaces is how to deal with order books. They are lists where traders post buy and sell requests.

Individual users and especially market makers — traders who bring liquidity to markets and put buy and sell orders for many different assets or tokens — add or remove orders constantly. The sheer amount of trading orders is too much for an on-chain solution to handle.

The first intermediary solution is Bancor’s smart token, which operates the exchange itself.

Bancor not only eliminates the third-party broker, but also the exchange trading partner.

To exchange a token, a user only needs to interact with a smart contract that holds tokens in reserve, and so trades do not need to rely on the presence of other offers.

However, the Bancor protocol encodes and influences the price discovery algorithmically within its own tokens, which limits liquidity and market efficiency.

The reserve pool solution

Reserve pooling is the next step from Bancor’s solution. Kyber Network, the most prominent example, attempts to balance an open, decentralized exchange market with liquidity provision.

Similar to Bancor, individuals directly exchange tokens with the KyberNetwork smart contract.

The system does not have a self-enforcing token but rather a price mechanism where multiple reserve pools offer crypto assets and set different rates.

Different reserve entities can bring liquidity to the platform. They do not create order books to match buyers and sellers, but merely provide tokens for potential trades at pre-set rates. The smart contract then chooses the best exchange rate for the users and executes trades, so reserve contributors have an incentive to set fair rates.

Reserve managers are responsible for setting a reserve entities’ exchange rates and create spreads within them to earn some profits, which they share out with all contributors to the reserve entity. The network also rewards reserve entities for bringing liquidity.

Uniswap is a new protocol replicating Kyber Network’s approach with more efficient gas costs and a more accessible user interface.

Although reserve pools solve part of the liquidity problem and can grow fast if large pools join the network, they still do not create a fully liquid market.

As reserves need to submit prices to the contract on-chain, they cannot update to market movements more rapidly than the on-chain transaction speed, which can block perfect price discovery when many traders are on the network.

Liquid decentralized trade settlement

To preserve an open and discoverable market, the most promising solutions still maintain off-chain order books that match buyers and sellers.

One of the first decentralized exchanges was EtherDelta. The platform secures tokens in smart contracts and thereby decentralizes token storage and exchange. However, they still have a centralized order book and matching mechanism for traders are to provide the necessary transaction speed.

0x, one of the most respected projects in the crypto space today is an open protocol which aims to incorporate players like EtherDelta to allow a dynamic and more liquid market than any other solutions.

In the network, agents like EtherDelta are called relayers. They offer their own off-chain order books on top of the network and do the matching of buy and sell offers while all trades run on the baseline protocol’s smart contracts, which cryptographically secure both the order books and the trades.

How 0x relayers work

Relayers help with matching makers and takers of trades.

While the off-chain order book ensures speed of maker-to-taker matching that is impossible on-chain, the presence of a variety of relayers decentralizes the system and reduces central fallibility.

With relayers, makers and takers do not interact directly anymore. Instead, (1) relayers show their transaction fees, and (2) makers can choose between relayers to make a bid for buying or selling a token, selecting whatever price they are ready to pay. The choice makers have between different relayers creates an incentive for low fees.

The maker sends an order to the relayer containing their address and the bid (3), and the relayer posts this on their order book (4). Just like the makers, the takers browse different relayers’ networks and search for orders they want to take (5).

If they are happy with an order, the taker sends their address, the fee and the exchange funds to the Ethereum smart contract, and the contract automatically executes the transaction, as well as the fee payments (6).

In the world of decentralized finance, 0x is the equivalent of what would be a stock exchange like NASDAQ for traditional finance: an open-source marketplace where brokers facilitate trades can between individuals.

Relayers take the place of brokers, and secure and global smart-contract based transactions improve on the restricted and centralized trade settlement practices of today.

Liquidity

The biggest remaining problem for these ideas and protocols has so far been liquidity. Even though they are promising, their open and market-based design means that they cannot take initial capital and create money markets immediately like centralized exchanges, but rely on user growth for success.

The year 2018 has finally seen increased adoption of some of the most prominent decentralized exchanges. Kyber, 0x, and Bancor combined broke the 100,000 monthly trades barrier this past November, and their growth is picking up the pace.

Bringing decentralization mainstream

Although they are still much smaller than their centralized counterparts, hacks and the arbitrariness of centralized access points should convince more people to use them and thus bring liquidity and positive network effects that make their use even smoother.

Decentralized exchanges are the entry point and central marketplace of DeFi and their robust structure can power a better adoption of open, smart contract-based finance.

The creators behind these protocols are true believers in open access to trade settlement, and their ideas finally enable a truly decentralized exchange of assets. It’s time for the public to jump on board.