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.
API order placement
For API trading, use pre-signed orders.
Server-side signing may slow order ingestion. Follow the
one-time setup and grant
orders:place_signed for signed single-order and batch submissions.
This section focuses on:
- Inventory: how binary YES/NO tokens are minted, reserved, and merged.
- Operations: post-only orders, self-trade prevention, asynchronous cancellation, and quote-loop sizing.
- LP Rewards: qualifying spreads and sizes, exact scoring, daily pool allocation, and worked examples.
- Errors, retries, and recovery: handling rejected and uncertain requests, rebuilding both streams, and resuming safely.
- Pre-signed orders: the recommended placement flow for API trading, with single-order and batch endpoints.
- Cross-orderbook matching: how YES and NO orders fill each other and how this affects your own quotes.
- 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
| Capability | Where to look |
|---|---|
| Post-only orders | Orders → post-only |
| Cancel-maker self-trade prevention | Self-trade prevention |
| Time-bounded GTD orders | Orders → time in force |
| Daily liquidity rewards | LP Rewards |
| Cancel current nonterminal orders | Orders → cancel everything open |
| Private fills, acknowledgements, and cancellations | Account stream |
| Public orderbook and quote updates | Market stream |
| HTTP codes, uncertain submissions, and stream recovery | Errors, retries, and recovery |
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, then implement the quote loop. Before enabling placements, implement the full error and recovery flow.