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

# Introduction

> Public documentation for the XO Orderbook REST and WebSocket APIs.

The XO Orderbook is XO Market's central limit order book. This site documents the orderbook REST and WebSocket APIs, the Data API for market discovery and portfolio reads, the smart-account identity model used to authenticate and sign orders, and the rate limits clients should size against.

<Note>
  Only XO smart-account orders (`signatureType = 3`) are accepted by the orderbook today. Direct EOA orders (`signatureType = 0`) are not currently supported. Use an XO smart account from [`beta.xo.market`](https://beta.xo.market) as your maker; on-chain calls (approvals, split/merge/redeem) execute as ERC-4337 UserOperations through the XO bundler.
</Note>

## Start here

1. Create an XO smart account at [`beta.xo.market`](https://beta.xo.market). That smart account is your maker address.
2. Deposit XO USDC into the smart account via the `beta.xo.market` deposit flow.
3. Approve the CTF Exchange for XO USDC and Conditional Tokens.
4. Check `/balance-allowance` to verify funding and approvals.
5. Size the bot against the published [rate limits](/api-reference/rate-limits).
6. Dry-run a signed order with `signatureType = 3` (see [Smart accounts](/guides/smart-accounts)).
7. Submit orders with small size until the full loop is verified.

To split, merge, or redeem outcome tokens, call the `ConditionalTokens` contract directly — these operations are not exposed by the orderbook API. See [Redeem positions](/guides/redeem-positions) for the bundler UserOperation.

## Environment

XO operates a single public production environment. The chain id and CTF Exchange address are part of the EIP-712 order domain, so signed orders are **not** portable across deployments.

|                     | Value                                                |
| ------------------- | ---------------------------------------------------- |
| Chain id            | `3223`                                               |
| Orderbook REST      | `https://orderbooks.xo.market`                       |
| Orderbook WebSocket | `wss://orderbooks.xo.market`                         |
| Data API            | `https://api-mainnet.xo.market` (paths under `/api`) |

### Mainnet defaults

|                        | Value                                               |
| ---------------------- | --------------------------------------------------- |
| Chain id               | `3223`                                              |
| RPC URL                | `https://rpc-mainnet-2.xo.market?api_key=<API_KEY>` |
| Bundler URL (ERC-4337) | `https://mainnet-bundler.xo.market/`                |

<Note>
  The mainnet RPC requires an `api_key` query parameter (e.g. `https://rpc-mainnet-2.xo.market?api_key=abcd1234`). The XO team issues the key privately during onboarding. Treat it as a credential and do not commit it to source control.
</Note>

## Contracts

| Contract                         | Address                                      |
| -------------------------------- | -------------------------------------------- |
| CTF Exchange                     | `0x4bC5E872256D12E6017dfe466E04c867DC761B77` |
| Conditional Tokens               | `0xCcf1b2C676E2f9A13e5674be0e0DdFF6d0B13909` |
| XO USDC (collateral, 6 decimals) | `0x80c12230ce677e6f304027a14780Edd2A829ab0c` |
| EntryPoint (ERC-4337 v0.7)       | `0x0000000071727De22E5E9d8BAf0edAc6f37da032` |

Your `XO_SMART_ACCOUNT_ADDRESS`, the owner `XO_PRIVATE_KEY`, the paymaster address, and per-market `condition_id` / token ids are account- and market-specific. Ask your XO contact for these during onboarding.

## Order signing at a glance

Sign orders against this EIP-712 domain. See [Smart accounts](/guides/smart-accounts) for the full hashing reference and a Solidity snippet showing exactly what the exchange hashes.

```text theme={null}
name              = "XO Market CLOB"
version           = "1"
chainId           = 3223
verifyingContract = 0x4bC5E872256D12E6017dfe466E04c867DC761B77
```

For smart-account orders:

* `maker` is your XO smart account.
* `signer` is the **same** smart account address — the exchange requires `maker == signer` for `signatureType = 3`.
* `signatureType` is `3`.
* `signature` is a 65-byte ECDSA signature produced by the **owner EOA** registered on the smart account. The smart account validates it through ERC-1271 (`isValidSignature(orderHash, signature)`).

## Next steps

<CardGroup cols={2}>
  <Card title="Smart accounts" icon="user-shield" href="/guides/smart-accounts">
    Smart account identity, ERC-1271, and order hashing.
  </Card>

  <Card title="Redeem positions" icon="hand-holding-dollar" href="/guides/redeem-positions">
    Claim settled Conditional Tokens through the XO bundler.
  </Card>

  <Card title="Fees" icon="coins" href="/guides/fees">
    How taker and maker fees are charged on fills.
  </Card>

  <Card title="Authentication" icon="shield-halved" href="/api-reference/authentication">
    L1 ClobAuth and L2 HMAC headers.
  </Card>

  <Card title="Rate limits" icon="gauge-high" href="/api-reference/rate-limits">
    Per-tier request and connection limits.
  </Card>

  <Card title="Orderbook API reference" icon="rectangle-list" href="/api-reference/introduction">
    CLOB REST and WebSocket endpoints.
  </Card>

  <Card title="Data API reference" icon="database" href="/data-api-reference/introduction">
    Market discovery, Pulse metadata, and public portfolio reads.
  </Card>
</CardGroup>

## Support

For credentials, the mainnet RPC `api_key`, paymaster details, and rollout questions, use the XO onboarding channel provided to your team.
