> For the complete documentation index, see [llms.txt](https://docs.fast.poker/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fast.poker/for-operators-dealer-service/sng-pipeline.md).

# SNG pipeline

The SNG pipeline covers queue fill, table activation, governed-emission funding, tournament play, Flat Bounty duels, durable settlement, player-credit delivery, dealer rewards, jackpot closure, and table reset.

## Queue to table

Players join an SNG pool by format and tier. When the pool has enough players, the operator network prepares and finalizes the match, seats the locked queue entries, and activates a reusable table.

Before record-enabled play, the service must ensure the per-game `SngSettlementRecord` exists and is delegated with the table. Every 6-max/9-max table also requires its persistent `SngDuelState` sidecar. Native heads-up has no duel sidecar.

## Active tournament

The dealer runs the normal hand loop until one player remains. SNGs do not have a hand-count cap. Blind levels rise every 5 minutes and clamp at 7000/14000.

The first funded settlement snapshot records format/tier base emission, liquid-supply decay, the live `EmissionCtrl` multiplier, and `PoolIdle` boost. The controller records this tournament's SNG fee signal. `EmissionCtrl` and the matching `PoolIdle` are mandatory governed accounts, not optional dealer configuration.

For 6-max/9-max, settlement seeds one point per entrant and transfers exactly one victim head point on each real knockout to the eligible side-pot winner(s). The service must pass the sidecar on hand settlement. It must also run the between-hand duel lane once per eligible blind level from on-chain level 3:

1. `maybe_start_sng_duel`
2. player/session-key `sng_duel_action` or permissionless `sng_duel_timeout`
3. `resolve_sng_duel` when both accept, the final deal is reached, or resolution otherwise becomes ready

Do not start a poker hand while `duel_active` is true. The contract pauses the blind clock for the duel duration.

## Completion order

At completion, a record-enabled table follows a fail-closed path:

1. The final hand or tournament-completing duel writes phase 1 of the `SngSettlementRecord`: finish order, per-seat SOL, fee split, and `settled = true`.
2. The completing hand's jackpot/emission accrual writes the finalized roster and per-seat Raw $FP to phase 2, then sets `finalized = true`.
3. Commit/undelegate the table, duel sidecar, and record to L1.
4. Settle remaining Lucky/Royal captures and close each prior-game jackpot entry.
5. Run `distribute_prizes_from_record`. This credits player claimable SOL and unrefined $FP and marks the record paid.
6. Sync/finalize the dealer reward epoch and claim where applicable.
7. Run `assert_table_clean`, then reset only after payout, jackpot, reward, and duel gates pass.
8. Close the paid transient settlement record after reset.

The legacy `distribute_prizes` path must not be used as a silent fallback for a record-enabled table. `SettlementRecordRequired`, `SettlementNotFinal`, and `SettlementAlreadyPaid` are state-machine signals, not reasons to bypass the record.

## Entry fee split

| Recipient          |           Share |
| ------------------ | --------------: |
| Dealer             |          33.33% |
| Burned $FP stakers |          33.33% |
| Platform Fee       | 33.34% residual |

SNGs do not have an ongoing creator rake slice.

## Reusable tables

SNG tables are reused. A reward epoch isolates each match so dealer reward weight from one match cannot leak into the next. `SngDuelState` persists and is reset to the canonical Flat Bounty ruleset for the next 6-max/9-max match; `SngSettlementRecord` is unique to one game and closes after reset.

Reset must wait for all of the following: record payout, sidecar paid with no active duel, finalized dealer reward epoch, closed jackpot entries, and clean seat/table state. Treat `TableNotClean` as a diagnostic gate and repair the specific leftover state instead of forcing reuse.
