> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coinlotto.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Win Rate

## Overview

The Win Rate model defines the target percentage of sold tickets that will be selected as winners.

Instead of defining the exact number of winning tickets, the lottery specifies a **Target Win Rate**. After the lottery draw is completed, the protocol calculates how many winning tickets correspond to the configured percentage.

Since the number of winning tickets must always be a whole number, the actual Win Rate may differ slightly from the configured value due to rounding.

The Win Rate model is best suited for lotteries where the probability of winning is more important than the prize amount.

## Rules

* **Target Win Rate:** 0.1%–50%
* When the Prize Pool is greater than zero, at least **one** winning ticket is always selected.

## How it works

When the lottery is created, the Target Win Rate is set as a percentage of tickets sold.

When the draw is finalized, the protocol calculates the number of winning tickets based on the configured Target Win Rate and the total number of tickets sold.

The winning tickets are then selected, and the Prize Pool is distributed equally among them.

## Winner calculation

The number of winning tickets is calculated using the following formula:

```text theme={"system"}
Winning Tickets =
    max(
        floor(Total Tickets × Target Win Rate),
        1
    )
```

Where:

* **Total Tickets** — Total number of tickets sold.
* **Target Win Rate** — Configured percentage of winning tickets.
* **floor()** — Rounds the result down to the nearest whole number.
* **max(..., 1)** — When the Prize Pool is greater than zero, ensures that at least one winning ticket is selected.

## Prize calculation

After determining the number of winning tickets, the Prize Pool is distributed equally among them.

```text theme={"system"}
Prize per Winner = Prize Pool ÷ Winning Tickets

Actual Win Rate = Winning Tickets ÷ Total Tickets
```

## Example

### Configuration

* **Prize Pool:** 10,000 USDC
* **Tickets Sold:** 10,000
* **Target Win Rate:** 2%

### Calculation

```text theme={"system"}
Winning Tickets = floor(10,000 × 2%)
                = 200

Prize per Winner = 10,000 ÷ 200
                 = 50 USDC

Actual Win Rate = 200 ÷ 10,000
                = 2%
```

### Final result

* **Winning Tickets:** 200
* **Prize per Winner:** 50 USDC
* **Actual Win Rate:** 2%

## Edge cases

### Actual Win Rate below target

When the calculated number of winning tickets is rounded down, the actual Win Rate becomes slightly lower than the configured Target Win Rate.

#### Example

**Configuration**

* **Tickets Sold:** 333
* **Target Win Rate:** 1%

**Calculation**

```text theme={"system"}
Winning Tickets = floor(333 × 1%)
                = floor(3.33)
                = 3

Actual Win Rate = 3 ÷ 333
                ≈ 0.90%
```

**Result:** The configured Target Win Rate is **1%**, while the actual Win Rate is approximately **0.90%** because the number of winning tickets must be rounded down.

### Actual Win Rate above target

If the calculation produces fewer than one winning ticket and the Prize Pool is greater than zero, the protocol selects one winning ticket. As a result, the actual Win Rate may be higher than the configured Target Win Rate.

#### Example

**Configuration**

* **Prize Pool:** 100 USDC
* **Tickets Sold:** 10
* **Target Win Rate:** 0.1%

**Calculation**

```text theme={"system"}
Winning Tickets = max(floor(10 × 0.1%), 1)
                = 1

Prize per Winner = 100 ÷ 1
                 = 100 USDC

Actual Win Rate = 1 ÷ 10
                = 10%
```

**Result:** The configured Target Win Rate is **0.1%**, while the actual Win Rate becomes **10%** because at least one winning ticket must always be selected.

## Summary

The Win Rate model targets a predefined percentage of winning tickets rather than a fixed number of winners. After the lottery draw is completed, the protocol calculates the number of winning tickets based on the configured Target Win Rate and distributes the Prize Pool equally among them.

## Related Pages

* [Prize Distribution](/lottery-mechanics/prize-distribution)
* [Prize Pool](/lottery-mechanics/prize-pool)
* [Lottery Draw](/lottery-mechanics/lottery-draw)
* [Claiming Rewards](/lottery-mechanics/claiming-rewards)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.