# 0x Protocol

### 0x（發音為「zero-x」）是一個開源的去中心化交易協議，不是一個交易所，而是讓其他人可以建立 DEX 的基礎設施。它採用「鏈下訂單簿、鏈上結算」的混合模式，試圖結合中心化交易所的效率和去中心化交易所的安全性。

***

## 0x 是什麼？

### 協議 vs 交易所

```
傳統 DEX（如 Uniswap）：
用戶 → DEX → 交易

使用 0x 協議：
用戶 → 基於 0x 的 App → 0x 協議 → 交易
```

簡單說，0x 是「DEX 的 DEX」——它提供底層技術，讓開發者可以快速建立自己的去中心化交易應用。

{% hint style="info" %}
**為什麼要這樣設計？**

不同的應用可能需要不同的交易體驗。0x 提供靈活的底層協議，讓開發者可以專注於用戶體驗，而不用從頭建立整個交易系統。
{% endhint %}

***

## 0x 的運作方式

### 鏈下訂單簿 + 鏈上結算

```
1. 用戶創建訂單（鏈下）
2. 訂單廣播到中繼者網路
3. 另一用戶看到訂單，決定成交
4. 交易在以太坊上結算（鏈上）
```

| 步驟   | 在哪裡 | 好處      |
| ---- | --- | ------- |
| 創建訂單 | 鏈下  | 不用付 Gas |
| 廣播訂單 | 鏈下  | 快速、免費   |
| 取消訂單 | 鏈下  | 免費      |
| 結算交易 | 鏈上  | 安全、不可逆  |

***

## 中繼者（Relayer）

中繼者是基於 0x 協議建立的交易平台：

| 中繼者         | 說明           |
| ----------- | ------------ |
| Matcha      | 0x 官方的交易聚合器  |
| Radar Relay | 早期知名中繼者（已關閉） |
| DDEX        | 專注於槓桿交易      |
| Tokenlon    | 面向亞洲市場       |

{% hint style="warning" %}
**中繼者不託管資產**

和中心化交易所不同，中繼者只是「媒合」訂單，你的資產始終在自己錢包裡。
{% endhint %}

***

## ZRX 代幣

0x 協議發行的原生代幣 ZRX：

| 用途   | 說明             |
| ---- | -------------- |
| 治理投票 | 參與協議升級決策       |
| 質押獎勵 | 質押 ZRX 獲得手續費分成 |
| 做市獎勵 | 激勵流動性提供者       |

### ZRX 代幣經濟

| 項目     | 數據       |
| ------ | -------- |
| 總供應量   | 10 億 ZRX |
| 發行時間   | 2017 年   |
| ICO 價格 | 約 $0.05  |

***

## 0x 的優勢

| 優勢    | 說明           |
| ----- | ------------ |
| 開源協議  | 任何人都可以使用     |
| 靈活性高  | 可以客製化交易體驗    |
| 省 Gas | 訂單操作不上鏈      |
| 互操作性  | 不同中繼者的訂單可以互通 |

***

## 0x 的挑戰

| 挑戰     | 說明                  |
| ------ | ------------------- |
| AMM 競爭 | Uniswap 等 AMM 更簡單直接 |
| 流動性分散  | 多個中繼者分散了流動性         |
| 用戶體驗   | 比 AMM 複雜            |
| 採用率    | 主流用戶更熟悉 AMM         |

{% hint style="info" %}
**AMM vs 訂單簿**

0x 使用訂單簿模式，適合專業交易者；Uniswap 使用 AMM，適合一般用戶。兩種模式各有優缺點。
{% endhint %}

***

## 0x API

0x 現在主要作為「流動性聚合器」，0x API 可以：

* 聚合多個 DEX 的流動性
* 找到最佳交易路徑
* 最小化滑點
* 被錢包和 DApp 整合

***

## 延伸閱讀

* [去中心化交易所](/mai-mai-shu-wei-zi-chan-de-chang-suo/qu-zhong-xin-hua-jiao-yi-suo.md) — DEX 的基本概念
* [JOYSO](https://github.com/dAAAb/Blockpedia/blob/master/jiao-yi-suo/qu-zhong-xin-hua-jiao-yi-suo/joyso.md) — 另一個使用 0x 的交易所
* [AMM](https://github.com/dAAAb/Blockpedia/blob/master/defi/amm.md) — 另一種 DEX 模式
* [流動性](https://github.com/dAAAb/Blockpedia/blob/master/defi/liu-dong-xing.md) — 交易的關鍵

***

#### 參考資料

* [0x Protocol](https://0x.org/)
* [0x Whitepaper](https://0x.org/docs)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.0x1.academy/mai-mai-shu-wei-zi-chan-de-chang-suo/qu-zhong-xin-hua-jiao-yi-suo/0x.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
