# Agara Trading API

> Place orders, read live depth, and monitor fills on AGARA markets.

**REST origin:** `https://app.agara.xyz` · **WebSocket origin:** `wss://app.agara.xyz`

Trading endpoints live under `/trade/v1`; market discovery lives under
`/api/v1`.

<Callout type="info" title="API order placement">
For API trading, use [pre-signed orders](/docs/api-traders/pre-signed-orders).
Server-side signing may slow order ingestion. Follow the
[one-time setup](/docs/api-traders/pre-signed-orders#one-time-setup) and grant
`orders:place_signed` for signed single-order and batch submissions.
</Callout>

## Where to start [#where-to-start]

<Cards>
<Card title="Quickstart" href="/docs/quickstart">
Discover a market, place an order, and confirm a fill.
</Card>

<Card title="Authentication" href="/docs/authentication">
Create a scoped personal access token and send it safely.
</Card>

<Card title="Wallet setup" href="/docs/wallet-setup">
Prepare and fund your AGARA deposit wallet before trading.
</Card>

<Card title="Conventions" href="/docs/conventions">
Amount units, identifiers, pagination, and asynchronous status lifecycles.
</Card>

<Card title="Errors and recovery" href="/docs/errors">
Stable codes, safe retries, asynchronous failures, and request IDs.
</Card>
</Cards>

## Reference [#reference]

<Cards>
<Card title="Markets" href="/docs/markets">
Discover events and the `condition_id` and `token_id` values used by trading calls.
</Card>

<Card title="Orders" href="/docs/orders">
Place, list, inspect, and cancel orders.
</Card>

<Card title="LP Rewards" href="/docs/lp-incentives">
Understand qualifying orders, liquidity scoring, projections, and daily reward pools.
</Card>

<Card title="Orderbook" href="/docs/orderbook">
Read live bid and ask depth.
</Card>

<Card title="Streaming" href="/docs/streaming">
Receive books, quotes, trades, market status, newly active cycles, and resolved-market updates.
</Card>

<Card title="Portfolio" href="/docs/portfolio">
Reconcile collateral, positions, fills, orders, and activity.
</Card>

<Card title="Account stream" href="/docs/account-stream">
Receive private order, fill, position, redemption, and collateral updates.
</Card>

<Card title="Tokens" href="/docs/tokens/collateral">
Verify the active collateral and AGARA contract addresses before signing or moving funds.
</Card>
</Cards>

## Endpoint summary [#endpoint-summary]

| What you want to do                                 | Method   | Path                             |
| --------------------------------------------------- | -------- | -------------------------------- |
| Browse or search events                             | `GET`    | `/api/v1/events?source=AGARA`    |
| Read one event and its markets                      | `GET`    | `/api/v1/events/{slug}`          |
| Place a pre-signed order (recommended)              | `POST`   | `/trade/v1/orders/signed`        |
| Place a batch of pre-signed orders                  | `POST`   | `/trade/v1/orders/signed/batch`  |
| Place a server-signed order                         | `POST`   | `/trade/v1/orders`               |
| List your orders                                    | `POST`   | `/trade/v1/orders/list`          |
| Look up one order                                   | `GET`    | `/trade/v1/orders/{order_id}`    |
| Cancel an order                                     | `DELETE` | `/trade/v1/orders/{order_id}`    |
| Schedule cancellation of current nonterminal orders | `POST`   | `/trade/v1/orders/cancel-all`    |
| Read the orderbook                                  | `GET`    | `/trade/v1/orderbook/{token_id}` |
| Stream market data                                  | `WS`     | `/trade/v1/market-stream`        |
| Stream account events                               | `WS`     | `/trade/v1/account-stream`       |
| Read fill history                                   | `GET`    | `/trade/v1/portfolio/trades`     |

Orders and account REST requests need an `Authorization: Bearer <token>`
header. Market discovery, orderbooks, and the market stream are public. The
account WebSocket receives its token in the first `subscribe` message; do not
put it in the WebSocket URL.

## Funding in this environment [#funding-in-this-environment]

Production uses real `USDC` on Base. Verify
the token contract on [Collateral](/docs/tokens/collateral) before depositing
or withdrawing.

The web app can quote supported cross-chain withdrawals. Query the withdrawal
supported-assets endpoint immediately before requesting a route because
availability can change.
