> For the complete documentation index, see [llms.txt](https://sodex.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sodex.com/documentation/for-developers/developers/trading/quickstart.md).

# Quickstart

Connect to SoDEX Spot or Perps, register an API key, and start trading through REST or an official SDK.

## 1. Set up your account

| Environment | REST base URL                  | Chain ID | What it covers                               |
| ----------- | ------------------------------ | -------- | -------------------------------------------- |
| Testnet     | `https://testnet-gw.sodex.dev` | `138565` | Order placement and account APIs.            |
| Mainnet     | `https://mainnet-gw.sodex.dev` | `286623` | Orders plus the deposit and withdrawal loop. |

Spot endpoints use `/api/v1/spot`; Perps endpoints use `/api/v1/perps`.

There is no Testnet Mirror API. To fund or withdraw on Mainnet:

1. Bring the asset onto ValueChain with [Custody Deposits](/documentation/for-developers/developers/mirror-protocol/lifecycle/custody-deposits.md) or [Bridge Deposits](/documentation/for-developers/developers/mirror-protocol/lifecycle/deposits.md), unless it is already there.
2. Credit Spot or Perps with [ValueChain to Spot or Perps](/documentation/for-developers/developers/mirror-protocol/lifecycle/valuechain-transfers.md). If the trading account does not exist (`UserNotFound`), the first credit must be **USDC or SOSO** (activation costs 1 unit).
3. To leave SoDEX, move Perps → Spot → ValueChain EVM, then [Withdrawals](/documentation/for-developers/developers/mirror-protocol/lifecycle/withdrawals.md). Trading transfers stop at EVM.

A signed order example can run on Testnet once that account is funded. The full external deposit and withdrawal path is Mainnet.

## 2. Register an API key

Use your master wallet to register a separate trading key. Use that key for routine trading and keep its private key local. The `X-API-Key` header contains the registered **key name**.

Follow the [registration example](/documentation/for-developers/developers/trading/api-keys-and-nonces.md#register-a-trading-api-key) in API Keys and Nonces to create and verify your trading key.

## 3. Connect your application

Choose an [official SDK](/documentation/for-developers/sdks.md), or use REST directly with [Authentication & Signing](/documentation/for-developers/developers/trading/authentication-and-signing.md).

Before placing an order, retrieve the account ID and market rules, including price and quantity increments. See the [Python SDK examples on GitHub](https://github.com/sodex-tech/sodex-python-sdk-public/tree/main/examples), or [Manual REST Signing](/documentation/for-developers/developers/trading/authentication-and-signing/manual-rest-signing.md) for raw HTTP requests.

## 4. Track your orders

A successful submission is not a fill. Retain the client order ID and returned order ID, then track [Account Order Updates](/documentation/for-developers/api-reference/trading-api/websocket-v1/account-order-updates.md) and [Account Trades](/documentation/for-developers/api-reference/trading-api/websocket-v1/account-trades.md).

If a request times out or the WebSocket disconnects, [reconcile with REST](/documentation/for-developers/developers/trading/authentication-and-signing/manual-rest-signing.md#recover-state-with-rest) before retrying.

## API Reference

{% content-ref url="/pages/JhkOXmaIr0osLMjp2DfF" %}
[REST API](/documentation/for-developers/api-reference/trading-api/rest-v1.md)
{% endcontent-ref %}

{% content-ref url="/pages/U25Aeh8OoqsoN02ofoj4" %}
[WebSocket Streams](/documentation/for-developers/api-reference/trading-api/websocket-v1.md)
{% endcontent-ref %}

{% content-ref url="/pages/HWeWqIzQUTNao2smQ2pp" %}
[Rate Limits](/documentation/for-developers/developers/trading/api-rate-limits.md)
{% endcontent-ref %}
