Skip to main content
Chance splits cleanly into two layers. Everything that moves money is on-chain; the API exists so you don’t have to run your own indexer or prover.

The core loop

  1. Discover — resolve chainId and contract addresses from networkConfigs. Once, at startup.
  2. Place — build mode args, read currentCommitId(), send the place transaction. See Placing bets.
  3. Result — the API watches the chain, computes the outcome, and pushes it (with a ZK proof when available) over the socket. See Results & proofs.
  4. Claim — winners claim on-chain, choosing USDG or CHANCE. See Claiming.
  5. History — back-fill and paginate a wallet’s bets from playerBets.

Trust model

The API is a convenience layer, not an authority. Results it pushes are display-only until the on-chain settle — payouts only ever derive from entropy the contract verified (revealed seed or ZK proof). If the API disappeared entirely, every pending bet could still be settled and claimed permissionlessly. Details in Provably fair.
All public API surfaces are unauthenticated. There are no API keys for the queries and socket channels documented here.