The Ins and Outs of Decentralized Exchanges (DEXs)

A decentralized exchange (DEX) uses smart contracts to enable cryptocurrency traders to execute trades without an intermediary.

after reading this, you'll understand:

  • Decentralized exchanges place control and responsibility on the users by letting them trade directly from their wallets through smart contracts.

  • There are three types of DEX: automated market makers, order book, and DEX aggregators.

  • Until someone understands how wallets and wallet extensions work, that person could easily lose money in a DEX.

after reading this, you'll understand:

  • Decentralized exchanges place control and responsibility on the users by letting them trade directly from their wallets through smart contracts.

  • There are three types of DEX: automated market makers, order book, and DEX aggregators.

  • Until someone understands how wallets and wallet extensions work, that person could easily lose money in a DEX.

A decentralized exchange (DEX) uses smart contracts to enable cryptocurrency traders to execute trades without an intermediary. Users keep control of their private keys and aren’t required to submit any personal information.

Over 100 million investors visit these decentralized platforms, and there is over $4 billion of volume on DEXs daily. Many users prefer decentralized exchanges over centralized exchanges due to their enhanced privacy.

What is the difference between centralized and decentralized exchanges?

Centralized exchanges remain prevalent in the cryptocurrency ecosystem, because they’re typically regulated and easy for new cryptocurrency traders to use. Some centralized exchanges insure their users’ funds and provide surveillance services that make it easy to move funds. Still, many people don’t like handing their funds over to a third party.

Decentralized exchanges shift control and responsibility to the users, by letting them trade directly from their wallets through smart contracts. Users are responsible for their funds and passphrases.

What are the three types of DEX?


AMM

An automated market maker (AMM) uses smart contract technology to fulfill orders and track the price of digital assets. Instead of matching buyers and sellers, AMMs use community-funded liquidity pools to execute buy and sell orders.

Liquidity pools are made up of two different tokens. When someone buys or sells a token using a liquidity pool, it shifts the ratio of the tokens in the pool and alters the price of the pool’s tokens. For example, if a liquidity pool contains 100 units of token A and 200 units of token B, that means 1 unit of token A is worth 2 units of token B. If someone buys 50 units of token B for 25 units of token A, the pool’s ratio shifts. Now the pool contains 125 units of token A and 150 units of token B, meaning 1 unit of token A is worth 1.2 units of token B.

With numerous automated market makers using their own liquidity pools, an asset’s price is rarely the same on every exchange. Still, arbitrageurs typically buy assets from exchanges with lower prices and sell the tokens into pools with higher prices, averaging the price between the two pools.

Order book (off-chain and on-chain)

Order books share similarities with centralized exchanges. These exchanges enable traders to place buy orders at the price they’re willing to pay for a specific digital asset and sell orders at the price they’re willing to sell the asset. The order book compiles these offers and matches buyers and sellers to fulfill trades. On-chain order books allow traders to buy and sell digital assets without taking custody of their tokens. In many cases, traders can leverage their trades to increase their profit potential, although this also increases their loss potential.

DEX aggregators

DEX aggregators are comparable to a decentralized exchange search engine, as they aggregate decentralized exchanges, eliminating the need to manually find the best price for a token. These platforms use various protocols to aggregate liquidity from multiple DEXs, enabling them to minimize slippage on large orders, lower trading fees, and offer optimal token prices.

How many decentralized exchanges are there?

There are countless DEX platforms across nearly every major blockchain. They have become an important part of peer-to-peer, decentralized finance. Still, some are more popular than others. Choosing a popular exchange is ideal since many have proven to be trustworthy and secure over time, and typically have larger liquidity pools for trading assets.

Which decentralized exchanges are the most popular?

  • UniSwap. UniSwap is the second-largest DEX operating on the Ethereum blockchain and was the most popular before the rise of DyDx. This exchange is a long-running favorite. It keeps customer funds secure since there is no centralized intermediary to hack and doesn’t charge listing fees for new tokens.

  • Curve Finance. Curve is a popular decentralized cryptocurrency exchange for trading stablecoins and other assets.

  • SaucerSwap. This is one of the most popular up-and-coming exchanges on the Hedera network, offering retail users the ability to trade assets originating on Hedera and contribute to liquidity pools to earn rewards.

  • Tangent Finance. Tangent is another popular exchange that’s live on the Hedera network, offering retail users the ability to trade assets and contribute to liquidity pools.


What are private keys?

A private key acts as a secret digital signature, represented by a long string of numbers and letters used in cryptography, similar to a password. In cryptocurrency, private keys are used to secure cryptocurrency accounts and are associated with a public key or address. Private keys are used to sign transactions and prove ownership of a blockchain address.

What fees are involved?

Most DEXs charge fees for every transaction, regardless of whether a user is buying or selling. DEXs that use community-funded liquidity pools often reward liquidity providers with a portion of the fee revenue. DEXs tend to have lower transaction fees than their centralized counterparts, although the fees vary depending on the blockchain. In general, proof-of-stake blockchains charge lower fees than proof-of-work blockchains.

What is a wallet extension?

Wallet extensions allow users to explore dApps, trade on DEXs, and more. Many wallet extensions enable users to store NFTs. Users can link their blockchain account to a wallet extension to use their funds without giving the application custody of their assets. MetaMask is a popular chrome extension for managing assets on the Ethereum blockchain and signing application transactions, and HashPack is a popular browser extension powered by Hedera.

What are the risks?

DEXs are primarily used by retail users who understand how to use cryptocurrency wallets and understand the nuances of DeFi. It’s important that users keep their private keys secure and don’t interact with potentially malicious decentralized exchanges.

Cryptocurrency wallets must be funded with tokens that exist on the same blockchain as the decentralized exchange application in which they’re engaging, or funds can be lost forever. For example, if a user tries to fund their Ethereum account by sending a Binance Smart Chain token to their Ethereum address, the funds will be lost forever. Most DEXs require that both the assets and the accounts they’re using exist on the same network.

Slippage tolerances have to be manually adjusted on most DEXs, and if done improperly, the price of funds used in trading can fluctuate wildly, resulting in loss. Additionally, adding to liquidity pools on a DEX can result in impermanent loss and allow for users to be susceptible to rugpulls, as their assets are locked in an account used for liquidity purposes.

What is the upside?

DEXs offer many types of tokens to trade since assets don’t have to be individually vetted by a centralized authority. Additionally, they offer enhanced anonymity and privacy compared to centralized exchanges. This may change overtime as regulation matures, requiring users to identify themselves to the exchange and participate in proper reporting for tax and anti-money laundering purposes.

Additionally, users retain custody of their funds in an account of which only they hold the keys. Therefore, they’re less susceptible to a centralized exchange freezing their accounts, preventing withdrawl, or outright taking their funds if they become insolvent.

Conclusion

Decentralized exchanges are quickly becoming the backbone of the cryptocurrency ecosystem. The inherent privacy and security associated with DEXs make them an attractive option for most cryptocurrency traders and retail users looking to earn rewards on their assets by creating liquidity.

The Hedera network offers predictable fees, scalability with 10,000 TPS,, and transaction settlement in 3 - 5 seconds, making it ideal for DEXs. Additionally, thanks to hashgraph consensus’ fair ordering of transactions, DEXs powered by Hedera aren’t susceptible to front-running by bots — a multi-billion dollar issue facing DEXs on alternative blockchain networks.