Agara

Positions

Split collateral into a complete binary pair and merge a held pair back into collateral.

Outcome tokens enter or leave your account through trading or two explicit position operations:

  • Split locks collateral and mints one unit of each binary outcome per collateral unit.
  • Merge burns equal quantities of both outcomes and returns collateral.

Every AGARA market is binary. Neg-risk events group binary member markets; a member uses the same split and merge paths as a standalone market.

EndpointAuthentication
POST /trade/v1/portfolio/positions/splitPAT with positions:split
POST /trade/v1/portfolio/positions/mergePAT with positions:merge

Split and merge are refused after a market is resolved. Supported standalone markets use automatic redemption after resolution.

Asynchronous lifecycle

Both endpoints return 201 with an account-batch hash:

{
  "batch_hash": "0x2174…",
  "status": "PENDING",
  "as_of": "2026-07-20T11:00:00.000Z"
}

Poll GET /trade/v1/batches/{batch_hash}. PENDING means only that the request was accepted. Treat the operation as final at SETTLED; a failed batch reverses provisional balance changes.

Operations queue per account and run in the order you started them, so a second split, merge, or withdrawal is accepted while the first is still settling. The queue has a limit; past it you get a 409 until one finishes.

Split

POST /trade/v1/portfolio/positions/split

{
  "condition_id": "0x2174…",
  "collateral_amount_micro": "10000000"
}

collateral_amount_micro must be positive. 10000000 locks ten collateral units and mints ten units of each outcome.

Merge

POST /trade/v1/portfolio/positions/merge

{
  "condition_id": "0x2174…",
  "shares_micro": "5000000"
}

shares_micro is burned from each outcome. 5000000 burns five units of both legs and returns five collateral units. Merge converts a complete pair at one collateral unit per pair; it does not use the orderbook midpoint.

If you split 100 units and later sell 50 units of each outcome, the remaining 50-unit complete pair can be merged. A single unmatched outcome cannot be merged alone.

Merge everything

POST /trade/v1/portfolio/positions/merge-all

This browser-only endpoint merges the available smaller leg in every eligible market. A 201 returns batch-group IDs; a 200 with an empty group_ids array means nothing was mergeable.

{
  "group_ids": ["7f3a5c21-8d4f-4a96-b072-5e1c9a3d6f41"],
  "as_of": "2026-07-20T12:00:00Z"
}

Poll GET /trade/v1/batch-groups/{group_id} until completed_at is set. Each chunk also carries a batch_hash readable through GET /trade/v1/batches/{batch_hash}.

Errors

StatusAction
400Correct a non-positive amount or unknown condition ID
401Send a valid token
403Add the required split or merge scope
404Complete AGARA wallet registration for this account
409The queue is full, or a merge-all is settling; wait for one to finish
422Reduce the amount, restore collateral/share coverage, or use a supported unresolved market
424Finish wallet setup and signer authorization
502Retry with backoff when the chain service is available
503Position batches are not available on the deployment

Cross-match settlement

Position tokens can also be created or burned when orders match:

MatchSettlement
Same-outcome SELL and BUYNormal token transfer
Complementary BUY ordersMint a complete pair from both buyers' collateral
Complementary SELL ordersMerge the complete pair and return collateral

The fill's settlement_mode reports the path. SELL orders always require and reserve actual outcome shares; complementary BUY orders can create inventory from collateral during a match.

On this page