# Slots

#### Concept

At first glance, implementing a casino game on a smart contract might seem intricate. However, the process can be simplified through a modular approach. Essentially, the smart contract’s role is to determine the outcome of a game and the associated payout, without needing to understand the specific game mechanics. This design allows the same smart contract to be used for various games by focusing solely on the payout logic.

For instance, in slot games, when a user initiates a spin, the slot smart contract—identical for all slot games—receives only the bet amount. It utilizes a Verifiable Random Function (VRF) to generate a random outcome, which is then matched against a predefined reward table. The smart contract determines whether the spin results in a win or loss and, if won, calculates the payout amount. The smart contract does not account for additional game details, such as paylines; it simply provides the outcome, and the frontend displays the visual results accordingly.

This modular approach applies universally across games by defining a reward table and generating a random outcome within that range. For example, a coin flip game with a reward table:

* **1 - 6:** 0x
* **7 - 10:** 2x

The game operates by asking the user to choose heads or tails and then executing a smart contract transaction. The VRF generates a number between 1 and 10. Based on this number, the game determines the outcome and adjusts the frontend display to reflect it, ensuring fairness and maintaining house profitability.

Integrating new games follows a straightforward process: define their reward tables, which simplifies their addition to the platform. The complexity of the reward tables may vary depending on the game's multipliers, but the underlying principle of probabilistic outcomes remains the same.

#### Games

At Frosty.casino, we plan to integrate open-source or commercially licensed third-party games rather than developing them in-house. Our approach involves connecting the game’s frontend (UI) to our smart contract backend. This ensures that all outcome decisions are managed by the smart contract, with the results presented through the UI.

This method accelerates game integration and shortens development cycles. Each new game will follow a straightforward process:

1. **Identify**: Determine the frontend logic for generating outcomes.
2. **Replace**: Substitute this logic with a smart contract transaction.
3. **Define**: Create an appropriate reward table for the game.
4. **Present**: Implement outcome presentation in the UI.

#### Probability Deviation

Our casino games are calibrated to return 95% to players, achievable by fine-tuning the reward tables. This setup allows for diverse gaming experiences. For instance, a game might offer frequent, small wins with rare large jackpots, or conversely, infrequent but substantial payouts.

To mitigate short-term risks, such as consecutive large payouts, we will seed the treasury with sufficient funds to cover such occurrences. The treasury will be designed to handle a 95% return rate, ensuring it remains well-funded and capable of covering payouts even in unlikely scenarios. Over time, the platform will benefit from the law of large numbers, aligning results with expected probabilities.

#### Jackpot

Each time a player loses a bet, 10% of the loss is allocated to a Jackpot treasury. This treasury accumulates funds over time and offers a chance to win the jackpot on each game play. When the jackpot is won, all accumulated funds are paid out to the winner, and the treasury resets.

The jackpot probability is uniform across games and bet sizes, fine-tuned to trigger approximately once per quarter. While deviations from this average are possible, such as multiple wins in a quarter, the overall probability remains consistent.

#### Statistics Module

Our statistics module enhances user experience by displaying game statistics and leaderboards. Players can view monthly and all-time leaderboards, their personal game statistics, and jackpot winners.

This module operates off-chain, meaning it does not affect game outcomes or probabilities. It is a centralized informational feature designed to enrich the user experience. An off-chain blockchain querying service will aggregate transaction data and provide this information on the platform’s frontend.
