Skip links

Survey of Decentralized Exchanges

Cryptocurrency Exchanges

Anyone who wants to get into the cryptocurrency market and does not want to mine blocks needs to exchange his fiat money at an exchange, the only alternative to this is to get cryptocurrency from another holder. Centralized exchanges like Bitfinex, Coinbase, Kraken, Poloniex or Shapeshift intermediate the bid and offer matching process for cryptocurrencies and crypto tokens. The users of these exchanges must store their funds and private keys necessary to authenticate transactions in their accounts on the exchange server. This accumulation of sensitive data makes their servers very interesting targets for hackers. Moreover, intra-exchange movements are not transparent.

Decentralized exchanges (DEXs) are exchange platforms built on top of blockchain technology. This means, that there is no single intermediary, but a DEX is maintained by many network nodes, and the (whole) exchange process is recorded transparently in the ledger. Users do not have to store their funds at a central entity and the fault-tolerance property of a blockchain assures the availability of the service, i.e. it is not prone to server downtimes. However, in this approach, new challenges arise: liquidity and instant trades. Furthermore — and most importantly — there might be even severe DEX inherent “flaws” which are mentioned in this very informative post, like e.g., front-running and exposure to arbitrage. Certainly, privacy is due to transparency more difficult to achieve in this approach.

In our blog post, we did an informal survey of decentralized exchange designs and compare them on an abstract level. At the end of this article, we list implementations and proposals of existing DEXs, each accompanied with a short description of its specifications.

Overview of DEX Designs

The basic functionality of an exchange or market maker consists in making a match between a bid and an offer of currencies or tokens through an order book. Once a match is found, the transfer is executed. The market maker may have necessary reserves to function temporarily as the counterparty of a trade and may suggest fair prices (price discovery). In volatile markets, this can be advantageous as the trades may be processed almost instantaneously.

Complete DEX on-chain solutions

In the complete on-chain approach, both, the match of bid-offer in the order book and the exchange of the token or currency are processed on-chain. This might be on a separate blockchain where funds are locked, a decentralized order book is maintained, and an exchange engine performs the transactions according to given rules. Or, this can be organized through a smart contract on an existing blockchain, e.g. the Ethereum blockchain, which gives the users the possibility to write their offers in an order book and the contract manages a secure exchange of tokens.

Hybrid DEX Solutions

Hybrid solutions outsource the match of bid-offer and have an order book off the chain. Off-chain matching can be organized between the peers just with a broadcasting provider or could be performed by an automated market maker (AMM) engine. In both cases, the final settlement is established on-chain.

Survey of DEX Properties

The various designs of DEX are compared with respect to the following metrics:

Trust: The need for a trusted entity. In on-chain solutions, the bid-offer matches and settlement are verified by the network nodes, and there is no intermediary involved in the whole process. If bid-offer matches are done off-chain, the correct execution of the broadcast service must be assumed so that delays do not put someone at disadvantage. Trades without AMM can be executed via smart contracts where a bid is committed through a digital signature which another peer can take by signing again the same contract. This way, no trust is needed in the matchmaking process.

Liquidity: This property refers to the degree a token or coin can be sold or bought with a stable market price. In on-chain solutions, decentralized liquidity pools or reserve mechanisms may guarantee liquidity. In hybrid solutions, this depends on the activity of the exchange market to find a counterparty. Some exchanges offer cancellation calls since in volatile markets orders might become stale very quickly.

Instant Trades:  On-chain bid-offer matches and settlement are slow as each step needs to be confirmed which depends on the confirmation time of the blockchain and whether liquidity is provided. Given that a counterparty exists, hybrid solutions can process trades faster (depending on confirmation time).

Costs: There are eventually fees for using the system when placing an order, canceling an order, or taking a bid. Every interaction with the blockchain has an additional cost, namely the fees to be paid to the miners. On-chain solutions are very costly since any step requires an interaction with the blockchain. In hybrid solutions, only cancellation calls cost blockchain fees and when a taker of an offer wants to settle the trade.

Secure: Informally, this should mean that it is very unlikely to lose money or to be subject of any misuse of its funds when using the exchange service. In contrast to centralized exchanges, arbitrage opportunities are transparent. This implies also that miners who are responsible for block insertion may take advantage of front-running, i.e., influence the transaction order to their favor resulting in worse trades for the users. In hybrid solutions without an AMM, this concerns only the cancellation calls, although the broadcast service may suppress orders to profit from exclusive access to the order book. There are more refined attack scenarios in specific implementations, e.g., maker griefing, just to name one.

On-chain (Blockchain)On-chain (Smart Contract)Hybrid (without AMM)Hybrid (with AMM)
TrustTrustlessTrustlessReliable broadcast
Trustless trade via smart contract
Reliable broadcast
Trust in AMM
LiquidityYes
(decentralized liquidity pool)
Possible
(reserves or pools)
Not guaranteed
(depends on activity)
Not guaranteed
(depends on activity)
Instant TradesMedium
(depends on confirmation time, liquidity, micro-payment channels)
Medium
with a reserve
No
without a reserve
Yes
(depends on how quickly matches can be found)
Yes
(depends on how quickly matches can be found)
CostMedium-High
(all changes are done on-chain;
depends on consensus model)
High
without reserve
(all changes are done on-chain)
Lower
with a reserve
Low
(latency in order book may takers lead to compete resulting in high gas costs)
Low
(only cancel and settle is on-chain)
SecurityMiner front-running
Exposure to arbitrage (stale orders can be filled)
Miner front running
Exposure to arbitrage (stale orders can be filled)
Miner front running
(in cancellation calls only)
Exposure to arbitrage (stale orders filled)
Suppress orders
Possible maker griefing
Possible DoS attacks
Secure against front-running in cancellation. But exposure to arbitrage risk of matching service
More complex to code
Possible DoS attacks

Note that inter-blockchain exchanges is a very demanding task and can be solved only via a separate blockchain or sidechain techniques.

Decentralized Exchanges Projects

Projects in the growing sector of decentralized exchange sector are listed here:

On-chain/Smart contract based DEXs

  1. Decentrex: On Ethereum blockchain, Ether or any Ethereum based token. On-chain order book. Maker creates an order and a taker order is one that trades against a resting order. The only fee is a taker fee. Deposit, withdraw, and maker transactions are all free.
  2. EtherDelta: smart contract overview here. On Ethereum blockchain, Ether or any ERC-20 Ethereum token. Price, volume, expiration time (measured in blocks), and signature are fixed in smart contract. Off-chain broadcast to the off-chain order book server. EtherDelta does have a backup mechanism that allows orders to be submitted with on-chain transactions. Taker takes the offer by signing the contract and contract checks signatures. If funds are available, funds are moved.
  3. Kybernetwork: On Ethereum blockchain, Ether or any ERC-20 Ethereum token with far goal to be cross-chain exchanger. Reserve to maintain exchange liquidity. Kyber contract organizes communication between maker, reserve, and reserve manager (who propose rates, best rate chosen for users). Upon agreement, funds are moved.
  4. OasisDEX: On Ethereum blockchain, EIP-20 token standard  and more. MakerOTC contract for trades includes expiration date and cancellation option. Sell and buy orders cost gas which is first deposited into the ETH token contract. No matching engine, anyone can choose amongst proposed trades.
  5. Ubitok: On Ethereum blockchain, Ether and any ERC-20 Ethereum token.
  6. CryptoDerivatives.Market.

Hybrid/Smart contract based DEXs

  1. 0x: (similar to EtherDelta) On Ethereum blockchain, Ether or any ERC-20 Ethereum token. Price, volume, expiration time, and signature are fixed in smart contract with fill & partial fill option for taker. Off-chain broadcast to the off-chain order book server. Taker takes the offer by signing the contract and contract checks signatures. If funds are available and offer is filled, funds are moved. There are tokens to introduce governance to the platform system and the option to make direct P2P trades.
  2. Swap.tech: On Ethereum blockchain, Ether and any ERC-20 Ethereum token. Off-chain peer-to-peer negotiation via Indexer with the option to call an off-chain Oracle providing pricing information to makers and takers. Taker asks maker to get an order who responds with an offer. Taker takes the offer by signing the contract. Smart contract provides the option to cancel the order.
  3. Leverj whitepaper: On Ethereum blockchain. Order book and matching are centralized and are off-chain. User deposits into segregated account on Custodian and settlement through smart contract. Allows leverage trading.
  4. Loopring: On Ethereum blockchain, Ether and any ERC-20 Ethereum token. Employ a  mechanism called “order ring” for matching orders to improve liquidity.  
  5. Token.Store: On Ethereum blockchain, Ether and any ERC-20 Ethereum token. TokenStore contract is the key exchange contract with helpers
  6. Mandarin: Early stage, little details available.
  7. Bitsquare whitepaper: A peer-to-peer to buy and sell Bitcoin in exchange for national currencies or alternative cryptocurrencies.
  8. Bitmarket: LocalBitcoin Bitcoin escrow.

On-chain/separate smart contract blockchain

  1. Bitshares: Smart contract blockchain. Industry-orientated. Price-stable smart coins.
  2. Cosmos: Inter-blockchain project based on Tendermint – DEX as a use case.
  3. EasyDEX: Cross-blockchain swap (so far only BTC and KMD), i.e. coins are exchanged directly between user wallets.
  4. NXT: Smart contract blockchain platform with asset exchange.
  5. Omega One: Smart contract blockchain. Trade engine, public/private exchange, balance sheet manager (settlement intermediation).
  6. OMG whitepaper: OmiseGo blockchain. Decentralized liquidity pool, decentralized order book and trading engine (mostly) for Ethereum blockchain. Lightning channels.
  7. PAX (Pegged Asset Exchange)  InstantDEX accesses many different sources of liquidity.
  8. Wavesplatform specifications Waves general purpose blockchain platform.
  9. CounterpartyDex explication: Platform for exchange on Bitcoin blockchain.
  10. coinffeine: Bitcoin exchange.
  11. openledger: Platform for exchange on Bitcoin blockchain with cash out through PayPal, Ripple, or NanoCard.

Hardware supported DEX

  1. Tesseract: A decentralized exchange using Intel SGX TEE.

References

If you liked this article, you might also like: