CHANCEDB API
Read market data
Query published market distributions, probabilities, outcomes, and forecast scores. These GET methods read Base and return JSON with block provenance; they do not submit transactions or store market state.
/api/quantileGet a quantile
Return the market outcome at probability p. For example, the median uses p=0.5.
current, crowd, or a report ID.Run the example to see the live response.
The response includes quantile, the selected view, decimal coefficients, blockNumber, and blockTimestamp.
/api/probabilityGet probability and density
For an outcome threshold x, return the cumulative probability, exceedance probability, and probability density.
current, crowd, or a report ID.Run the example to see the live response.
cdf is P(X ≤ x), exceedance is P(X > x), and pdf is the density at x.
/api/outcomeRead the resolved outcome
Return the outcome published to the market contract and the evaluation target. This endpoint returns HTTP 409 until the market is resolved.
Run the example to see the live response.
The response includes outcome, outcomeWad, evaluationTarget, blockNumber, and blockTimestamp.
/api/leaderboardRead the forecast leaderboard
After resolution, rank unchallenged reports by log-density at the realized outcome. The response also includes crowd and current-view benchmarks. Returns HTTP 409 before resolution.
Run the example to see the live response.
Each leaderboard entry includes rank, reportId, reporter, and logDensity. Higher log-density ranks better for this realized outcome.
/api/readRead a contract view
Call a supported Solidity view getter at one Base block. This is a read-only wrapper around the market ABI; it cannot call write methods.
reportA; report IDs start at zero.Run the example to see the live response.
The result includes the selected method, raw contract return value, blockNumber, and blockTimestamp. Integer values are decimal strings. reportA returns the named report fields; coefficient arrays remain raw int256 WAD values. Legacy reports return null for fields that version does not store.
SHARED BEHAVIOR
Views, units, and freshness
- Default view: before resolution, curve methods use
current. After resolution, they usecrowd, falling back tocurrentwhen there are no unchallenged reports. - Explicit views:
currentreadscurrentA();crowdaverages active reports’ coefficients position by position, padding shorter vectors with zero; a numeric view selects that report’snewA. Report IDs start at zero. - Units: probabilities are between 0 and 1. Outcomes use fractional market units; for example,
0.01represents a 1% change. - Freshness: curve, outcome, and leaderboard responses include block number and timestamp so callers can verify the chain snapshot.
- Read-only: all examples call GET endpoints. They do not write to the chain, require a wallet, or persist data.