DICE

Chance and Multiplier

DICE is a game where players wager on a random outcome by selecting a target win chance ranging from 0.01% to 98%. A win is determined by whether a generated random number falls below (or equals) the chosen chance. The payout multiplier is derived from the selected chance, with an adjustment that embeds a consistent house edge into the game.

Multiplier Calculations

For every chance value chosen by the player, the multiplier is calculated using the following formula:


Multiplier=(1House Edge)×100Chance\text{Multiplier} = \frac{(1 - \text{House Edge}) \times 100}{\text{Chance}}

As the house edge is 1% (i.e., 1 - 0.01 = 0.99), the formula becomes


Multiplier=0.99×100Chance=99Chance\text{Multiplier} = \frac{0.99 \times 100}{\text{Chance}} = \frac{99}{\text{Chance}}

This means that the multiplier increases inversely with the chosen chance. Lower chance values yield higher multipliers, while higher chance values provide lower multipliers.

Available Multipliers and Examples

Multipliers are stored in our Dice contract in a scaled integer format for precision. For instance:

  • A value of 10421 represents a 1.0421x multiplier.

  • A value of 9900000 represents a 990x multiplier.

Here are some specific examples:

  • At 95% Chance: Multiplier=99951.0421x\text{Multiplier} = \frac{99}{95} \approx 1.0421x

  • At 50% Chance: Multiplier=9950=1.98x\text{Multiplier} = \frac{99}{50} = 1.98x

  • At 49.5% Chance: Multiplier=9949.5=2x\text{Multiplier} = \frac{99}{49.5} = 2x

  • At 0.1% Chance: Multiplier=990.1=990x\text{Multiplier} = \frac{99}{0.1} = 990x

House Edge Integration

he 1% house edge is embedded directly into the win probability calculations. This adjustment ensures that, on average, the player's return is 0.99 times their wager, regardless of the bet's outcome.

The win chance is computed using a formula inspired by the following structure:

uint256 winChance = CONSTANT / game.multiplier;

Example of calculations:

Consider a scenario where the multiplier is 2x. With a CONSTANT set to 99000000000, the win chance is calculated as:


winChance=2000099000000000=4950000\text{winChance} = \frac{20000}{99000000000} = 4950000

This corresponds to a win probability of 49.5%, which reflects a 1% reduction from a fair 50.5% chance. As a result, regardless of a win or a loss, the average return is approximately 0.99 of the wager.

Last updated