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#

PathReturns
GET /marketsFilterable, cursor-paginated market list.
GET /markets/:chainId/:addressMarket detail and indexed contract metadata.
GET .../quoteYES and NO execution quotes plus guarded mark price.
GET .../orderbookAggregated open levels by outcome and side.
GET .../orders / orders/matchOpen orders or an executable best-price match plan.
GET .../chart / tradesTrade history normalized to YES and NO prices.
GET .../eventsIndexed market lifecycle events.
GET .../collateral-suppliersAccounts ranked by minted collateral.
GET /leaderboards/market-creatorsSeasonal Market Creator rankings by unique traders across verified markets.

Quote response#

GET /markets/4663/0x.../quotejson
{
  "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.

GET .../orders/match?outcome=yes&side=buy&amount=100000000json
{
  "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"
  }
}
Experimental Phase onRobinhood Chain