API
The API serves every read the site shows and builds every transaction the wallet signs.
Reads
| Route | Returns |
|---|---|
GET /v1/events | Events, 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}/candles | Candles 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}/liquidity | Pools and a wallet’s LP positions. |
GET /v1/portfolio/{wallet} | Holdings per event in two columns, LP positions, history. |
GET /v1/program | The program id, the cluster, the fee and the token’s mint. |
GET /v1/stream | Server-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.
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:
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.
| Code | Meaning |
|---|---|
QUOTE_STALE | The pool changed since the quote. Build again. |
INSUFFICIENT_BALANCE | The wallet does not hold enough of the input token. |
SLIPPAGE_EXCEEDED | The price moved beyond the stated slippage. |
EVENT_CLOSED | Trading has stopped while the event awaits resolution. |
EVENT_RESOLVED | The event has resolved. Redeem the winning branch. |
EVENT_NOT_RESOLVED | Redeeming waits for the outcome. |