Math Behind WAX.FUN
Last updated
Last updated
This page explain a math behind how pricing and curve progress works within WAX.FUN
s - supply
r - user reserve, in WAXP tokens sent to WAX.FUN
r0 - initial reserve, amount in WAX calculated by taking initial
s_m - max_supply, theoretical max supply.
s(r) = s_m - s_m * r0 / (r + r0)
price(r) = (r + r0)^2 / ( s_m * r0 )
cap(r) = (r + r0)^2 / r0
To uniquely define a curve we have to specify (r0, s_m). For this we have following conditions:
s(r2) = N - amount of tokens to list, r2 - amount of WAX corresponding to N tokens to provide into WAX.FUN, so it reaches bonding curve progress 100%
Now,
cap(r0) = W0 - initial capitalisation (in WAX)
cap(r2) = W1 - final capitalisation (in WAX)
s_m = N / (1 - sqrt(W0/W1))
Target Market Cap is 21,000 USD at a time of token creation
N in our case is 800M tokens
We can consider several cases for WAX price below:
wax_to_usd_1 = $ 0.05
wax_to_usd_2 = $ 0.12
wax_to_usd_3 = $ 0.3
W0 = 3250 / 0.05$ = 65 000
W1 = 50 000 / 0.05$ = 1 000 000
r0 = 65 000
r2 = sqrt( 65 000*1 000 000 ) - 65 000 = 189 951
s_m = N / (1 - sqrt(W0/W1)) = 1073754845, in practice our max supply is always 1 BLN tokens.
Let’s see how WAX price affects calculated values in the table below
WAXP price
0.05
0.12
0.3
W0
65000
27083
10833
W1
1000000
416666
166666
r0
65000
27083
10833
s_m
1073754845
1073754845
1073754845
r2
189951
79146
31658
price_listed/price
1.01
1.01
1.01
As you can see WAXP token price doesn't affect whole math behind, it affects just amount of WAXP needed to reach 100% bonding.