> ## 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.

# Networks & contracts

> Resolve chainId and contract addresses via networkConfigs — never hardcode them.

Chance runs on **Robinhood Chain**, with a testnet and a mainnet deployment. `networkConfigs` returns every network the API can currently serve, with live contract addresses.

```graphql GraphQL theme={"theme":"css-variables"}
query {
  networkConfigs {
    networkId
    mode
    chainId
    contracts {
      chancePool
      lpPool
      chanceToken
      usdg
      hook
    }
  }
}
```

## Fields

| Field                   | Type         | Meaning                                                                      |
| ----------------------- | ------------ | ---------------------------------------------------------------------------- |
| `networkId`             | `NetworkId!` | `ROBINHOOD_TESTNET` or `ROBINHOOD_MAINNET` — the key you select on           |
| `mode`                  | `String!`    | `testnet` or `mainnet`                                                       |
| `chainId`               | `Int!`       | EVM chain id — pass to `betResult` / `betResults` and your viem chain config |
| `contracts.chancePool`  | `String!`    | The betting pool — where you place, settle, and claim                        |
| `contracts.usdg`        | `String!`    | The USDG token — approve this for `chancePool` before placing                |
| `contracts.chanceToken` | `String!`    | The CHANCE protocol token                                                    |
| `contracts.lpPool`      | `String!`    | The Uniswap V4 CHANCE/USDG pool reference                                    |
| `contracts.hook`        | `String`     | Optional V4 hook address — may be `null`                                     |

## Selecting a network

Filter by `networkId`. The array only contains networks the API has fully configured, so mainnet may be absent before its deployment goes live:

```ts TypeScript theme={"theme":"css-variables"}
const configs = data.networkConfigs
const network =
  configs.find((n) => n.networkId === 'ROBINHOOD_MAINNET') ??
  configs.find((n) => n.networkId === 'ROBINHOOD_TESTNET')
```

<Warning>
  **Do not hardcode contract addresses** from docs, screenshots, or old deployments. Pools are redeployed on ABI changes and addresses go stale; `networkConfigs` is the source of truth (the pool address comes from the API's config, and the token / USDG / LP addresses are read from the pool itself).
</Warning>

Bring your own RPC endpoint for on-chain reads and writes — the API does not proxy RPC traffic.
