API

The API serves every read the site shows and builds every transaction the wallet signs.

Reads

RouteReturns
GET /v1/eventsEvents, filtered by open, closing-soon or resolved.
GET /v1/events/{id}One event: odds, and per asset both branch prices, impact, pool reserves and depth.
GET /v1/events/{id}/candlesCandles per branch pool, with odds and impact series.
GET /v1/events/{id}/balances/{wallet}A wallet’s plain and branch tokens for the event.
GET /v1/events/{id}/liquidityPools and a wallet’s LP positions.
GET /v1/portfolio/{wallet}Holdings per event in two columns, LP positions, history.
GET /v1/programThe program id, the cluster, the fee and the token’s mint.
GET /v1/streamServer-sent events: market, portfolio and transaction updates.

Amounts are integer base units as strings. Prices are decimal strings.

Building a transaction

Each action has a build route under POST /v1/events/{id}/build/: trade, odds, split, merge, close-position, add-liquidity, remove-liquidity, redeem. The response is an unsigned v0 transaction with the quote it was built at and what the wallet holds in each outcome.

Buy SOL if YES with 250 USDC
POST /v1/events/{id}/build/trade
{
  "wallet": "<address>",
  "assetMint": "<mint>",
  "side": "buy",
  "branch": "YES",
  "amount": "250000000",
  "slippageBps": 50
}

Sign the transaction with the wallet, then hand it back:

Submit and follow
POST /v1/transactions/submit
GET  /v1/transactions/{id}

Errors

Every failure is one envelope: a stable code, a message, whether retrying can help, and the stage that failed.

CodeMeaning
QUOTE_STALEThe pool changed since the quote. Build again.
INSUFFICIENT_BALANCEThe wallet does not hold enough of the input token.
SLIPPAGE_EXCEEDEDThe price moved beyond the stated slippage.
EVENT_CLOSEDTrading has stopped while the event awaits resolution.
EVENT_RESOLVEDThe event has resolved. Redeem the winning branch.
EVENT_NOT_RESOLVEDRedeeming waits for the outcome.