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

# Upside DEX — Perpetuals Exchange API Documentation

> Complete API reference for Upside DEX — REST write operations, read queries, and real-time WebSocket streaming for perpetuals trading.

Upside DEX provides a high-performance perpetuals exchange API with three channels: signed write operations via `POST /exchange`, unauthenticated read queries via `POST /info`, and real-time event streaming over WebSocket. Use this documentation to integrate trading, account management, and market data into your application.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/guide/quickstart">
    Make your first signed API call — register an account, place an order, and cancel it in minutes.
  </Card>

  <Card title="Authentication" icon="key" href="/guide/authentication">
    Learn how to sign requests with EIP-712 ECDSA so the exchange can verify your identity.
  </Card>

  <Card title="Write API Reference" icon="pen-to-square" href="/exchange/overview">
    Full reference for all POST /exchange actions — orders, margins, collateral, and more.
  </Card>

  <Card title="Read API Reference" icon="magnifying-glass" href="/info/overview">
    Query market data, account state, and order status without signing via POST /info.
  </Card>

  <Card title="WebSocket Streaming" icon="bolt" href="/websocket/overview">
    Subscribe to real-time order book, trade, candle, and account update streams.
  </Card>

  <Card title="Error Codes" icon="triangle-exclamation" href="/guide/error-codes">
    HTTP error codes and business-level error messages with remediation steps.
  </Card>
</CardGroup>

## How the API Works

Upside DEX uses an **action-based** API design. Instead of distinct URL paths per operation, both the write and read endpoints route calls by an `action` (write) or `type` (read) field in the request body.

<CardGroup cols={3}>
  <Card title="POST /exchange" icon="lock" href="/exchange/overview">
    All write operations — orders, cancels, margin adjustments, collateral transfers. Requires ECDSA signature on every request.
  </Card>

  <Card title="POST /info" icon="circle-info" href="/info/overview">
    All read queries — market data, account balances, order status. No authentication required.
  </Card>

  <Card title="WebSocket" icon="wifi" href="/websocket/overview">
    Real-time push streams for order book snapshots, trades, candles, and private order/fill updates.
  </Card>
</CardGroup>

## Environments

| Environment | REST Base URL               | WebSocket URL                |
| ----------- | --------------------------- | ---------------------------- |
| QA          | `https://dev.upsidemax.xyz` | `wss://dev.upsidemax.xyz/ws` |
| UAT         | Contact Upside team         | Contact Upside team          |
| Production  | Contact Upside team         | Contact Upside team          |

<Note>
  The QA environment currently supports one contract: **SOL1** (contract ID `1`, quote currency `USDT1`). Prices must be integers with a maximum value of `10000`. Refer to the [introduction](/guide/introduction) for full testnet constraints.
</Note>

## Get Started in 3 Steps

<Steps>
  <Step title="Understand signing">
    All write operations require EIP-712 ECDSA signing. Read the [Authentication guide](/guide/authentication) to understand how to construct and sign the request envelope.
  </Step>

  <Step title="Register your account">
    Call [`registerAccount`](/exchange/register-account) with your wallet address to get an `accountId`. This is the unique identifier used across all API calls.
  </Step>

  <Step title="Place your first order">
    With your account registered, follow the [Quickstart](/guide/quickstart) to place a limit order and verify it appears in your active orders.
  </Step>
</Steps>
