Portfolio
Reconcile AGARA collateral, positions, open orders, fills, activities, and withdrawals.
Portfolio reads require a personal access token with portfolio:read. These
docs cover the AGARA exchange; keep the returned exchange fields in your
models so each row remains self-identifying.
Summary
GET /trade/v1/portfolio/summary
Use the summary before sizing a new order and after any deposit, withdrawal, position operation, or automatic redemption.
| Field | Meaning |
|---|---|
cash_balance_micro | Current collateral balance |
free_cash_micro | Cash available to AGARA's BUY validation |
positions_value_micro | Marked value of open positions |
portfolio_value_micro | Cash plus marked positions |
open_cost_basis_micro | Cost basis still attached to open positions |
open_unrealized_pnl_micro | Marked value less open cost basis |
as_of | Timestamp of this exchange snapshot |
Resting BUY commitments are not a separate summary field. Read open orders and account for their remaining collateral when your strategy computes its own available quoting budget.
Positions
POST /trade/v1/portfolio/positions/list
Positions are returned as one complete snapshot, not a paginated list.
An empty condition_ids array returns every current position. Use one or more
condition IDs to narrow the snapshot.
shares_micro is your total holding. Use available_shares_micro as the maximum
size for a new sell order — it excludes shares your own open sell orders have
already committed, so "0" means every share you hold is already up for sale.
mergeable and mergeable_shares_micro are advisory snapshots for a held,
available complete pair. redeemable identifies a resolved position; supported
standalone markets are handled by automatic redemption.
Retry when unavailable_exchanges contains AGARA because that snapshot is
missing AGARA rows.
Open orders
POST /trade/v1/portfolio/open-orders/list
The response contains:
orders: non-terminal order rows in the same shape documented under Orders;markets: metadata keyed bytoken_id, including raw market/outcomedisplayobjects;events: metadata keyed by event slug, including the raw eventdisplay;pagination:next_cursorand the appliedlimit;as_of: the snapshot time.
Orders are newest first. Pass pagination.next_cursor back as cursor with
the same token_ids and exchanges filters. A null cursor means the walk is
complete.
Trades
GET /trade/v1/portfolio/trades
Query parameters are limit (default and maximum 500) and an opaque
cursor from the previous response.
fill_id is serialized as a string. transaction_hash remains null until
settlement supplies one. Keep paging until next_cursor is null; retry a page
when unavailable_exchanges contains AGARA.
Activities
GET /trade/v1/portfolio/activities
Activities are a snapshot-stable AGARA history sorted newest first. limit
defaults to 50 and accepts 1 through 500; pass the opaque cursor to
continue the same walk.
The type discriminator selects one of these wire shapes:
| Type | Fields in addition to type, exchange, id, and created_at |
|---|---|
ORDER | order_id, terminal status, fill_status, condition_id, token_id, side, filled_shares_micro, average_fill_price_micro, filled_amount_micro, fees_micro |
SPLIT | condition_id, shares_micro, amount_micro, tx_hash |
MERGE | condition_id, shares_micro, amount_micro, tx_hash |
REDEEM | condition_id, winning token_id, shares_micro, amount_micro, tx_hash |
DEPOSIT | amount_micro, chain_id, token_address, counterparty_address, tx_hash |
WITHDRAWAL | amount_micro, chain_id, token_address, counterparty_address, tx_hash |
ORDER appears only for a terminal order with at least one fill.
fill_status is FULL or PARTIAL; status is MATCHED, CANCELLED,
EXPIRED, REJECTED, or FAILED.
The metadata sidecars cover only rows present on the current page:
markets is keyed by outcome token ID, conditions by condition ID, and
events by event slug. Activities do not return unavailable_exchanges.
Position operations
Split and merge convert between collateral and complete binary token pairs:
POST /trade/v1/portfolio/positions/splitrequirespositions:split;POST /trade/v1/portfolio/positions/mergerequirespositions:merge.
Both accept a scoped personal access token and return 201 with
batch_hash, status: "PENDING", and as_of. Poll
GET /trade/v1/batches/{batch_hash} for settlement. See
Positions for request shapes, validation, merge-all,
and cross-match settlement.
Supported resolved standalone markets use automatic redemption; no client-submitted operation is required.
Withdrawals
The standard withdrawal flow requires a current browser session. A personal access token alone cannot execute it.
- Same-chain withdrawal sends
USDCto an address on Base. - Accepted AGARA withdrawals return
201with a pending batch hash. Poll the batch until it reachesSETTLEDbefore treating destination funds as final. - Requests queue per account and settle in order. A
409means the queue is full or a merge-all is settling; retry once one finishes. - The minimum is
10000micro units. The environment's batch ceiling can impose a tighter bound.
For a cross-chain withdrawal:
- Use a personal access token to read
GET /trade/v1/portfolio/bridge/withdraw/supported-assets. - Request
POST /trade/v1/portfolio/bridge/withdraw/quotewith the destination chain, token, recipient, and source amount. - Review the current quote, then confirm in the signed-in web flow.
If a route refunds to the AGARA account, the return appears as a DEPOSIT
activity. A quoted route minimum can be higher than the standard withdrawal
minimum. Request a new quote before retrying.
Common pattern
Before placing a new quote, fetch summary and open orders together. Use the
summary's free_cash_micro as AGARA's current BUY-validation cash, then apply
your own risk limits and account for the remaining commitments in open orders.
Every portfolio endpoint's full request and response shape is in the Portfolio API reference.