Decentralized Exchange is a service that relies on a smart contract to be able to execute orders without intermediaries. So this time we will learn about the DEX itself. You can also read other articles such as Decentralized Finance: How it Works, Pros, and Risks.

What is a Decentralized Exchange (DEX)?

Decentralized exchanges rely on smart contracts to allow traders to execute orders without intermediaries. On the other hand, Centralized Exchanges are managed by centralized organizations such as banks that are involved in for-profit financial services. Centralized Exchanges account for most of the trading volume in the cryptocurrency market because they are regulated entities that store user funds and offer an easy-to-use platform for newcomers. Some centralized exchanges even provide insurance on assets that are stored. The services offered by Centralized Exchange can be compared to those offered by banks. Banks keep their clients' funds safe and provide security and supervision services that individuals cannot provide independently, making it easier to move funds. In contrast, Decentralized Exchanges allow users to trade directly from their wallets by interacting with smart contracts behind the trading platform. Trader keep their funds and be responsible for their loss if they make a mistake such as losing their private key or sending the funds to the wrong address. Funds or assets deposited by customers are issued "I owe you" (IOUs) through the Decentralized Exchange portal, which can be traded freely on the network. IOUs are essentially blockchain-based tokens that have the same value as the underlying asset.  The popular decentralized exchange has been built on top of the leading blockchain that powers smart contracts. They are built on top of layer one protocols, which means that they are built directly on the blockchain. The most popular DEXs are built on the Ethereum blockchain.

Difference between DEX and CEX

Centralized Exchanges (CEXs), like Binance, are online trading platforms that match buyers and sellers through an Order Book. They basically work in the same way as online brokerage accounts, which is why they are so popular among investors. Decentralized Exchanges (DEXs), such as PancakeSwap or Uniswap, are autonomous financial protocols powered by smart contracts that allow crypto traders to convert one digital asset to another with all transactions viewable on the blockchain. The main difference between Centralized and decentralized exchanges is that the former has control over your funds when you interact on a temporary trading venue, with the latter, users maintain control of the funds while trading. CEXs and DEXs both allow coin trading but do so in very different ways. CEXs are centralized entities that provide intermediary services between users, while DEXs rely on smart contracts to execute their trades. Centralized exchanges will, to some extent, provide a safety net for users and are relatively newcomer-friendly - while Decentralized Exchanges only provide users with the tools to trade and expect users to understand what they are doing. Both types of exchanges provide major services within the broader cryptocurrency market and it is impossible to say that one is really better than the other. However, for newcomers, CEXs do represent a simpler and more user-friendly way of trading - and also the ability to buy crypto for fiat currencies. As users become more confident and competent and start to become more concerned about their privacy and full control over their crypto, then DEXs are likely to become more suitable.

How Does a DEX Work?

Here's how the DEX itself works. The way it works is:

What is Order Book

The Order Book compiles a record of all open orders to buy and sell assets for a specific asset pair. A buy order signifies that a trader is willing to buy or bid on an asset at a specific price, while a sell order indicates that a trader is ready to sell or ask for a specific price for the asset under consideration. The difference between this price determines the depth of the Order Book and the market price on the exchange. Order Book DEXs come in two types: Order Book on-chain and Order Book off-chain. DEXs that use Order Books often store open order information on-chain, while user funds remain in their wallets. These exchanges allow traders to increase their positions using funds borrowed from lenders on their platform. Trading with leverage increases the earning potential of the trade, but it also increases the risk of liquidation because it increases the position size with borrowed funds, which must be repaid even if the trader loses their bet.  However, DEX platforms that store their Order Book from the blockchain only complete trades on the blockchain to bring the benefits of a centralized exchange to traders. Using an off-chain Order Book helps exchanges reduce fees and increase speed to guarantee that trades are executed at the user's desired price. To offer leveraged trading options, the exchange also allows users to lend their funds to other traders. Borrowed funds earn interest over time and are guaranteed by the exchange's liquidation mechanism, ensuring lenders are paid even if traders lose their bets. It is important to point out that Order Book DEXs often suffer from liquidity issues. Since they are essentially competing with Centralized Exchanges and incur additional fees due to what is paid for transacting on-chain, traders usually stick with centralized platforms. While DEXs with off-chain Order Books reduce these fees, the risks associated with smart contracts arise due to the need to deposit funds into them.

What is Swap

Next-generation decentralized exchanges do not use Order Books to facilitate trading or set prices. Instead, these platforms typically use liquidity pool protocols to determine the price of assets. In the peer-to-peer realm, these exchanges execute trades between users' wallets instantly — a process that some refer to as swaps. DEXs in this category are ranked in total value locked (TVL), or the value of assets stored in the protocol's smart contracts.
  • Uniswap: Users of the Uniswap platform can swap two Ethereum assets that are seamlessly built on top of the underlying liquidity pool. This highly accessible pool of liquidity ensures that Uniswap remains permissionless and trustless, which democratizes lending and lending on the platform.
  • Curve: Similar to Uniswap, Curve is a Decentralized Exchange that uses liquidity pools. However, Curve specifically caters to stablecoin trading, allowing users to trade between them with slippage and low fees — all through the use of algorithms that optimize trading pairs.
  • SushiSwap: SushiSwap emulates Uniswap, except that it started by offering liquidity providers a token known as SUSHI (which was later also offered by Uniswap with its UNI token). On Uniswap, the trading fee is 0.3%, but SushiSwap allocates 0.3% differently, distributing 0.05% in the form of SUSHI tokens.
  • DODO: Like others in this segment, DODO is a liquidity protocol. However, the DODO platform uses the Proactive Market Maker (PMM) algorithm to provide adequate liquidity.
  • Balancer: The balancer is built on the concept of Uniswap but has more liquidity pool flexibility . While Uniswap has a liquidity pool of equally-weighted token pairs, Balancer allows pools with different ratios (e.g. 80/20 or 70/30 DAI/ETH). While a balancing pool can be a mere token pair, it also allows for a liquidity pool with as many as eight different assets.
  • Bancor: Bancor's exchange model does not require a second party to make a trade. Instead, you can swap your ERC-20 tokens for Bancor's native "smart" Bancor Network Token (BNT). You can then exchange them for other ERC-20 tokens on the platform.
  • Kyber: The Kyber protocol operates as a stack of smart contracts that run on any blockchain, not just Ethereum. Like other exchanges that operate without an Order Book, Kyber uses liquidity pools to facilitate peer-to-peer exchanges.
  • Gnosis: The Gnosis protocol accumulates liquidity through a unique mechanism called ring trading, which serves as order settlement that splits liquidity across all orders, not just one trading pair. The protocol is perfect for trading prediction market tokens and other token assets.

What is Decentralized Exchange Aggregator

DEX aggregators use several different protocols and mechanisms to solve problems related to liquidity. The platform essentially pools liquidity from multiple DEXs to minimize slippage on large orders, optimize swap fees and token prices, and offer traders the best prices in the shortest possible time. Protecting users from the effects of pricing and reducing the likelihood of failed transactions are two other important goals of DEX aggregators. Some DEX aggregators also use the liquidity from centralized platforms to provide a better experience to users, while remaining non-custodial by leveraging integrations with certain centralized exchanges.

Advantages of Using a Decentralized Exchange (DEX)

Here are the strengths of the premise of Decentralized Exchanges that can benefit you.

Asset Security Level

In the case of Decentralized Exchanges (DEXs), security is a huge drawcard. It is non-containment. Therefore, users do not need to hand over their private keys to make transactions with the DEX. In contrast, smart contracts allow users to use a personal external wallet to interact with the DEX, and trade automatically.

Low cost

With the leverage of self-executing smart contracts, Decentralized Exchanges allow trading without intermediaries, leading to minimized fee fees. In this case, DEXs use a gas fee structure, as we are used to hearing about on the Ethereum blockchain. DEXs charge a small fee, usually around 3%, for exchanges like Swap. The fees charged by DEXs are much lower than those of Centralized Exchanges, although they fluctuate based on the state of the network.

Private

Since crypto wallets are stored externally, Decentralized Exchanges no longer require traders to disclose their private keys and are not responsible for the funds. When using a DEX, users are not required to undergo KYC or AML procedures. Legally, this may be beneficial in terms of convenience, but it can be problematic in some cases. After knowing about Decentralized Exchanges and how they work and their benefits, then you can learn about them or even enjoy all the benefits of DEXs themselves. Don't forget that after reading this article, you can register at GIC and enjoy the advantages of our platform. Follow our Instagram account for more information!GIC