> ## Documentation Index
> Fetch the complete documentation index at: https://docs.marketlens.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Centralised Exchanges

Let’s explore how centralized exchanges function by examining the [BTC/USDT spot trading pair on Bybit](https://www.bybit.com/en/trade/spot/BTC/USDT). This pair allows users to exchange Bitcoin (BTC) for Tether (USDT) and vice versa.

<Frame>
  <img src="https://mintcdn.com/msdev/rf6vMwTmX9JMEnuJ/images/5bf0945e-7efc-4de9-b9f3-aacf137742fb-2.png?fit=max&auto=format&n=rf6vMwTmX9JMEnuJ&q=85&s=0dcdcaaa4c310f3c1f95e9e035a13276" alt="5bf0945e 7efc 4de9 B9f3 Aacf137742fb 2" width="2982" height="1410" data-path="images/5bf0945e-7efc-4de9-b9f3-aacf137742fb-2.png" />
</Frame>

## Order Types

An exchange is a service that provides two basic operations:

* **Limit Order**: "I want to buy (or sell) a specific amount of an asset at a set price (or better) sometime in the future."
  <Frame>
    <img src="https://mintcdn.com/msdev/faKuAGzSMThxJ1Vc/images/66f62e52-5634-4953-b252-fad6c892a0ca.png?fit=max&auto=format&n=faKuAGzSMThxJ1Vc&q=85&s=5b7d9b3e020c0ae1020658cb8f287cf9" alt="66f62e52 5634 4953 B252 Fad6c892a0ca" width="584" height="290" data-path="images/66f62e52-5634-4953-b252-fad6c892a0ca.png" />
  </Frame>
  * **Guarantees**: The execution price (you’ll get your specified price or better).
  * **Doesn’t Guarantee**: Execution timing or if the order will be filled.
* **Market Order** says: "I want to buy (or sell) a specific amount of an asset right now at the best available price."
  <Frame>
    <img src="https://mintcdn.com/msdev/faKuAGzSMThxJ1Vc/images/819d94fe-9480-4ef9-aa7a-ab32933de8e8.png?fit=max&auto=format&n=faKuAGzSMThxJ1Vc&q=85&s=5d2e83a67227ace263fb8d089f5f610d" alt="819d94fe 9480 4ef9 Aa7a Ab32933de8e8" width="594" height="172" data-path="images/819d94fe-9480-4ef9-aa7a-ab32933de8e8.png" />
  </Frame>
  * **Guarantees**: Immediate execution.
  * **Doesn’t Guarantee**: The exact price

## Order Book and Trades

<Frame>
  <img src="https://mintcdn.com/msdev/faKuAGzSMThxJ1Vc/images/0a338642-3873-4018-aa78-dac472d9cd0f-2.png?fit=max&auto=format&n=faKuAGzSMThxJ1Vc&q=85&s=6433d4e05ad3b09073847264b0a133e3" alt="0a338642 3873 4018 Aa78 Dac472d9cd0f 2" width="1184" height="1156" data-path="images/0a338642-3873-4018-aa78-dac472d9cd0f-2.png" />
</Frame>

To implement this process exchanges maintain order books, a list of all active limit orders waiting to be matched. Let’s walk through the process step by step, starting with an empty order book:

1. **User A places a buy limit order** for 1 BTC at 96,500 USDT.
   * This is a **bid** (a limit order to buy).
   * The order book now looks like this:
     | **Price (USDT)** | **Amount (BTC)** |
     | ---------------- | ---------------- |
     | 96,500 (Bid)     | 1 BTC            |
2. **User B places a market sell order** for 0.5 BTC.
   * The exchange matches this with User A’s bid.
   * **Trade**: User B sells 0.5 BTC to User A at 96,500 USDT.
   * Updated order book:
     | **Price (USDT)** | **Amount (BTC)** |
     | ---------------- | ---------------- |
     | 96,500 (Bid)     | 0.5 BTC          |
3. **User C places a sell limit order** for 5 BTC at 96,600 USDT.
   * This is an **ask** (a limit order to sell).
   * Note: Bids must be below the lowest ask (96,600), and asks must be above the highest bid (96,500), unless they’re meant to match immediately.
   * Updated order book:
     | **Price (USDT)** | **Amount (BTC)** |
     | ---------------- | ---------------- |
     | 96,600 (Ask)     | 5 BTC            |
     | 96,500 (Bid)     | 0.5 BTC          |
4. **More users add orders**, creating a deeper order book:
   | **Price (USDT)** | **Amount (BTC)** |
   | ---------------- | ---------------- |
   | 96,700 (Ask)     | 2 BTC            |
   | 96,600 (Ask)     | 5 BTC            |
   | 96,500 (Bid)     | 0.5 BTC          |
   | 96,400 (Bid)     | 3 BTC            |
5. **User D places a market buy order** for 6 BTC.
   * The order is filled from the lowest asks first:
     * 5 BTC at 96,600 USDT = 5 × 96,600 = 483,000 USDT.
     * 1 BTC at 96,700 USDT = 1 × 96,700 = 96,700 USDT.
     * **Total Cost**: 483,000 + 96,700 = 579,700 USDT.
   * Updated order book:
     | **Price (USDT)** | **Amount (BTC)** |
     | ---------------- | ---------------- |
     | 96,700 (Ask)     | 1 BTC            |
     | 96,500 (Bid)     | 0.5 BTC          |
     | 96,400 (Bid)     | 3 BTC            |
6. **Trades are recorded** with timestamps for transparency:
   * Trade 1: 5 BTC at 96,600 USDT.
   * Trade 2: 1 BTC at 96,700 USDT.

In the trading ecosystem, users who place **limit orders** are often referred to as **market makers**or **liquidity providers**. These participants contribute to the market by adding depth to the order book, offering to buy or sell at specific prices, which other traders can then match. Conversely, users who place **market orders** are known as **market takers**. By executing trades immediately at the best available prices, they remove liquidity from the order book, reducing the depth of available orders.

It’s that simple! The order book continuously evolves as users place and cancel limit orders or execute market orders, driving the trading process on centralized exchanges.
