Last updated
Last updated
Each game session contains crucial data fields to ensure transparency and proper functioning:
A mapping of accountId to player details, which includes:
Tickets: The number of tickets the user has earned through deposits.
The chance of winning is shown as
(User Tickets / Total Tickets of Game Session) * 100
.
Amount: The total deposit amount by the user.
This is used to return the correct deposit amount on cashout or claim actions.
isClaimed: A boolean indicating whether the user has claimed their deposit and rewards at the end of the session.
• This represents the cumulative deposits of all participants in the session. It is updated whenever a user makes a deposit or cashes out.
• The amount is crucial for calculating the exact rewards at the end of the session.
• This is the final reward amount distributed to the winner(s) at the end of the session.
• It is calculated using the formula:
• The cumulative number of tickets issued in the session. It is updated with each deposit and cashout action.
• Total tickets are used to randomly choose a winning number in the range [0-Total Tickets].
Start: • The block timestamp when the game session starts. Duration: • The length of time the game session will last. • It is used to calculate the end time and restrict certain operations like deposits or cashouts after the session ends. End: • Calculated as Start + Duration. It marks the official end of the game session.
Reward = (Total Staked Balance + Generated Rewards) - Total Deposit Amount
- Total Staked Balance is the total amount in the staking contract, including any yield generated.
- Total Deposits is the sum of all participants' deposits in the game session.