For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

This guide targets mainnet and API 3.6.2. Use the endpoints and signing values in Environments together; the same steps work on devnet1 with its values.

1. Read market data

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

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 and the REST API Reference for spot markets and other queries.

For streaming depth and prices, use the WebSocket Info API. 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.

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 to authorise the public address of your signer. Keep the signer's private key in your client. Signer Authorization explains permissions and nonce handling.

Install the pinned Python SDK

Use Python 3.12 or later and install SDK 3.6.1.0:

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. SDK 3.6.1.0 targets API 3.6.1; the final 0 is the SDK build number.

Follow Handling ambiguous outcomes 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 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:

The example uses WETHRUSD; check its prerequisites and the current market definition before running it. For perpetual orders or another language, follow Signatures & Nonces, Order Types & Time-in-Force, and the REST or WebSocket Order Entry reference.

4. Track the outcome and stay current

Subscribe to account updates through the WebSocket Info API. An accepted order or a matching-engine fill does not by itself confirm settlement: reconcile confirmed Executions & Trade History and handle Trade Busts. On reconnect, rebuild subscriptions and reconcile account state through REST.

Follow the Changelog and API updates channel for changes that affect your integration.

Last updated