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.
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.
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.
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.
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.
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.
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.
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 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.
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.
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.