How do DEXs Work?

A decentralized exchange (or DEX) is a peer-to-peer marketplace where cryptocurrency traders can transact directly with one another. DEXs enable one of crypto's most fundamental functions: facilitating financial transactions that aren't mediated by banks, brokers, payment processors, or any other third party. 


Every trade incurs a transaction cost in addition to the trading fee because decentralized exchanges are built on top of blockchain networks that support smart contracts and where users keep custody of their assets. In order to use DEXs, traders engage with smart contracts on the blockchain.


What types of popular models are used on DEXs?

Automated market maker (AMM) model and Limit order book (LOB)  are two mains types of models that can be used on DEXs. All of them use smart contracts to allow users to trade directly with one another. The initial decentralized exchanges employed order books that were comparable to those used by centralized exchanges.


AMM model is vastly used on DEXs. This model allows one to trade instantly depending on the amount of liquidity provided on the trading pair. In this model, your counterpart is the smart contract, which offers you the price per predefined algorithmic pricing. Let’s go into the details first to understand how it works. Imagine one has 100 GY tokens and 1000 ADA coins. If hypothetically, 1 GY = 10 ADA (or 1 ADA is 0.1 GY), you can add this amount in increments to provide liquidity. It is important to note that liquidity is needed to be provided in both GY and ADA, so trading between GY-ADA pair is possible. Usually exchanges add the first liquidity by themselves, then users provide further liquidity pairs. By providing liquidity, liquidity providers (LP) earn through exchange fees and usually are rewarded with tokens of an exchange. 


Though not popular, the Limit order book (LOB) model is also used in some of the changes. On cardano blockchain, Muesli Swap was the first exchange that allowed users to trade among cardano native tokens. For example, if an ABC token  is traded at $10 and you would like to buy an ABC token at $9, you can add a limit buy (or "bid") order. Once you add it, it will go to the order book. If market price would then go down, and somebody sells 100 XYZ stocks at $9 (an "ask"), then your order will be matched, and the new price will be settled. Hence, by having bids and asks in the order book, also one checks the bid-ask spread. The bid-ask spread is the difference between the highest price a buyer will offer (the bid price) and the lowest price a seller will accept (the ask price).


What is needed to use DEXs and what are the main features?

You do not need to sign-up somewhere to use a decentralized exchange, and you do not even need an email address to connect with these services. Traders will instead require a wallet that is compatible with the exchange's smart contracts. DEXs' financial services are accessible to everyone with a smartphone or computer  and an internet connection.


Because each trade will involve a transaction fee, the first step in using DEXs is to pick which network a user wants to use. The next step is to select a wallet that is compatible with the chosen network and to fund it with the network's native coin. A native token is a cryptocurrency that is used to pay transaction fees in a specific network. For Cardano, one can use Eternl, Nami Wallet, GeroWallet, Typhon wallet to use the services of a DEX. 


Following the selection of a wallet, one needs to first send a coin or token that is supported on a DEX. For Cardano, ADA is the native coin. One can send ADA from CEX to a wallet, once the transaction is approved, then the wallet is funded. It is important to send to the correct wallet address because the transactions are not reversible. Users who have a funded wallet can connect it via a pop-up window or by clicking the "Connect Wallet" button in one of the upper corners of the DEXs website. Then, you are ready for your first transaction!


You can do a swap to exchange from one token to another. Or you can become a liquidity provider and earn fees by each transaction that goes through the DEX.