JustBet
Published in

JustBet

Minting Formula Update

Revised Minting Formula with logarithmic calculations and Chainlink Price Feed oracle to create a provably fair minting process

Minting Overview

Users are rewarded in WINR tokens that are minted for each round of a game played within the platform. There are a number of factors which drive the minting process. There are a total of 6B tokens which remain unminted, and will release over time.

There are a total of nine minting rounds to mint all of the unminted tokens. Once the nine rounds complete, the minting process will continue to re-distribute WINR tokens that were accumulated when users purchased lottery tickets. These WINR tokens are held in a reserve and accumulate until all nine phases complete.

Overview of the variables used to calculate the amount of WINR minted

The minting process is designed with a variety of 8 variables in total, each of which is outlined below:

  • Bet Amount: Because users are also able to participate in games using a variety of different coins (ETH, wBTC etc), the minting formula also uses Chainlink Price Feeds to enable all results be tied back to a constant value in USD which is a key variable required to ensure fair minting results for all participants.
  • Interpolation of WINR Paid from USD Bet Amount: Within each phase there are is a minimum and maximum amount that can be bet which has to correspond to a min and max and can be minted. Because the betting amount is not 1-to-1 with the minting amount, it is necessary to interpolate the notional (or linear) minting value of WINR based upon the bet amount that takes place
  • Logarithmic curve for minting: WINR tokens yield on based upon a logarithm to reward users on a curve rather than in a linear fashion. This ensures that users are able to be rewarded WINR tokens for their ongoing participation fairly.
  • Additional variables used are multipliers specific for each game, promotional events(when applicable), NFT bonus for people holding an NFT, referrals and top player bonuses

The follow sections outline how the minting formula is generated step by step.

Overview of the minting phases

There are a total of nine phases where tokens will be minted with a decreasing number of tokens mintable per game play over the 9 phases. The model is designed to decrease and then increase the total number of tokens available within each phase which is aligned to projected platform growth and allow later phases to run for similar periods of time as more users are using the platform.

Players who participate in early phases can accumulate more tokens than those participating in later phases. WINR tokens will continue to mint and be distributed until all tokens have been disbursed. After the 9th phase of token minting has occurred, any tokens stored in reserve from lottery purchases will be minted every time the token reserve pool hits 1M tokens. This will keep players highly engaged, as there will constantly be more tokens to earn from gameplay and platform participation.

The model below shows the number of WINR tokens available per phase with the current min and max USD value bets. The max bet amounts can be increased over time should there be sufficient demand for higher stakes and if there is sufficient liquidity on the platform.

Minting rounds for WINR tokens

The Min and Max WINR payouts are represented in a notional value, meaning that these are the minimum and maximum amounts that would be paid out in accordance with the mining formula in a linear fashion (however, its important to note that these values are necessary in order to calculate a non-linear payout ratio).

The formula explanation and details below will further elaborate on how these WINR notional values are used and why they are critical to the computation of actual WINR amounts paid out using a logarithmic non-linear calculation to mint tokens.

WINR Distribution from the Lottery Pool reserve

WINR tokens received to buy lottery tickets are held in a reserve and will be re-distributed once all nine rounds of minting have completed.

  • The WINR spent to buy lottery tickets will be saved in the lottery contract until the end of the minting
  • Re-distribution of WINR from the lottery contract will commence once there are a minimum of 1 million WINRs in reserve
  • The payout ratio will be randomly selected from one of the previous rounds.

The Mining formula (mathematical version)

The basis of the mining formula consists of the following calculation:

JustBet WINR revised mining formula using Chainlink Price Feeds on Polygon network

Where the variables above are defined as:
Y1 = Min Notional WINR
Y2 = Max Notional WINR
X = Min Bet (in USD)
X1 = Bet Amount (USD) (uses the Chainlink Price Feed Oracle)
X2 = Max Bet (in USD)

Note: X1 (Bet Amount) is a deterministic variable calculated during each gameplay using the Chainlink Price Feed oracle to determine the USD price based upon the amount played in other currencies (wBTC, ETH, Matic).

The Minting formula explained with walkthrough (in english)

Overview

The minting formula consists of 8 variables, each of which is calculated or pre-set to generate the minting that occurs each game play. The primary principles for the mining formula are as follows:

  • There are 9 rounds of minting WINR tokens
  • Each round mints a decreasing amount of WINR tokens per gameplay
  • Tokens are minted based upon the amount a person gambles. The more they gamble the more they earn
  • The WINR tokens are minted on a Standard Logarithmic Curve, not linearly, so that it encourages people to gamble more to earn more WINRS and then curving so that the increase slows down as people gamble more.

The model is designed to mint as follows

  • Betting $1 increasing to $100 will increase the WINR payouts on the upward sloping first half
  • Betting $100 to $200 (max bet) will mint WINR tokens at a slower pace as a person increases their bet

The image provided above demonstrates how the logarithmic curve yields WINR based upon the notional WINR value (for example between 3 and 15 minted for round 1) interpolated from the larger sample size of the USD bet amounts (between $1 and $200).

The follow steps address how the mining formula generates the results step by step. We will use the following data for the basis of the example walkthrough for each of the steps that follow below using Round 1 as the example:

Example Data used for calculating the example walkthrough

Following are the steps and walkthrough of the formula and how these variables are related.

Step 1: Bet Amount variable

The primary variable for the mining formula is the Bet Amount which is derived from the Chainlink Price Feed oracle; it provides the price in USD for each coin used for game play, e.g. BTC/USD or ETH/USD.

The price derived into USD is critical so that every game play mints tokens fairly, in a common USD value, regardless of what token is used. This is critical because betting 0.01 of BTC vs 0.10 of ETH have significantly different USD values and it’s important that users always receive the correct amount of WINRs based upon a common denomination. This guarantees fairness in the minting process for all who participate.

The calculation is derived as follows:

Number of Tokens * Exchange Rate = USD Bet Amount (using ChainLink Price Feed Oracle)

Example Conversions to generate the BET AMOUNT variable

  • 0.001 BTC (one gameplay) * 60000 (BTC price) = $60
  • 0.10 ETH (one gameplay) * 2000 (ETH price) = $200
  • 100 Matic (one gameplay) * .50 (Matic Price) = $50

Step 2: Interpolation of WINR amount based on USD Bet Amount

Interpolation is the mathematical process of determining the value of WINR based upon the amount being bet. Because the betting is a range between $1 and $200, an interpolation formula is needed to work out what value is an equivalent value in WINR. We refer to this as a notional value, because this is a linear calculation and a log function will be applied in Step 3.

The table below highlights some examples of this. For the example from above, the $5 Bet Amount variable is interpolated into a notional value of 3.24121 WINR in a linear calculation:

WINR Interpolation Table for Round 1, based on $1 to $200

This data is the first step so that the amount of WINR to be paid can be related to a USD value.

Example:

The interpolation formula is represented in simple terms as the following:

Min WINR + [(Bet Amount — Min Bet) / (Max Bet — Min Bet)*
(Max WINR — Min WINR)]

This can be worked out using the data from the Example Data table :

Example Data used for calculating the example walkthrough

Simply plug in the values into the formula:

  • Step 1: 3 + [(5–1)/(200–1)*(15–3)]=
  • Step 2: 3+(4/199*12)=
  • Step 3: 3+0.2412 = 3.2412 (as shown in the interpolation table)

Step 3: Standard Normal Logarithmic Calculation

Now that WINR linear values have been interpreted based upon the Bet Amount, a logarithmic curve needs to be applied as highlighted above.

The log formula itself can not be coded in solidity, so it was necessary to reverse engineer the entire log function so that it could be coded. For the purposes of keep the explanation as simple as possible, the data below showcases the calculations, but solidity requires some additional steps due to some of the restrictions encountered in coding the formula. (The formula used is notated above in the mathematical section).

Example:

The log formula is represented in simple terms as the following:

1 / ( 1 + (2.71828182845904 ^(-0.5 * BET AMOUNT ))^ 0.11)

It’s worth noting that the value 2.71828182845904 is a mathematical constant called e. The Bet Amount variable determined in Step 1 is used to make the calculation work.

Simply plug in the values into the formula:

  • Step 1: 1 / [1 + (2.71828182845904 ^ (-0.5 * 5)) ^ 0.11]=
  • Step 2: 1/ [1 + (2.71828182845904 ^ (-2.5)) ^ 0.11) =
  • Step 3: 1/ [1+ (.082084998623899 ^ 0.11) =
  • Step 4: 1 / (1 + 0.759572123224968) =
  • Step 5: 1 / 1.75957 =.568319983478248

This value is now the log value determined from the $5 bet amount which will be applied in the final calculations.

Step 4: Game Factor Multiplier

One of the most important factors in minting is making sure that all games mint fairly. One of the obstacles in doing this comes from the fact that different games take different amounts of time to play. To make WINR minting fair, its important to re-factor (or assign a multiplier) to each game so that whether a game takes 10 seconds or 3 minutes, the amount of WINR minted is paid fairly across all games.

Each game will mint at a different rate because not all games play at the same speed.

Therefore there is a game factor applied to each game to solve this issue. The game factor is used to ensure that players are not disadvantaged for playing a game which takes longer to play.

As an example one game may be played 4–6 times per minute whereas another game may take 3 minutes to play. This would imply that the user playing the 3 minute game would normally mint far less WINR tokens than the player who played 12–18 times in that same 3 minute period.

Therefore, for each game, a Multiplier Factor is applied within each game contract so that all games will effectively mint the same number of WINR tokens over the same period of time.

Example:

Dice game may be run 5 times per minute. Roulette by contrast could take 3 minutes.

The model therefore baselines everything to WINR minting / minute. So in the above example, the game factor multiplier would work as follows:

  • Dice: 0.2 (5 games per minute)
  • Roulette: 3.0 (1 game runs every 3 minutes)

The full usage of this will be shown in the final calculation walkthroughs at the end.

Steps 5–8: Additional variables

As highlighted in the summary, the other variables which can affect the WINR minting are:

  • Step 5: Promotional Events: A promotional event which could be run which would lead to a higher multiplier for a particular game or across all games in the platform
  • Step 6: Top Player Bonus: A bonus earned for top players which would be applied if a user has reached that level on the platform. (this bonus has a limited time period of use)
  • Step 7: Referral Bonus: A bonus applied for referrals that lead to other players joining the platform. (this bonus has a limited time period of use)
  • Step 8: NFT cards: Users who hold an NFT card will be eligible for the bonuses attached to that the NFT. If they hold multiple cards then the bonus will only be applied from the most recent deposited card in their wallet.(This bonus depends upon the NFT being present within the user’s wallet).

Final calculation walkthrough from the WINR mining formula

Taking all of the steps above together, the formula to derive the final WINR tokens to be minted follows:

Interpolation * Log Curve * Game Factor * Promotional Events Factor * Top Player Bonus Factor * Referral Bonus Factor * NFT Cards Bonus
= WINR MINTED

Example:

Based upon all of the data presented above based upon a $5 bet during round 1 playing either Dice or Roulette:

Variables (without including game factor)
Interpolation: 3.2412
Log: 0.568319983478248
Promo: 1 (no promotions taking place)
Top Player: 1 (not a top player)
Referral: 1 (has no active referrals)
NFT Card: 1 (no NFT in their wallet)

=3.2412*0.568319983478248*1*1*1*1= 1.842 WINR Minted (Round 1)

Including Game Factor

  • Dice: 0.2 * 1.842 = 0.3684 WINR minted per game
  • Roulette: 3 * 1.842 = 5.526 WINR minted per game

Note to verify the game factor is fair you can do the following:

  • Dice: 0.3684 * 5 (games played per minute) = 1.842 WINR/min
  • Roulette: 5.526 / 3 (1 game played every minutes) = 1.842 WINR/min

Including NFT Jack of Diamonds

Following the above results, replace the default value of 1 to 1.08 which is the 8% increase in WINR minted if the NFT is held in a wallet. And the results would appear as follows:

  • Dice: 0.2 * 1.842 * 1.08= 0.3979 WINR mined per game
  • Roulette: 3 * 1.842* 1.08 = 5.968 WINR mined per game

Proof of Wagering, a summary and wrap up

Proof of Wagering

Users are able to mint WINR tokens as they play on the JustBet platform.

WINR tokens are generated (minted) by Proof of Wagering.

At each minting period, there is a certain predetermined amount to be minted based upon the calculations that have been presented.

The platform is designed to encourage users to play and earn WINR which

Whats coming next?

We will be providing further updates on how staking works and how we will show difficulty on the platform so that users can see how easy or difficult it is to earn platform airdrops from staking the WINR tokens that they have earned from the minting process described above.

About JustBet

JustBet is the first-ever fully decentralised gaming platform built on smart contracts on the Polygon Layer 2 Ethereum network. The platform runs fully autonomously with no human intervention. It is designed to create a unique gaming experience which is fast, secure, and fully decentralised. The platform is also designed for efficiency, speed and a truly unique gaming experience using Chainlink oracles.

The platform was designed to create a fully democratised gaming experience with a utility token for participation within the platform as part of the in-game experience. The platform airdrops 64% of all gaming profits daily to users who participate and stake WINR tokens. Users may also participate in the weekly lucky draw lottery which accumulates and distributes the remaining 16% of all gaming profits.

The platform also runs on a Proof-of-Wagering model where minted tokens are earned from each game transaction. Each game transaction is minted using a logarithmic model as well as using Chainlink oracle technology.

JustBet is the first fully decentralised, provably fair gaming platform; Where everyone is a WINR.

TwitterTelegram ChatTelegram AnnouncementsWebsite

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
JustBet

JustBet

5.3K Followers

The global gambling industry is not ready for what's coming.