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

# Events

> Player-relevant ChancePool events — bet lifecycle, epochs, staking — with field tables.

The logs an integrator or indexer needs for the bet lifecycle, fairness verification, and staking UX. Admin/config events are omitted.

## Enums in logs

Events encode enums as `uint8`:

| Enum         | Values                                                  |
| ------------ | ------------------------------------------------------- |
| `BetMode`    | `0` Strike · `1` Range · `2` Ladder                     |
| `SettleKind` | `0` Seed · `1` Proof · `2` PostReveal · `3` ForceRefund |
| `RewardMode` | `0` USD · `1` CHANCE                                    |

## Bet lifecycle

### BetPlaced

```solidity Solidity theme={"theme":"css-variables"}
event BetPlaced(
    uint256 indexed betId,
    address indexed player,
    BetMode mode,
    uint256 stake,
    uint256 liability,
    uint256 payoutMin,
    uint8 ladderCount,
    uint64 commitId,
    address affiliate,
    string platform,
    string game
);
```

| Field               | Meaning                                                           |
| ------------------- | ----------------------------------------------------------------- |
| `liability`         | Reserved max payout: Strike `W`, Range `P_max`, Ladder max bucket |
| `payoutMin`         | Range floor `P_min` (0 for Strike / Ladder)                       |
| `ladderCount`       | Ladder bucket count (0 for Strike / Range)                        |
| `commitId`          | Epoch the bet settles under                                       |
| `platform` / `game` | Attribution strings — **log-only**, not stored on the bet         |

Strike's `multipleBps` and Ladder's bucket payouts/masses are *not* in the event — read `getBet` / `getLadderBuckets` or the place calldata.

### BetSettled

```solidity Solidity theme={"theme":"css-variables"}
event BetSettled(
    uint256 indexed betId,
    uint256 payout,
    uint256 houseWinAmount,
    bool forcedTimeout,
    SettleKind settleKind
);
```

| Field            | Meaning                                                                                  |
| ---------------- | ---------------------------------------------------------------------------------------- |
| `payout`         | Credited to the player's claimable balance when > 0; `0` means a loss (no claim follows) |
| `houseWinAmount` | `max(0, stake − payout)`                                                                 |
| `forcedTimeout`  | `true` on refund paths (payout = stake, no house-win routing)                            |
| `settleKind`     | Which settle path ran — `Seed` / `Proof` / `PostReveal` / `ForceRefund`                  |

This is the terminal **outcome** for a bet; wins and refunds still need a claim.

### ClaimedUsd / ClaimedChance

```solidity Solidity theme={"theme":"css-variables"}
event ClaimedUsd(uint256 indexed betId, address indexed player, uint256 amount);
event ClaimedChance(uint256 indexed betId, address indexed player, uint256 usdSpent, uint256 chanceOut);
```

One of these completes the lifecycle (status → Claimed). `ClaimedChance.usdSpent` is the bet payout spent on the V4 buy; `chanceOut` is what landed in the player's wallet. In a batch `claimBets`, one buy covers all bets and `chanceOut` is attributed pro-rata.

## Epochs (fairness)

```solidity Solidity theme={"theme":"css-variables"}
event EpochOpened(uint64 indexed commitId, bytes32 commitment);
event EpochClosed(uint64 indexed commitId);
event EpochRevealed(uint64 indexed commitId, bytes32 serverSeed);
event EpochForceAdvanced(uint64 indexed commitId, uint256 pendingBets);
```

| Event                | Use it for                                                                            |
| -------------------- | ------------------------------------------------------------------------------------- |
| `EpochOpened`        | Track the live `commitId` + `commitment` for placing and for proof inputs             |
| `EpochClosed`        | The epoch stopped accepting bets; seed not yet public                                 |
| `EpochRevealed`      | The seed is on-chain — [verify outcomes](/protocol/provably-fair) or settle leftovers |
| `EpochForceAdvanced` | Lost-seed emergency: treat that epoch's pending bets as refund-eligible               |

Never expect the seed in a rotate transaction — happy-path rotation is `EpochClosed` + `EpochOpened` with the reveal coming later via `settleWithSeed` or `revealEpoch`.

## Staking

```solidity Solidity theme={"theme":"css-variables"}
event Staked(address indexed staker, uint256 assets);
event Unstaked(address indexed staker, uint256 assets);
event UnstakeRequested(address indexed staker, uint256 assets, uint64 unlockAt);
event UnstakeRequestCancelled(address indexed staker, uint256 assets);
event RewardModeSet(address indexed staker, RewardMode mode);
event StakerChanceClaimed(address indexed staker, uint256 amount);
```

`UnstakeRequested.unlockAt` drives the exit countdown UI; the request can also unlock earlier when `SettledWatermarkAdvanced(settledThroughCommitId)` passes the staker's request epoch. See [Deposit & withdraw](/staking/deposit-and-withdraw).

## Live quote data

### BankrollSync

Emitted after every place, settle, claim, and stake movement — a full snapshot of `availableBankroll`, `pendingPayoutLiability`, `effectiveMaxMultiplierBps`, `maxStakeCap`, and `maxBetLiabilityCap`.

<Tip>
  Index `BankrollSync` instead of polling views: a bet ticket UI can quote every [constraint](/protocol/bet-constraints) from this one log stream with no `eth_call`s.
</Tip>
