> 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/exchange-demo.md).

# Exchange Demo

The Nexus Exchange demo is live at [exchange.nexus.xyz](https://exchange.nexus.xyz).

The exchange is live and usable on testnet — authenticate via API, place orders, and trade across 32 perpetual futures markets.

The frontend displays live exchange state in read-only mode. All trading is conducted via the REST and WebSocket APIs.

Full API documentation is hosted at [exchange.nexus.xyz/api-docs](https://exchange.nexus.xyz/api-docs).

### Getting Started

#### 1. Authenticate

Sign in with your Ethereum wallet using an EIP-191 personal signature:

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

Sign the message `"Sign in to Nexus Exchange"` to receive a session token (24-hour TTL). Your account is created automatically on first sign-in.

#### 2. Create an API Key

```bash
POST /keys
```

Returns an HMAC key pair (`key_id` + `secret`). The secret is shown once — store it immediately.

Manage keys with `GET /keys` (list) and `DELETE /keys/{key_id}` (revoke).

#### 3. Deposit USDX

Fund your exchange account by depositing USDX:

```bash
POST /account/deposit
```

You need a USDX balance before you can place orders. Check your balance at any time via `GET /account`.

**Each user can fund their account with 10,000 test USDX per day on the Exchange.**

#### 4. Place an Order

Authenticate all trading requests with three headers: `X-API-Key`, `X-Timestamp`, `X-Signature`.

```bash
POST /orders
```

```json
{
  "market_id": "BTC-USDX-PERP",
  "side": "buy",
  "type": "limit",
  "price": "67000",
  "size": "0.01",
  "time_in_force": "GTC"
}
```

See the [API documentation](https://exchange.nexus.xyz/api-docs) for complete authentication examples and all available endpoints.

### Markets

31 perpetual futures market pairs with USDX exist across crypto, FX and commodities.

| Category     | Assets                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Max Leverage |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| Major Crypto | <p></p><ul><li><strong>BTC / USDX</strong></li><li><strong>ETH / USDX</strong></li><li><strong>SOL / USDX</strong></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | 10x          |
| Altcoins     | <p></p><ul><li><strong>AVAX / USDX</strong></li><li><strong>DOT / USDX</strong></li><li><strong>ADA / USDX</strong></li><li><strong>ATOM / USDX</strong></li><li><strong>NEAR / USDX</strong></li><li><strong>SUI / USDX</strong></li><li><strong>APT / USDX</strong></li><li><strong>TIA / USDX</strong></li><li><strong>SEI / USDX</strong></li><li><strong>INJ / USDX</strong></li><li><strong>LINK / USDX</strong></li><li><strong>UNI / USDX</strong></li><li><strong>AAVE / USDX</strong></li><li><strong>MKR / USDX</strong></li><li><strong>SNX / USDX</strong></li><li><strong>CRV / USDX</strong></li><li><strong>FIL / USDX</strong></li><li><strong>WIF / USDX</strong></li><li><strong>DOGE / USDX</strong></li><li><strong>ARB / USDX</strong></li><li><strong>OP / USDX</strong></li><li><strong>POL / USDX</strong></li></ul> | 10x          |
| FX           | <p></p><ul><li><strong>EUR / USDX</strong></li><li><strong>GBP / USDX</strong></li><li><strong>JPY / USDX</strong></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | 10x          |
| Commodities  | <p></p><ul><li><strong>GOLD / USDX</strong></li><li><strong>OIL / USDX</strong></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | 10x          |
| Indices      | <p></p><ul><li><strong>SPX / USDX</strong></li><li><strong>NDQ / USDX</strong></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | 10x          |

All markets are denominated in USDX. Query all available markets via `GET /markets/summary`.

### Analytics Dashboard

Real-time exchange telemetry exists at [exchange.nexus.xyz/analytics](https://exchange.nexus.xyz/analytics):

* **Engine** — fills/second, throughput, HTTP latency, resource utilization
* **Microstructure** — cross-market spread, depth, imbalance, order book heatmap
* **Risk** — account risk distribution, insurance fund flow, liquidation monitoring
* **Oracle** — mark price divergence per market, feed status
* **Invariants** — continuous correctness monitoring (fund conservation, OI symmetry)


---

# 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:

```
GET https://docs.nexus.xyz/exchange/exchange-demo.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.
