# StreakBet payout examples (simulation)

Generated by `npm run docs:streak-payouts`. Do not edit the table manually.
Sources: [StreakBetEscrow.sol](../contracts/StreakBetEscrow.sol),
`_assignStreakPlaces`, `_distributeStreakPayouts`, and the read-only
`streakPayoutPolicyVersion()` capability. The generator is checked against
actual local-contract transfers by Hardhat tests.

Each entrant stakes **100 example BNUT** (18 decimals). No yield, fees, swaps,
or USD conversion. This stake is illustrative, not the captain's chosen stake.
All non-completers in these scenarios explicitly forfeit. Actual unsuccessful
entrants also receive no settlement payout. The first table is the exact strict
ordering retained by deployed legacy contracts without payout-policy version 2.
Every number is exact; tiny treasury amounts are integer-rounding dust.

| Entrants | Completed | Forfeits | Payouts in rank order (BNUT) | Treasury (BNUT) |
| --- | --- | --- | --- | --- |
| 1 | 1 | 0 | #1: 100 | 0 |
| 1 | 0 | 1 | None | 100 |
| 2 | 2 | 0 | #1: 100; #2: 100 | 0 |
| 2 | 1 | 1 | #1: 200 | 0 |
| 3 | 3 | 0 | #1: 125; #2: 116.666666666666666666; #3: 58.333333333333333333 | 0.000000000000000001 |
| 3 | 2 | 1 | #1: 160; #2: 140 | 0 |
| 5 | 5 | 0 | #1: 118.75; #2: 112.5; #3: 56.25; #4: 106.25; #5: 106.25 | 0 |
| 5 | 3 | 2 | #1: 225; #2: 183.333333333333333333; #3: 91.666666666666666666 | 0.000000000000000001 |
| 5 | 0 | 5 | None | 500 |

## Source-only ranked ties (policy capability version 2)

The following examples use completed entrants' verified qualifying activity
days and submitted-report counts (d/r). Equal values in both fields share
competition rank. Qualification time and join order do not break ties. A tied
group occupying places *k* through *k+n−1* pools the base refunds and each
occupied place's bonus, then receives the integer quotient pool / n per
entrant. Both second-place ties receive the second-place award; the next rank
skips the occupied slot. This policy is only active where a contract's
read-only `streakPayoutPolicyVersion()` returns 2; it is not the policy of the
currently configured/deployed legacy contract.

| Entrants | Scores (verified days / reports) | Payouts by shared place (BNUT) | Treasury (BNUT) |
| --- | --- | --- | --- |
| 1 | 2d/1r | #1: 100 | 0 |
| 2 | 2d/1r, 2d/1r | #1 (2 tied): 100 each | 0 |
| 3 | 3d/2r, 3d/2r, 2d/1r | #1 (2 tied): 120.833333333333333333 each; #3: 58.333333333333333333 | 0.000000000000000001 |
| 5 | 5d/3r, 4d/2r, 4d/2r, 2d/1r, 2d/1r | #1: 118.75; #2 (2 tied): 84.375 each; #4 (2 tied): 106.25 each | 0 |
| 5 | 5d/3r, 4d/2r, 3d/1r, 3d/1r, 2d/1r | #1: 118.75; #2: 112.5; #3 (2 tied): 81.25 each; #5: 106.25 | 0 |
| 5 | 5d/3r, 4d/2r, 4d/2r, 4d/2r, 2d/1r | #1: 118.75; #2 (3 tied): 91.666666666666666666 each; #5: 106.25 | 0.000000000000000002 |

Both policies retain full principal except the occupied third-place slot,
which starts with half stake (rounded down in base units); the withheld amount
joins the same bonus pool as forfeited stakes. The global bonus pool equals the
pot less all occupied-slot starting refunds. Its denominator uses the original
occupied-slot weights: 3 for first, 2 for second, 1 for every later slot.
Each slot's bonus is floored independently before tied slots are pooled. The
group's total occupied-slot payout is then divided by group size with integer
flooring; any remainder, plus any unallocated per-slot bonus dust, follows the
existing treasury dust route. Thus tied members receive exactly equal amounts
and no wallet or join order receives remainder wei. With no completers, the
whole pot goes to treasury. Cancellation remains a separate owner action and
refunds entrants rather than applying either settlement calculation.

See [the journey and policy boundaries](STREAKBET_JOURNEY.md) before joining.
