> 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/getting-started/onboarding.md).

# Quickstart

Connect to Reya's **order book** to read market data, submit orders, and track executions. You can start with market data before configuring an account or signer.

{% hint style="info" %}
This guide targets **mainnet** and API **3.6.2**. Use the endpoints and signing values in [Environments](/developers/getting-started/environments.md) together; the same steps work on devnet1 with its values.
{% endhint %}

## 1. Read market data

Market-data requests do not require a signer or wallet signature. Fetch the available perpetual markets and collateral assets:

```bash
curl --fail --silent --show-error https://api.reya.xyz/v2/perpMarketDefinitions
curl --fail --silent --show-error https://api.reya.xyz/v2/assetDefinitions
```

Use the returned market definitions when constructing orders rather than hard-coding symbols, market IDs, or price and quantity increments. See [Markets & Assets](/developers/reference/markets-and-assets.md) and the [REST API Reference](/developers/api-reference/rest-api-reference.md) for spot markets and other queries.

For streaming depth and prices, use the [WebSocket Info API](/developers/api-reference/websocket-api-reference.md). Its depth stream maintains the top 100 levels on each side; read the `/v2/market/{symbol}/depth` section before combining REST snapshots with WebSocket updates.

## 2. Select your account and authorise a signer

To submit orders, use an account with sufficient collateral and a signer authorised for that account. You only need the account type you intend to trade; see [Accounts & Subaccounts](/developers/getting-started/accounts-and-subaccounts.md).

Query `GET /v2/wallet/{address}/accounts` using your **owner wallet address** to find your `accountId`. The owner wallet owns the account; the signer key authorises orders. They can be different wallets.

Connect the owner wallet to the [API Keys page](https://app.reya.xyz/api-page) to authorise the public address of your signer. Keep the signer's private key in your client. [Signer Authorization](/developers/getting-started/signer-authorization.md) explains permissions and nonce handling.

## Install the pinned Python SDK

Use Python **3.12 or later** and install SDK **3.6.1.0**:

```bash
git clone --no-checkout https://github.com/Reya-Labs/reya-python-sdk.git
cd reya-python-sdk
git checkout --detach v3.6.1.0
git submodule update --init specs
python3.12 -m venv .venv
.venv/bin/python -m pip install .
.venv/bin/python -c "from importlib.metadata import version; print(version('reya-python-sdk'))" # 3.6.1.0
cp .env.example .env
```

Fill in the account and signer values in `.env`. Its network defaults target devnet1; for mainnet, replace them with the [mainnet values](/developers/getting-started/environments.md#mainnet). SDK **3.6.1.0** targets API **3.6.1**; the final `0` is the SDK build number.

Follow [Handling ambiguous outcomes](/developers/connectivity/handling-ambiguous-outcomes.md) when deciding whether to retry or reconcile. An unrecognised error or response-parsing failure does not prove that an order was rejected.

## 3. Submit and cancel an order

The pinned SDK includes a [WebSocket order-entry example](https://github.com/Reya-Labs/reya-python-sdk/blob/v3.6.1.0/examples/websocket/exec/ws_exec.py) that creates and cancels one spot LIMIT GTC order. For this example, configure these `.env` values:

| Variable                | Value                                                     |
| ----------------------- | --------------------------------------------------------- |
| `SPOT_ACCOUNT_ID_1`     | Your spot account ID                                      |
| `SPOT_WALLET_ADDRESS_1` | The account owner's wallet address                        |
| `SPOT_PRIVATE_KEY_1`    | The private key of the signer authorised for that account |

Run from the SDK checkout:

```bash
.venv/bin/python -m examples.websocket.exec.ws_exec
```

The example uses `WETHRUSD`; check its [prerequisites](https://github.com/Reya-Labs/reya-python-sdk/blob/v3.6.1.0/examples/websocket/exec/README.md) and the current market definition before running it. For perpetual orders or another language, follow [Signatures & Nonces](/developers/authentication/signatures-and-nonces.md), [Order Types & Time-in-Force](/developers/order-entry/order-types-and-tif.md), and the [REST](/developers/api-reference/rest-api-reference.md) or [WebSocket Order Entry](/developers/api-reference/ws-exec-api-reference.md) reference.

## 4. Track the outcome and stay current

Subscribe to account updates through the [WebSocket Info API](/developers/api-reference/websocket-api-reference.md). An accepted order or a matching-engine fill does not by itself confirm settlement: reconcile confirmed [Executions & Trade History](/developers/executions-and-settlement/executions-and-trade-history.md) and handle [Trade Busts](/developers/executions-and-settlement/trade-busts.md). On reconnect, rebuild subscriptions and reconcile account state through REST.

Follow the [Changelog](/developers/changelog/changelog.md) and [API updates channel](https://t.me/reya_api_updates) for changes that affect your integration.
