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.

Last updated