# Decentralised Exchange (DEX)

## **What are Crypto Exchanges?** <a href="#what-are-crypto-exchanges" id="what-are-crypto-exchanges"></a>

<figure><img src="https://stablecoin.gitbook.io/~gitbook/image?url=https%3A%2F%2F3227819980-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FQWtvRDXX5lulEqcQikDA%252Fuploads%252FZwiXYoujiQvIbVtRW78m%252FScreenshot%25202024-04-13%2520at%252008.32.33.png%3Falt%3Dmedia%26token%3D1778847a-a0b7-413a-95b3-5fbf35ec49a3&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b2f90818&#x26;sv=1" alt=""><figcaption></figcaption></figure>

Cryptocurrency exchanges serve as the trading platforms for cryptocurrencies, similar to how stock exchanges facilitate the trading of stocks and derivatives. They allow users to buy, sell, and trade blockchain-based tokens and coins.

## **Centralized vs. Decentralized Exchange** <a href="#centralized-vs.-decentralized-exchanges" id="centralized-vs.-decentralized-exchanges"></a>

<figure><img src="https://stablecoin.gitbook.io/~gitbook/image?url=https%3A%2F%2F3227819980-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FQWtvRDXX5lulEqcQikDA%252Fuploads%252FKlxVNatTE4Y2RytNnzKx%252FScreenshot%25202024-04-13%2520at%252008.29.04.png%3Falt%3Dmedia%26token%3D7799a001-1a83-425d-99ad-8c0aac37f262&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=a267761d&#x26;sv=1" alt=""><figcaption><p>CEX vs DEX</p></figcaption></figure>

There are two main types of cryptocurrency exchanges: centralized exchanges (CEX) and decentralized exchanges (DEX).

### **Centralized Exchanges (CEX)**

Centralized exchanges, such as Binance, CEX.io, and Coinbase Exchange, operate with their own order books. These exchanges record and authenticate cryptocurrency transactions within their platforms. They function similarly to traditional banks, offering services like trading, investments, and sometimes even crypto cards for use in physical stores.

<figure><img src="https://stablecoin.gitbook.io/~gitbook/image?url=https%3A%2F%2F3227819980-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FQWtvRDXX5lulEqcQikDA%252Fuploads%252FEcXS7KoWT0eG6FVQrmTT%252Fimage.png%3Falt%3Dmedia%26token%3Dc808d08e-6f24-42f1-b916-4ba97f6c4fd8&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=814b5694&#x26;sv=1" alt=""><figcaption><p>CEX Order book</p></figcaption></figure>

Centralized exchanges enforce a know-your-customer (KYC) policy to prevent financial fraud. They also provide a level of security through their network and protocols.

### **Decentralized Exchanges (DEX)**

Decentralized exchanges, on the other hand, operate on blockchain platforms and allow users to trade digital assets directly with each other without the need for intermediaries. They provide a high level of security and privacy as users retain control of their funds throughout the trading process.

DEXs, like Uniswap and SushiSwap, offer a wide range of cryptocurrencies for trading and are not limited by coin listings. They are typically built on the Ethereum network and use Ether (ETH) as the primary currency. However, other cryptocurrencies can also serve as the base currency.

**Key Difference**

* **Flexibility**: DEXs offer more flexibility and privacy, as users can trade directly with each other without the need for intermediaries.

Understanding the differences between centralized and decentralized exchanges is crucial for anyone looking to trade cryptocurrencies, as each type offers unique advantages and disadvantages.

### A comparison table between DEX and CEX: <a href="#a-comparison-table-between-dex-and-cex" id="a-comparison-table-between-dex-and-cex"></a>

| Aspect              | DEX                               | CEX                                |
| ------------------- | --------------------------------- | ---------------------------------- |
| **Centralization**  | Decentralized                     | Centralized                        |
| **Security**        | Generally more secure             | Can be less secure                 |
| **Speed**           | Trading speed can vary            | Generally faster trading speeds    |
| **Liquidity**       | Lower liquidity                   | Higher liquidity                   |
| **Regulation**      | Often operate in a grey area      | Subject to regulatory requirements |
| **User Experience** | Can have a steeper learning curve | More user-friendly experience      |

### Types of Dexes: <a href="#types-of-dexes" id="types-of-dexes"></a>

There are several types of decentralized exchanges (DEXes), each with its own unique characteristics and mechanisms. Here are some common types:

1. **(AMM)**: AMM DEXes use smart contracts to facilitate trades by matching buy and sell orders based on a mathematical formula. Users trade against liquidity pools rather than other traders. Examples include Uniswap, SushiSwap, and PancakeSwap.

   <figure><img src="https://stablecoin.gitbook.io/~gitbook/image?url=https%3A%2F%2F3227819980-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FQWtvRDXX5lulEqcQikDA%252Fuploads%252Fe4UzyTGjH7xjbEJ7Bf06%252FScreenshot%25202024-04-13%2520at%252008.38.45.png%3Falt%3Dmedia%26token%3Dbf9d390e-8b68-4f1c-b42f-9de717f5452a&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=815c88cc&#x26;sv=1" alt=""><figcaption></figcaption></figure>
2. **Order Book DEX**: These DEXes use an order book to match buy and sell orders directly between users. However, they operate on a decentralized network, unlike centralized exchanges. Examples include IDEX and EtherDelta (now ForkDelta).
3. **Token Swap DEX**: These DEXes allow users to swap one cryptocurrency for another directly, without the need for an order book or liquidity pool. They are often integrated into wallets or other platforms for convenience. Examples include Kyber Network and Changelly.
4. **Liquidity Pool DEX**: These DEXes rely on liquidity providers who deposit funds into pools, which are then used to facilitate trades. Users can trade against these pools, and liquidity providers earn fees. Examples include Balancer and Curve Finance.
5. **Cross-Chain DEX**: These DEXes allow users to trade assets across different blockchain networks. They use technologies such as atomic swaps or bridges to facilitate cross-chain trading. Examples include Thorchain and Binance DEX (which supports Binance Chain and Binance Smart Chain).

Each type of DEX has its own advantages and disadvantages, and the choice of DEX depends on factors such as user preferences, trading needs, and desired features.
