# For API traders

> Manage inventory, automate orders, and recover safely when trading through the API.

Use Agara's order, portfolio, and streaming APIs to build your trading
workflow. These guides explain how to manage inventory, automate resting
orders, and recover when your local view falls behind the market.

<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>

This section focuses on:

* **[Inventory](/docs/api-traders/inventory):** how binary YES/NO tokens are minted, reserved,
  and merged.
* **[Operations](/docs/api-traders/operations):** post-only orders, self-trade prevention,
  asynchronous cancellation, and quote-loop sizing.
* **[LP Rewards](/docs/lp-incentives):** qualifying spreads and sizes, exact
  scoring, daily pool allocation, and worked examples.
* **[Errors, retries, and recovery](/docs/api-traders/recovery):** handling
  rejected and uncertain requests, rebuilding both streams, and resuming safely.
* **[Pre-signed orders](/docs/api-traders/pre-signed-orders):** the recommended
  placement flow for API trading, with single-order and batch endpoints.
* **[Cross-orderbook matching](/docs/cross-orderbook-matching):** how YES and NO
  orders fill each other and how this affects your own quotes.
* **[Account batches](/docs/api-traders/account-batches):** signing your own split,
  merge, and withdrawal operations, one per batch.

These guides cover AGARA markets. Every market is binary, including each
member of a neg-risk event.

## Controls you will use [#controls-you-will-use]

| Capability                                             | Where to look                                                          |
| ------------------------------------------------------ | ---------------------------------------------------------------------- |
| Post-only orders                                       | [Orders → post-only](/docs/orders#post-only)                           |
| Cancel-maker self-trade prevention                     | [Self-trade prevention](/docs/self-trade-prevention)                   |
| Time-bounded GTD orders                                | [Orders → time in force](/docs/orders#time-in-force)                   |
| Daily liquidity rewards                                | [LP Rewards](/docs/lp-incentives)                                      |
| Cancel current nonterminal orders                      | [Orders → cancel everything open](/docs/orders#cancel-everything-open) |
| Private fills, acknowledgements, and cancellations     | [Account stream](/docs/account-stream)                                 |
| Public orderbook and quote updates                     | [Market stream](/docs/streaming)                                       |
| HTTP codes, uncertain submissions, and stream recovery | [Errors, retries, and recovery](/docs/api-traders/recovery)            |

## Important limits [#important-limits]

* A SELL order always requires and reserves the outcome shares being sold.
* A BUY order reserves collateral and its worst-case fee requirement.
* Complementary YES BUY and NO BUY orders can settle by minting a new pair;
  this does not make a conventional BUY/SELL quote inventory-free.
* Split and merge accept PATs with their respective position scopes;
  self-custody clients can combine inventory and withdrawal operations in a
  signed account batch.
* The platform does not cancel resting orders when your WebSocket disconnects.
  Reconcile and use cancel-all when your local state is uncertain.

Start with [Inventory](/docs/api-traders/inventory), then implement the
[quote loop](/docs/api-traders/operations#quote-loop-shape). Before enabling
placements, implement the full
[error and recovery flow](/docs/api-traders/recovery).
