The goal is to determine the payout function, defined as :
f ( x ) = factor × x f(x) = \text{factor} \times x f ( x ) = factor × x Step 1: Calculating Triangle Areas
For bets within a 3% delta range, the absolute deltas are divided into three categories:
Delta 2% Area:
Calculated over the interval [2, 3]:
∫ 2 3 f ( x ) d x = factor × 3 2 2 − factor × 2 2 2 = factor × ( 9 2 − 4 2 ) = factor × 2.5
\int_{2}^{3} f(x) \, dx = \text{factor} \times \frac{3^2}{2} - \text{factor} \times \frac{2^2}{2} = \text{factor} \times \left( \frac{9}{2} - \frac{4}{2} \right) = \text{factor} \times 2.5
∫ 2 3 f ( x ) d x = factor × 2 3 2 − factor × 2 2 2 = factor × ( 2 9 − 2 4 ) = factor × 2.5 Delta 1% Area:
Calculated over the interval [1, 2]:
∫ 1 2 f ( x ) d x = factor × 2 2 2 − factor × 1 2 2 = factor × ( 4 2 − 1 2 ) = factor × 1.5
\int_{1}^{2} f(x) \, dx = \text{factor} \times \frac{2^2}{2} - \text{factor} \times \frac{1^2}{2} = \text{factor} \times \left( \frac{4}{2} - \frac{1}{2} \right) = \text{factor} \times 1.5
∫ 1 2 f ( x ) d x = factor × 2 2 2 − factor × 2 1 2 = factor × ( 2 4 − 2 1 ) = factor × 1.5 Delta 0% Area:
Calculated over the interval [0, 1]:
∫ 0 1 f ( x ) d x = factor × 1 2 2 − factor × 0 2 2 = factor × 1 2 = factor × 0.5
\int_{0}^{1} f(x) \, dx = \text{factor} \times \frac{1^2}{2} - \text{factor} \times \frac{0^2}{2} = \text{factor} \times \frac{1}{2} = \text{factor} \times 0.5
∫ 0 1 f ( x ) d x = factor × 2 1 2 − factor × 2 0 2 = factor × 2 1 = factor × 0.5 Step 2: Ensuring Total Payout Equals Total Deposit:
The total payout is the sum of all triangle areas. This sum must equal the total deposit (e.g., 1000 units):
factor × ( 2.5 + 1.5 + 0.5 ) = 1000 \text{factor} \times (2.5 + 1.5 + 0.5) = 1000 factor × ( 2.5 + 1.5 + 0.5 ) = 1000 With all areas:
factor × 4.5 = 1000 ⟹ factor = 1000 4.5 = 222.222
\text{factor} \times 4.5 = 1000 \implies \text{factor} = \frac{1000}{4.5} = 222.222
factor × 4.5 = 1000 ⟹ factor = 4.5 1000 = 222.222 Without delta 1% bets:
factor × ( 2.5 + 0.5 ) = 1000 ⟹ factor = 1000 3 = 333.333
\text{factor} \times (2.5 + 0.5) = 1000 \implies \text{factor} = \frac{1000}{3} = 333.333
factor × ( 2.5 + 0.5 ) = 1000 ⟹ factor = 3 1000 = 333.333 The admin calculates the factor and average off-chain and submits them to the smart contract. The smart contract parameters include:
Factor: The constant multiplier for payouts.
Average: The calculated average probability.
Bets Map: A hashmap with the number of bets in each delta category (e.g., delta0, delta1, delta2).
Example function call:
Copy submit(factor, average, delta0NumberOfBets, delta1NumberOfBets, delta2NumberOfBets, ...)
Step 4: Calculating Payouts
Using :
f ( x ) = x ∗ e 2 p i i ξ x f(x) = x * e^{2 pi i \xi x} f ( x ) = x ∗ e 2 p ii ξ x distribute the pool for each delta category:
Delta 0 Area:
Payout = factor × 0.5 = 222.222 × 0.5 = 111.111 \text{Payout} = \text{factor} \times 0.5 = 222.222 \times 0.5 = 111.111
Payout = factor × 0.5 = 222.222 × 0.5 = 111.111 Delta 1 Area:
Payout = factor × 1.5 = 222.222 × 1.5 = 333.333
\text{Payout} = \text{factor} \times 1.5 = 222.222 \times 1.5 = 333.333
Payout = factor × 1.5 = 222.222 × 1.5 = 333.333 Delta 2 Area:
Payout = factor × 2.5 = 222.222 × 2.5 = 555.555 \text{Payout} = \text{factor} \times 2.5 = 222.222 \times 2.5 = 555.555 Payout = factor × 2.5 = 222.222 × 2.5 = 555.555 Total:
111.111 + 333.333 + 555.555 = 1000 111.111 + 333.333 + 555.555 = 1000 111.111 + 333.333 + 555.555 = 1000 Adjustments When Bets Are Missing
If there are no bets in the delta 1 category:
Delta 0 Area:
333.333 × 2.5 = 833.333 333.333 \times 2.5 = 833.333 333.333 × 2.5 = 833.333 Delta 2 Area:
333.333 × 0.5 = 166.667 333.333 \times 0.5 = 166.667 333.333 × 0.5 = 166.667
Total:
833.333 + 166.667 = 1000 833.333 + 166.667 = 1000 833.333 + 166.667 = 1000 Reward Distribution for Claimants
When a user claims their reward, the smart contract calculates the reward based on:
Category of the bet (delta0, delta1, delta2).
Number of bets in that category.
Example:
If there are 10 bets in the delta 0 category (payout pool: 555.555):
Individual Payout = 555.555 10 = 55.555 \text{Individual Payout} = \frac{555.555}{10} = 55.555 Individual Payout = 10 555.555 = 55.555 Last updated 4 months ago