> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chance.money/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> The integrator mental model — value moves on-chain, the API handles discovery, results, and realtime.

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.

| Layer                     | Responsibility              | You call it for                                                                         |
| ------------------------- | --------------------------- | --------------------------------------------------------------------------------------- |
| **ChancePool (on-chain)** | Escrow, settlement, payouts | `placeStrike` / `placeRange` / `placeLadder`, `claim` / `claimWithProof` / `claimBets`  |
| **GraphQL API**           | Discovery, results, history | `networkConfigs`, `betResult` / `betResults`, `playerBets`, `pendingBetCount`, `health` |
| **Socket.IO**             | Realtime bet updates        | `bets:subscribe` → `bets:update` (result + Groth16 proof per bet)                       |

## The core loop

1. **Discover** — resolve `chainId` and contract addresses from [`networkConfigs`](/integrate/networks). Once, at startup.
2. **Place** — build mode args, read `currentCommitId()`, send the place transaction. See [Placing bets](/integrate/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](/integrate/results-and-proofs).
4. **Claim** — winners claim on-chain, choosing USDG or CHANCE. See [Claiming](/integrate/claiming).
5. **History** — back-fill and paginate a wallet's bets from [`playerBets`](/integrate/history).

## 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](/protocol/provably-fair).

<Note>
  All public API surfaces are unauthenticated. There are no API keys for the queries and socket channels documented here.
</Note>
