> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/exchange/zh-cn/overview/exchange-testnet.md).

# 交易所测试网

在测试网交易所进行交易：认证、创建密钥、领取合成 USDX 并下单。

Nexus Exchange 已在测试网上线，地址为 [nexus.xyz/trade](https://nexus.xyz/trade)。

您可以通过 API 进行认证、下单，并交易已上线的永续合约市场。

前端以只读模式显示交易所的实时状态。所有交易均通过 REST 和 WebSocket API 进行。

本文档的 [API 参考](https://docs.nexus.xyz/api-reference)部分提供完整的 API 文档。

### 快速开始

#### 1. 认证

使用您的以太坊钱包通过 EIP-191 个人签名登录：

```bash
POST /auth/login
```

对消息 `"Sign in to Nexus Exchange"` 签名即可获得会话令牌（TTL 为24小时）。首次登录时会创建您的账户。

#### 2. 创建 API 密钥

```bash
POST /keys
```

该调用会返回一个 HMAC 密钥对（`key_id` + `secret`）。secret 仅显示一次，请立即妥善保存。

使用 `GET /keys`（列出）和 `DELETE /keys/{key_id}`（撤销）管理密钥。

#### 3. 为账户充值

从水龙头为您的测试网账户充入合成 USDX：

```bash
POST /account/credit
```

下单前，您的账户需要有 USDX 余额。可随时通过 `GET /account` 查询余额。

**每个 API 密钥每天最多可领取500 USDX 测试资金。**

#### 4. 下单

所有交易请求都需使用三个请求头进行认证：`X-API-Key`、`X-Timestamp`、`X-Signature`。

```bash
POST /orders
```

```json
{
  "market_id": "BTC-USDX-PERP",
  "side": "Buy",
  "order_type": "Limit",
  "price": "67000",
  "quantity": "0.01",
  "time_in_force": "GTC"
}
```

完整的认证示例和所有可用端点，请参阅 [API 参考](https://docs.nexus.xyz/api-reference)部分。

### 市场

目前已上线三个加密资产永续合约，均以 USDX 计价：

| 市场              | 标的      |
| --------------- | ------- |
| `BTC-USDX-PERP` | Bitcoin |
| `ETH-USDX-PERP` | Ether   |
| `SOL-USDX-PERP` | Solana  |

市场集合会随着市场上线和下线而变化。查询 `GET /markets` 获取当前已上线的市场，或查询 `GET /markets/summary` 获取市场集合及其统计数据。后续推出的资产类别请参阅[资产目录](/exchange/zh-cn/asset-directory/asset-directory.md)。

### 交易所遥测数据

交易所的汇总遥测数据可通过 API 获取。这些端点是**公开的**，无需 API 密钥：

| 端点                                | 返回内容                   |
| --------------------------------- | ---------------------- |
| `GET /stats`                      | 交易所快照，包括滚动统计的独立交易者数量   |
| `GET /stats/history`              | 随时间变化的吞吐量样本            |
| `GET /stats/volume`               | 累计成交名义价值，包括交易所总计和各市场数据 |
| `GET /stats/open-interest`        | 持仓量，多空双方分别报告           |
| `GET /stats/balance-distribution` | 各余额区间的账户数量             |

根据文档说明，这些端点**在设计上不包含任何单个账户的数据**，因此它们是公开的。响应结构以及符号和单位方面的陷阱，请参阅[交易所统计数据](https://docs.nexus.xyz/api-reference/guides/statistics)。特别要注意，持仓量会分别报告多空双方，而 `gross_oi_two_sided_quote` 是单边数值的两倍。

目前生产前端上没有公开的分析仪表板。请使用上述端点。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.nexus.xyz/exchange/zh-cn/overview/exchange-testnet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
