> ## Documentation Index
> Fetch the complete documentation index at: https://hedgeem-api.qeetoto.com/llms.txt
> Use this file to discover all available pages before exploring further.

# F032 — RTP Configuration

> Operator install-time configuration of target RTP and related parameters

# F032 — RTP Configuration

| Field  | Value               |
| ------ | ------------------- |
| ID     | F032                |
| Phase  | 4 — Configuration   |
| Jira   | HEDGE-133           |
| Status | TS ⬜ · JS ⬜ · UMA ⬜ |

## Business Rule

At installation time, the operator configures the target RTP for their deployment of Texas HedgeEm. This configuration controls:

1. **Target RTP** — the percentage of total stakes returned to players over time
2. **Rounding Algorithm** — whether and how odds are rounded to player-friendly values (see F033)
3. **Active Betting Stages** — which of the four betting windows are enabled (see F014)
4. **Jackpot and Bonus Triggers** — configuration of bonus round and jackpot trigger events (see F083, F084)

The RTP setting is an **operator-level** configuration — it is set once at deployment and applies uniformly to all game sessions for that operator. Players cannot alter it.

## Source: Game Concept Document

> "At install-time the operator sets the target RTP they desire Hedge'Em to run at."

> "The target RTP is set by the operator at installation time but the actual RTP can be influenced by other configuration parameters such as 'Rounding Algorithms' and player gameplay strategy."

> "Single vs Multistage: In its default configuration there is only one betting stage (POST-FLOP) but the operator can choose to enable other betting stages: ANTE-BET, PRE-FLOP, POST-FLOP, and TURN."

> "Configurable 'Jackpot' and 'Bonus' round trigger events."

## Configuration Parameters

| Parameter             | Type       | Default         | Description                                   |
| --------------------- | ---------- | --------------- | --------------------------------------------- |
| `targetRTP`           | `number`   | TBD             | Target return-to-player (e.g. `0.97` = 97%)   |
| `roundingEnabled`     | `boolean`  | TBD             | Whether Rounding Algorithm is applied         |
| `roundingMode`        | `string`   | TBD             | Algorithm type: integer, whole-fraction, etc. |
| `activeBettingStages` | `string[]` | `["POST-FLOP"]` | Enabled betting windows                       |
| `jackpotEnabled`      | `boolean`  | `false`         | Whether progressive jackpots are active       |
| `bonusRoundsEnabled`  | `boolean`  | `false`         | Whether skill-based bonus rounds are active   |

## Actual vs Target RTP

The operator sets a **target** RTP. Actual achieved RTP will differ from target due to:

1. **Rounding Algorithm** (F033): rounding 3.71 → 3 reduces actual RTP below target
2. **Player strategy**: players who consistently back the favourite achieve closer to target RTP; players who back outsiders achieve lower expected return per bet

## Implementation Notes

Configuration is consumed during **server-side game record generation**. The JS and TS clients receive pre-generated records with the margin already baked in. Configuration is not a real-time client setting.

For the standalone TS reference client, configuration will be handled via F042 (config screen) or build-time constants.

## Acceptance Criteria

| #   | Criterion                                            | JS | TS | UMA |
| --- | ---------------------------------------------------- | -- | -- | --- |
| AC1 | Operator can set target RTP at installation          | ⬜  | ⬜  | ⬜   |
| AC2 | Game records generated reflect configured RTP margin | ⬜  | ⬜  | ⬜   |
| AC3 | Active betting stages configurable per installation  | ⬜  | ⬜  | ⬜   |
| AC4 | Rounding Algorithm enabled/disabled per installation | ⬜  | ⬜  | ⬜   |

## Version Parity

| Version        | Status            | Notes                                             |
| -------------- | ----------------- | ------------------------------------------------- |
| JS (reference) | ⬜ Not audited     | Likely a server-side config; client reads results |
| TS             | ⬜ Not implemented | Phase 4                                           |
| UMA            | ⬜ Not audited     | Phase 5                                           |

## Related Features

* F006 — Odds Calculation (uses RTP margin in formula)
* F007 — RTP Margin (the margin application mechanics)
* F014 — Multi-stage Betting (stage activation config)
* F033 — Rounding Algorithms (affects actual RTP)
* F042 — Config/Settings Screen (player-facing config)
* F083 — Bonus Rounds (trigger configuration)
* F084 — Progressive Jackpots (trigger configuration)
