> 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/architecture/04-architecture.md).

# System overview

Fast Poker is three execution environments wired together. This page is the 10-minute "how does it work" answer; deeper pages drill into each component.

## The three environments

```
+-----------------------------+   +----------------------------------+   +----------------------------+
|        Solana L1            |   |    Ephemeral Rollup (ER)         |   |    Trusted Execution       |
|                             |   |    MagicBlock                    |   |    Environment (TEE)       |
|  Tables, seats, vaults,     |   |  Gameplay execution.             |   |  Hole cards, deck state,   |
|  rewards, rake, $FP mint.   |   |  Sub-second confirms.            |   |  shuffle.                  |
|  System of record.          |   |  No fees for players.            |   |  Sealed; even operator     |
|                             |   |                                  |   |  cannot read.              |
+-------------^---------------+   +-----------------^----------------+   +-------------^--------------+
              |                                     |                                  |
              | Settle, cashout                     | Delegate / undelegate            | Deal, reveal
              | rewards distribution                | accounts                         |
              |                                     |                                  |
              +-------------------------------------+----------------------------------+
                                                    |
                                          +---------v---------+
                                          | Dealer Service    |
                                          | (off-chain crank) |
                                          |                   |
                                          | Drives every      |
                                          | transition.       |
                                          | Permissionless.   |
                                          +-------------------+
```

| Layer                                   | Role                                                                                                                                                                  |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Solana L1**                           | Source of truth. Holds Tables, Seats, vaults, rewards, $FP mint, rake accumulators.                                                                                   |
| **Ephemeral Rollup (ER)**               | Where active gameplay runs. Delegated tables live here for the duration of a hand or tournament. Sub-second confirmations; gasless for players.                       |
| **TEE (Trusted Execution Environment)** | A specific MagicBlock validator with attested hardware. Hole cards are sealed inside it. The validator can read them; nothing else can.                               |
| **Dealer Service**                      | Off-chain process that drives lifecycle transitions. Permissionless: anyone can run one. Detailed in [Dealer Service](/for-operators-dealer-service/03-operators.md). |
| **Frontend (Next.js)**                  | The app players use. Reads L1 + TEE directly. Sends gameplay actions to the ER.                                                                                       |

For current 6-max/9-max SNGs, `SngDuelState` carries conserved Flat Bounty points and any active duel. `SngSettlementRecord` carries one game's final per-seat SOL/$FP result back to L1. `EmissionCtrl` plus the matching format/tier `PoolIdle` determine the governed emission snapshot.

## End-to-end lifecycle: one Sit and Go

1. **Lobby load** (L1). Frontend reads the 21 `SngPool` PDAs and their paged queues.
2. **Player queues** (L1). Player signs `join_sng_pool`; funds enter the shared pool vault and a queue marker records the slot.
3. **Pool fills.** Operators prepare/finalize a match and seat its locked player set onto a reusable table.
4. **Setup and delegation.** Dealer ensures the per-game settlement record and, for 6-max/9-max, the persistent duel sidecar, then delegates the full gameplay account set.
5. **Tournament starts** (ER + TEE). `start_game` -> `tee_deal` deals sealed `SeatCards`. The emission snapshot uses live governed accounts.
6. **Hands and points** (ER). Players act gaslessly. In 6-max/9-max, real knockouts transfer one conserved point to eligible side-pot winner(s).
7. **Scheduled duels** (ER + TEE). From display Level 4, a between-hand duel can run once per new blind level while the blind clock pauses.
8. **Tournament complete** (ER). The final hand or duel writes finish order, per-seat SOL, and the fee split to phase 1 of the per-game record. The completing hand's jackpot/emission accrual then writes the finalized roster and per-seat Raw $FP to phase 2.
9. **Commit and payout** (ER -> L1). Dealer returns the table, sidecar, and finalized record, settles jackpots, and credits claimable player balances from the record.
10. **Cleanup and reset** (L1). Dealer finalizes rewards, closes jackpot entries, proves the table clean, resets it, then closes the paid record.

## What this section covers

| Page                                                        | Subject                                                                  |
| ----------------------------------------------------------- | ------------------------------------------------------------------------ |
| [On-chain program](/architecture/on-chain-program.md)       | The main Fast Poker program (Anchor), its instructions, accounts, errors |
| [Registry program](/architecture/registry-program.md)       | Dealer License registry, restoration, and issuance closure               |
| [NFT license program](/architecture/nft-license-program.md) | License NFT wrap/unwrap                                                  |
| [Ephemeral Rollups](/architecture/ephemeral-rollups.md)     | What MagicBlock ERs do, delegation lifecycle                             |
| [TEE deal and reveal](/architecture/tee-deal-reveal.md)     | How card secrecy works                                                   |
| [State accounts](/architecture/state-accounts.md)           | Core gameplay, Flat Bounty, settlement, emission, and vault accounts     |
| [Permission system](/architecture/permissions.md)           | Per-PDA member ACLs that gate TEE reads                                  |
| [Reward accounting](/architecture/reward-accounting.md)     | CrankAction, OperatorRewardTotal, OperatorClaim, epochs                  |

## What this section does NOT cover

* Specific instruction byte layouts and discriminators (see [Smart Contracts Reference](/smart-contracts-reference/05-contracts.md))
* The Dealer Service internals (see [For Operators](/for-operators-dealer-service/03-operators.md))
* Frontend code structure (see [Frontend and API](/frontend-and-api/06-frontend-api.md))
