> For the complete documentation index, see [llms.txt](https://docs.reya.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reya.xyz/developers/devnet/getting-started/readme.md).

# Introduction

Build trading clients, market-data tools, dashboards, and automated strategies on Reya's order book. Start with the [Quickstart](/developers/devnet/getting-started/onboarding.md), then use the references below to sign and submit orders, stream market data and fills, and reconcile settlement.

{% hint style="info" %}
This guide covers the perpetual and spot order book on **devnet1**, with API **3.5.2** and Python SDK **3.5.2.0**. Use the [current mainnet API documentation](https://docs.reya.xyz/developers/) for existing mainnet integrations. The [V2 Migration Reference](/developers/devnet/changelog/v2-migration.md) explains the differences, and [Under Development](/developers/devnet/under-development/whats-next.md) lists features that are not yet available.
{% endhint %}

## What Reya is

Reya runs a **central-limit order book for perpetual futures and spot**, matched by an **off-chain matching engine (ME)** and settled on **Reya Network**, an Ethereum L2. It is a **hybrid system**: matching is fast and off-chain, while every resulting trade is independently validated and settled on-chain. The chain is always the ultimate source of truth.

Concretely, as an integrator you:

1. **Sign** each order as an EIP-712 `OrderDetails` payload with your trading wallet. (See [Signatures & Nonces](/developers/devnet/authentication/signatures-and-nonces.md).)
2. **Submit** it over [REST](/developers/devnet/api-reference/rest-api-reference.md) or the [WebSocket Order Entry API](/developers/devnet/api-reference/ws-exec-api-reference.md) — both carry the same payloads and signing rules.
3. The **ME matches** your order against the book and produces fills.
4. Reya **validates each fill for on-chain settlement**.
5. **Track the settlement outcome** and reconcile order state and fills over the [WebSocket Info API](/developers/devnet/api-reference/websocket-api-reference.md), and handle the rare [trade bust](/developers/devnet/executions-and-settlement/trade-busts.md) when on-chain settlement rejects a match.

## Both perp and spot go through the same path

Perpetual and spot orders share one order-entry surface, one matching engine, and one settlement path. They differ only in the market they target and in a few settlement details. Where the two diverge — for example the `marketId` namespace (see [Market IDs](/developers/devnet/reference/market-ids.md)), or the `perpExecutions` vs `spotExecutions` channels — the relevant page calls it out explicitly.

{% hint style="warning" %}
**Breaking changes for existing spot integrators.** Because perp and spot share **one** order-entry surface, the changes shipping with the perp order book are **breaking for spot too** — not only perp. Order payloads have new and changed fields, the **EIP-712 signing envelope has changed**, and several endpoints and schemas were renamed, so if you trade spot through the V2 endpoints today, you must migrate your integration before the order book is enabled. See the [**V2 perpOB Migration Reference**](/developers/devnet/changelog/v2-migration.md) for the complete list of breaking and non-breaking changes, the [Changelog](/developers/devnet/changelog/changelog.md) for the dated record, and [Signatures & Nonces](/developers/devnet/authentication/signatures-and-nonces.md) for the signing recipe.
{% endhint %}

## How these docs are organised

* **Getting Started** — [quickstart](/developers/devnet/getting-started/onboarding.md) (read market data and submit your first order), the [environments](/developers/devnet/getting-started/environments.md) and their URLs, the [account model](/developers/devnet/getting-started/accounts-and-subaccounts.md), and [signer authorization](/developers/devnet/getting-started/signer-authorization.md).
* **Connectivity** — [where the ME lives and how to connect](/developers/devnet/connectivity/connecting-to-the-matching-engine.md), plus [heartbeats](/developers/devnet/connectivity/heartbeats.md).
* **Authentication** — the [EIP-712 signing recipe and nonce strategy](/developers/devnet/authentication/signatures-and-nonces.md).
* **API Reference** — the [REST](/developers/devnet/api-reference/rest-api-reference.md), [WebSocket Order Entry](/developers/devnet/api-reference/ws-exec-api-reference.md), and [WebSocket Info](/developers/devnet/api-reference/websocket-api-reference.md) references.
* **Order Entry** — [order types & time-in-force](/developers/devnet/order-entry/order-types-and-tif.md), the [order lifecycle](/developers/devnet/order-entry/order-lifecycle.md), and [cancel-on-disconnect](/developers/devnet/order-entry/cancel-on-disconnect.md).
* **Executions & Settlement** — [trade settlement](/developers/devnet/executions-and-settlement/settlement.md), [trade busts](/developers/devnet/executions-and-settlement/trade-busts.md), and [executions & trade history](/developers/devnet/executions-and-settlement/executions-and-trade-history.md).
* **Pricing & Funding** — [oracle & index prices](/developers/devnet/pricing-and-funding/oracle-and-index-prices.md), the [mark price](/developers/devnet/pricing-and-funding/mark-price.md), and [funding](/developers/devnet/pricing-and-funding/funding.md).
* **Risk** — [liquidations & ADL](/developers/devnet/risk/liquidations-and-adl.md) and the [margin system](/developers/devnet/risk/margin-system.md).
* **Reference** — [market IDs](/developers/devnet/reference/market-ids.md), [markets & assets](/developers/devnet/reference/markets-and-assets.md), [fees](/developers/devnet/reference/fees.md), [contract addresses](/developers/devnet/reference/contract-addresses.md), [audits](/developers/devnet/reference/audits.md), and the [pinned Python SDK onboarding snapshot](https://github.com/Reya-Labs/reya-python-sdk/tree/37450ccb2babc99398d1ac1290d48860a9a2e2fa).

## Recommended starting path

If you're integrating for the first time, read in this order:

[Quickstart](/developers/devnet/getting-started/onboarding.md) → [Environments](/developers/devnet/getting-started/environments.md) → [Signatures & Nonces](/developers/devnet/authentication/signatures-and-nonces.md) → [REST API Reference](/developers/devnet/api-reference/rest-api-reference.md) → [Trade Settlement](/developers/devnet/executions-and-settlement/settlement.md) → [Trade Busts](/developers/devnet/executions-and-settlement/trade-busts.md).

The [pinned Python SDK onboarding snapshot](https://github.com/Reya-Labs/reya-python-sdk/tree/37450ccb2babc99398d1ac1290d48860a9a2e2fa) is the fastest way to get a correct signature end-to-end.

{% hint style="info" %}
The SDK links pin source commit `37450ccb`, whose generated clients and `specs` submodule match API **3.5.2**. The REST and WebSocket spec downloads link to the live devnet1 endpoints and may advance independently of this guide. For the exact API 3.5.2 contract, use the [pinned canonical spec source](https://github.com/Reya-Labs/reya-api-specs/tree/4fafae7d19076e8d31811930000a78d842758d9f). The SDK package version is **3.5.2.0**: the first three components track the API spec and the fourth is the SDK build number. Follow the [source installation instructions](/developers/devnet/getting-started/onboarding.md#install-the-pinned-python-sdk) for this exact snapshot.
{% endhint %}
