Blog

A CEX vs DEX comparison: Why is dYdX moving to Cosmos?

Luis Nuñez
Luis Nuñez
August 9, 2022
5 min read
August 9, 2022
5 min read

This article provides a brief comparative analysis between centralised exchanges (CEX) versus decentralised exchanges (DEX). This will be followed by a comparison of various DEX exchanges to understand why dYdX has opted to join the Cosmos ecosystem. The primary reasons are increased decentralisation, higher throughput, and a developer-friendly SDK.

PART 1 — A DEEP DIVE INTO EXCHANGES AND HOW TRADES ACTUALLY HAPPEN

To help you grasp the subsequent arguments and comparisons, we’ll first go through the key distinctions between a CEX and a DEX. If you already know the distinctions, skip to Part 2 of this article.

Centralised Exchange (CEX): a type of cryptocurrency exchange that is operated by a company that owns it in a centralised manner. Liquidity is supplied by traders in the form of orders (order book model) that keeps the assets involved in all respects in their custody (e.g. Binance, Coinbase). This method gives the CEX a significant advantage since order placement, matching, and settlement can happen immediately off-chain (even if you then have to switch to the Blockchain in effect to move them to a personal wallet).

Decentralised Exchange (DEX): a platform for exchanging cryptocurrencies based on functionality programmed on the blockchain (i.e., in smart contracts). The trading is done peer-to-peer or between liquidity pools. The liquidity in DEXs (Uniswap and dYdX) is given by the users themselves, who contribute the tokens to a specific pool in return for the fees paid by all those who swap the tokens.

Whereas in CEXs, the user trades directly with the platform and purchases the token of his choice with fiat market availability, the scenario is somewhat different in DEXs. To get a token, a user must swap it for another token pair with a liquidity pool of those 2 assets.

Centralised exchanges enable buyers and sellers to submit bids and asks for specific assets via order books (e.g. cryptocurrencies). Order books still exist on a decentralised exchange, where a user may submit a bid or an ask. However, we often see an alternate option where a user can trade without a counterparty via an automated market maker (AMM). An automated market maker uses a mathematical formula known as a ‘constant product’ to calculate an asset price at every moment by calculating x * y = k. (without bids and asks having to be actively placed). This is possible because market makers on decentralised exchanges are referred to as ‘liquidity providers’ (LPs). LPs place assets in a smart contract and authorise the contract to be traded against. In exchange, an LP receives fees based on the amount of liquidity offered versus the whole pool. In general, using Uniswap as an example, the user must have Ethereum in order to trade with Compound, Curve, and many other services. By doing so, the user pays a 0.3 percent fee directly to the pool where he swapped the token, which is then distributed among all liquidity providers.

Other significant differences between CEX and DEX

  1. Listed Coins/Tokens: DEXs provide a significantly wider range of tradeable assets. This is because listing coins/tokens on such exchanges requires very minimal verification. Users may trade almost any asset in DEXes, but how can they know which assets are safe to trade? Conversely, centralised exchanges generally only trade a restricted variety of assets as there are several processes involved in listing an asset on a CEX.
  2. Governance: It is an area in which the DEX differs the most from the CEX: Governance — and therefore decision-making activities for the majority of public elements — are in the hands of users and holders who express their view via a vote using the governance token, UNI or dYdX. Obviously, unlike on a DEX, the choice on centralised exchanges lies on the platform owners and whitelisted access to certain parties, who make their own judgments.
  3. KYC: Centralized Exchanges are always under the radar of governments and regulatory entities. For that reason, the users of such exchanges should pass through the different types of identity verification before starting to use such platforms. On the other hand, decentralised exchanges — as the name suggests — are decentralised. This means that, in principle, no entities can monitor their activities. Hence, it is not necessary to pass through any KYC or similar verification processes to use DEXes.
  4. Ownership of assets: Centralized exchange users do not own their assets. You must be aware that the exchange is the genuine owner of your private keys, and you choose to trust them with them. However, decentralised exchanges do not keep your funds. Users connect their own wallet to such exchanges and start trading. Thus, the user is the actual owner of their possessions.
  5. Availability: Third parties run centralised exchanges. Such systems may collapse at any time. It has occurred before. Many CEXs, for example, restrict user access during market crashes to reduce their own losses. We have seen this happen with Celsius and others in the current market conditions. DEXs, on the contrary, do not have intermediaries and remain open no matter what occurs in the market. However, DEXs have various infrastructure and interfaces that might crash.
  6. Easy of use: Centralized exchanges are more user-friendly. As a result, users do not need to bother about creating wallets or connecting them to exchanges. Conversely, decentralised exchanges’ interfaces provide limited (now expanding) possibilities. Trading on a DEX is also more difficult for new traders.
  7. Security on trading assets: Centralized exchanges often have rigorous procedures for adding new assets. This decreases the hazards of working on risky projects. Meanwhile, decentralised exchanges lack such standards, leaving consumers with more responsibility to assess the security of various initiatives.
  8. Security on funds: Centralized exchanges own users’ private keys. They are also vulnerable to external hacking. The good news is that some of them provide insurance. Decentralised exchanges do not deal with asset ownership, therefore users do not risk losing their cash in this manner.

Orderbook vs Liquidity Pools

Now that we’ve established the primary distinctions between CEXs and DEXs, we’ll look at two sorts of exchange transaction mechanisms that are frequently observed on these exchange platforms.

What is an order book in crypto?

The orderbook concept is the foundation of many CEX and DEX’s (in the case of dYdX) operations. All orders to buy and sell a token are labelled “Bid” and “Ask” in the order book system. The spread is the difference between the highest bid and lowest ask at the top of the book. If a person buys or sells rapidly at the best price available, the order is known as a market order, and the buyer and seller are matched based on top of the book orders. A limit order, on the other hand, is when a person buys or sells a token at a certain price such that the order is posted on the order book.

Pros:
  • This technique works well in liquid markets with a wide range of buyers, sellers, and market makers.
Cons:
  • It does not work in non-liquid marketplaces since a person cannot trade if the highest bid is lower than the lowest published ask.
  • Miners may see your transactions since you must upload them to the blockchain before making an order on DEX. Your information allows miners to make an easy profit by putting a purchase order in a block if it forecasts that your order will cause the price of a token to rise (MEV frontrunning).

What are Liquidity Pools in crypto?

A liquidity pool is a collection of money put by LPs into a smart contract. AMM transactions allow you to purchase anything without a seller as long as the pool has enough liquidity and your trade affects the token ratio computed by the algorithm. This approach does not need an order book. Although both LPs and order books operate on a peer-to-peer basis.

Pros:
  • Liquidity is independent of the sequence or pool size
  • Automated pricing reduces the need to acquire data from exchanges to calculate asset prices
Cons:

This strategy is problematic due to the high amount of slippage for big orders, which necessitates gigantic pools. Uniswap V3 reduced this problem by implementing the concentrated liquidity functionality. Liquidity providers concentrate liquidity in the most likely trading prices rather than spreading it across the entire price range.

We are also now starting to see the rise of hybrid initiatives which combine AMMs and orderbook models in an attempt to extract the best of both worlds. The Cosmos ecosystem is beginning to stand out in this area too, with upcoming protocols such as Onomy.

PART 2 — ANALYZING THE TOP DEXES

The cumulative decentralised exchange volume for the past 7 days stands at $10 billion. Uniswap, yet again, led the pack in trading volume.

dYdX’s current trading volume closely resembles Uniswap’s and ranks 10th in ‘Token Holders by DeFi projects’.

However, it is worth noting that the ratio of DEX:CEX spot volume reflected a mere value of 13% for the month of June, noting a decline from 16% in January. Binance, with significantly lower fees, still dominates the market ($11bn 24h volume). This data clearly highlights that decentralised exchanges are merely complementing centralized exchanges that still account for the lion’s share (trading volume).

Despite this, Uniswap has repeatedly surpassed Coinbase in trading volume in the past. In terms of token trading availability, the former dominates with 430 verified coins in V3 and over 8000 trading pairs in V2.

https://xangle.io/en/research/62c28da8534a07d0b2ffb715

While Binance currently supports trading in more than 600 coins, Uniswap V3 has significantly more liquidity than Coinbase and Binance. However, this is unique to Ethereum and its many pairings.

https://ambcrypto.com/how-uniswap-uni-dominates-binance-coinbase-in-terms-of-liquidity/

Uniswap provides double the liquidity of Binance and Coinbase for ETH/USD. Uniswap boasts 3x the liquidity of Binance and 4.5x the liquidity of Coinbase for ETH/BTC. It also possesses three times the liquidity of large centralized exchanges for ETH/mid-cap pairings. NB: A larger liquidity is required in decentralised exchanges to avoid considerable spreading with big trades.

dYdX vs Uniswap

dYdX and Uniswap are both DEXs that operate on the Ethereum blockchain.

What is Uniswap?

Uniswap is an open-source DeFi platform that employs an automated liquidity protocol paradigm instead of an order book. LPs (Liquidity Providers) construct this pool with no listing costs. Any ERC-20 coin may be created if a liquidity pool is accessible for traders.

Factory and Exchange are two Uniswap smart contracts. Factory contracts help introduce new tokens to the network, while Exchange contracts help exchange tokens. When a Liquidity Provider puts a pair of tokens into a smart contract, other users may buy and sell this trading pair, and the liquidity provider receives a cut from the trading charge.

What is dYdX?

dYdX is a non-custodial decentralised exchange that uses Ethereum smart contracts to trade. This allows traders to trade on margin while simultaneously benefitting from Ethereum’s security.

dYdX teamed up with StarkWare to create a Layer 2 protocol. Traders may deposit money and trade instantaneously without incurring transaction costs. Following China’s reiteration of their stance on banning cryptocurrency, daily trading volume surged to nearly $10 billion on dYdX, beating Uniswap for the first time in September 2021. Later, dYdX lost a significant amount of its market share due to competition and outage problems which questioned the integrity of the protocol. Despite this, being the first perpetual DEX protocol to implement a Layer 2 solution has certainly paid off.

Derivatives trading is a trademark of dYdX. Compared to spot trading, derivatives trading offers more application possibilities, which may help customers adapt to changing market trends, increase profits, hedge risks, improve resource allocation, etc. Derivatives trading is projected to add new incremental users, more live water to the market, and set the groundwork for a fresh DeFi breakout.

Recently, dYdX announced that the protocol is moving to Cosmos to build its own native chain on Cosmos SDK and Tendermint Proof-of-stake with the hopes of regaining the market dominance it once had.

PART 3 — WHY IS dYdX MOVING TO COSMOS?

Here is how and why the move is set to achieve full decentralisation, seeking to solve the problems dYdX had in the past:

Cosmos makes it easy to establish a blockchain with cross-chain capabilities leveraging the Cosmos Tendermint proof-of-stake consensus engine. Cosmos is decentralised and customizable and each Cosmos chain has its own validators and staking token. Other alternative L1s or L2 would not be suitable for dYdX because they are incapable of handling the throughput that dYdX requires (10 operations/second and 1,000 places/cancellations per second).

Because app-specific chains in Cosmos are not dependent on other protocols in the network, network congestion experienced in Ethereum is not a concern. Projects can also benefit from Interchain Security from the Cosmos Hub to increase stability and security.

dYdX contemplated constructing an AMM or RFQ system, but realized an orderbook-based protocol was essential for pro traders and institutions. As such, dYdX concluded that an improvement requires a decentralised off-chain network to handle the orderbook.

While Serum on Solana does create the order book exchanges on-chain, Solana trades centralization for greater speed. dYdX wishes to achieve faster transaction processing while maintaining decentralisation, which is a tough task. Enter Cosmos.

Developing a blockchain for dYdX V4 allows full customization over how the blockchain functions and validator duties. As indicated, Cosmos’ chain may be tailored to the dYdX network’s demands. Traders would pay fees based on deals performed, comparable to dYdX V3 or other centralized exchanges. Cosmos will also bring a greater utility to the current pure governance $DYDX token.

Comparison between Cosmos and Starkware/L2s

What is Cosmos SDK?

One of the most differential aspects of Cosmos is its SDK. The Cosmos SDK is a collection of tools and frameworks created by the Cosmos team. Developers may use this SDK to begin building the application logic layer. Furthermore, users may utilize Cosmos SDK in combination with Tendermint Core and ABCI to access the consensus engine and networking layer’s current functionality.

Some of the benefits include the ease with which the essential ABCI methods, the storage layer, cryptographic features, and client apps in Go may be implemented. It also offers on-chain governance and management of user accounts, keys, and transaction balances, among other items.

The SDK is extremely simple to use, and many of its features may be scaffolded in seconds using Github. You may also overwrite existing methods with your own logic. This saves teams and developers a lot of time and energy when it comes to creating projects. As an example, Kyve Network took less than a week to transfer from Ethereum and have a base chain up and running. It is generally much harder to launch chains on other networks. Read more about why it is so, here.

Lately, there have been reports of Cosmos incurring a significant cost of chain security. This is not entirely correct. With an inflation rate of 8% and an average commission rate of 8%, the validators receive 0.6% of the token supply each year. That’s hardly a lot. Furthermore, individuals enjoy staking because it increases their engagement; they lock up tokens, and validators test your software or perform other services. It’s not a high price to pay.

The future of Ethereum Layer 2, Ethereum 2.0, will increase performance, but the overwhelming assumption is that it will still prioritize security over speed. In comparison, Solana is extremely quick, making it ideal for high-frequency trading systems. When it comes to performance and flexibility, a sovereign app-chain is an obvious choice.

A win-win move

By moving to Cosmos, dYdX will also add a new group of customers to the Internet of Blockchain’s ecosystem; for example, its 24h trading volume is presently $2Bn+, compared to $15M on Osmosis, the network’s largest DEX. Additionally, as stated by Messari’s recent article, StarkWare’s latest valuation alone in private markets was $8 billion. Cosmos’ current valuation in public markets ($ATOM) is $2.9 billion. This certainly raises the question of a possible mismatch in value, especially if Cosmos starts to attract more L2s taking advantage of Ethereum’s slow-moving developments.

 Join our mailing list to receive our latest updates, research reports, and industry news.
Thanks for subscribing. Watch out for us in your inbox.
Oops! Something went wrong while submitting the form.