What is Decentralized Exchange and How does it work

Jason Wu
4 min readApr 28, 2022

--

Explanation of Decentralized Exchange(DEX)

Photo by Art Rachen on Unsplash

Decentralized Exchange, short for DEX. Is a digital marketplace where you can trade your crypto assets in the form of smart contracts without a centralized authority or custodian.

Exchange place is not a new concept, it has existed for thousands of years. In ancient years, people exchanged stones for food has no different from people exchanging paper cash for stock or cash for bitcoin in the current world. The main difference is price agreement methods.

Considering Binance, Coinbase and New York Stock Exchange are all centralized exchanges, where all the transactions have to go through them as intermediator. There are various benefits of having transactions through centralized exchanges, such as customer support when there is any issue with submitted orders, FDIC coverage for regulated exchanges, and safe and secure transactions.

On the other hand, trading crypto assets via decentralized exchanges (DEX) replaces the intermediator with smart contracts, which is a piece of code that allows two parties to enter into a transaction agreement. The smart contract will enforce both parties to fulfill their obligations, if one failed, the smart contract will give the money back to the counterparty.

However, there are also limitations with decentralized exchanges. Decentralized exchanges(DEX) only allow crypto for crypto swaps, and the crypto needs to be in the same blockchain network. For example, Uniswap can only swap Ethereum for Ethereum tokens, but not cross-network swap. For inter blockchain crypto swap, there is a method called Blockchain Bridges.

Benefits of using decentralized exchanges:

  1. No KYC (Know Your Customer) process. You don’t need to submit your name, address, or SSN. This means you can buy or sell cryptos anonymously.
  2. No centralized Authority. Instead of trusting centralized crypto exchanges like Binance or Coinbase to make your deal between seller and buyers. Decentralized exchanges(DEX) relies on smart contract, which code is an open-source project and approved by the public.
  3. Transaction cost is also cheaper in Decentralized exchanges(DEX) compared to many other Centralized Crypto Exchanges.

However, there are also downsides to using decentralized exchanges.

  1. There is no customer support in decentralized crypto exchanges other than in public forums. You will unlikely get your money back if you bought a scam coin. (Rug Pull is a well-known scam strategy)
  2. You will be required to use a Hot Storage device. Unlike storing money in Binance and Coinbase. You must connect your wallet to the network on your computer physically or use a digital wallet like Matamask.
  3. Decentralized Exchange has very low liquidity, which means a small number of transactions can cause the price to fluctuate a lot.
  4. The smart contract code is an open-source project for everyone to read. This is a double-edged sword. The general public can review the code and approve it, hackers can also find the backdoor from the code and steal assets.

How do transactions happen in Decentralized Exchanges?

Let’s first understand how transactions work in a traditional centralized exchange. For example, when you want to buy a Tesla stock, you can submit your desired purchase price to the exchange. The exchange will find the counterparty who is willing to pay the price you asked for, then transaction is completed. This is called Order Book Method, price is confirmed via bid and ask among buyers and sellers.

The downside of using the Order Book Method is you will need both buyer and seller at the agreed price before the transaction can happen. For instance, if you listed your bitcoin to sell for 43,000 dollars, the order will sit there until there is a buyer who is willing to buy at the 43,000 dollars price, the waiting period can be forever if no one is willing to pay at the price.

As in Decentralized Exchanges. Let's use Uniswap as an example, it adopts the Automated Market Maker method or AMM. You don’t need to wait for a person to match the price you submitted for. Instead, you trade with a pool of funds instead of a person. Each token/crypto you buy from the pool, the pool will gradually charge you more and more, which causes the price to go up. On the other hand, for each token/crypto you sell in the pool, the pool will give you less and less, which causes the price to go down. The pool is often referred to as Liquidity Pool. The Automated Market Maker method will make sure they always sell more and more tokens. The less the token it has, the less the fee it will charge.

Overall, decentralized exchanges(DEX) have many benefits, as well as risks when compared to traditional centralized exchanges. Please do take enough time to learn different risks and concepts in greater detail before putting your money into the pool.

Thanks for reading.

--

--

Jason Wu

Avid Traveler, Investor, Curious Learner. Hobby blogger on process automation and data analytics.. for now.