Docs/Data and deployment/HTTP API
HTTP API
Query indexed markets, fee-inclusive execution plans, trades, claims, charts, events, and collateral suppliers.
API access#
The production API is available at https://api.predistate.com. It serves markets created from currently verified resolver implementations. Market-specific paths include the chain ID and market address; third-party clients may independently index permissionless markets created from other resolvers.
Endpoints#
| Path | Returns |
|---|---|
GET /markets | Filterable, cursor-paginated market list. |
GET /markets/:chainId/:address | Market detail and indexed contract metadata. |
GET .../quote | YES and NO execution quotes plus guarded mark price. |
GET .../orderbook | Aggregated open levels by outcome and side. |
GET .../orders / orders/match | Open orders or an executable best-price match plan. |
GET .../chart / trades | Trade history normalized to YES and NO prices. |
GET .../events | Indexed market lifecycle events. |
GET .../collateral-suppliers | Accounts ranked by minted collateral. |
GET /leaderboards/market-creators | Seasonal Market Creator rankings by unique traders across verified markets. |
Quote response#
{
"market_address": "0x...",
"mark_source": "midpoint",
"max_spread": "0.1",
"min_eligible_notional": "1",
"max_trade_age_seconds": 604800,
"yes": {
"buy_now": "0.64",
"sell_now": "0.61",
"midpoint": "0.625",
"spread": "0.03",
"last_trade": "0.62",
"mark_price": "0.625"
},
"no": {
"buy_now": "0.39",
"sell_now": "0.36",
"midpoint": "0.375",
"spread": "0.03",
"last_trade": "0.38",
"mark_price": "0.375"
}
}Fee-inclusive match response#
orders/match calculates the fee independently for every matched level, then returns aggregate gross quote, fee, total cost or net proceeds, regular average price, and fee-inclusive effective average price. Buy approvals usetotal_cost; sells approve shares and display net_proceeds.
{
"data": [{
"price": "0.583000000000000000",
"fill_amount": "100000000",
"gross_quote_amount": "58300000",
"taker_fee_amount": "486222",
"total_cost": "58786222",
"net_proceeds": null
}],
"summary": {
"matched_amount": "100000000",
"gross_quote_amount": "58300000",
"taker_fee_amount": "486222",
"total_cost": "58786222",
"net_proceeds": null,
"average_price": "0.583",
"effective_average_price": "0.58786222"
}
}