Launchpad protocol for memecoins
-
$\Omega_M$ is the amount of tokens to launch in the AMM -
$\Gamma_M$ is the amount of tokens locked in staking for LP -
$\Gamma_S$ is the target amount of Sui to raise in the bonding phase -
$PF$ is a Price Factor representing the difference between the terminal price in the seed phase phase vs. the initial price in the live phase
We have a piece-wise linear equation:
From which we compute the amount
Note: For the purpose of using only unsigned integers we transform this to a canonical formula:
In the program we scale up
Finally, we consider also decimal precision for
Therefore it follows: $$\begin{align*} \Delta M = \frac{\alpha (S_b^2 -S_a^2)}{2}+\beta (S_b-S_a) \\ \Leftrightarrow 2 \Delta M = \alpha (S_b^2 -S_a^2)+2 \beta (S_b-S_a) \\ \Leftrightarrow 2 \Delta M = \alpha (S_b - S_a)(S_b + S_a)+2 \beta (S_b-S_a) \\ \Leftrightarrow \frac{2 \Delta M}{(S_b - S_a)} = \alpha (S_b + S_a)+2 \beta \end{align*}$$
Since
$$\begin{align*} \frac{2 \Delta M}{\Delta S} = \alpha (2S_a + \Delta S)+2 \beta \\ \Leftrightarrow 0 = \alpha \Delta S ^2 + (2\alpha S_a+2\beta)\Delta S - 2\Delta M \end{align*}$$ By the quadratic formula we have:
Note: For the purpose of using only unsigned integers we transform this to a canonical formula:
In the program we scale up
Finally, we consider also decimal precision for
We will now perform the following transformations:
Where:
Such that:
We perform further substitutions:
$$\begin{align*} \Delta S = \frac{\frac{a}{b}-\frac{u}{v}}{2 |\alpha|} D_\alpha \\ \Delta S = \frac{(av - ub) * D_\alpha}{bv2|\alpha|} \end{align}$$
The amount
Restriction 1: The area under the curve must be equal to the target amount of tokens to sell in the seed phase:
The primitive from
Therefore the restriction follows:
Restriction 2: The terminal seed price, needs to be the initial price of the AMM pool times a certain price factor.
We know that the initial price in the AMM pool is given by:
Therefore we conclude that when:
Therefore it follows:
We are left to find out the values of
Now, we know that per the first restriction that
Restriction 3: Price Factor upper bound
An intuitive way to think about the price factor is that we are scaling the point in which the bonding curve hits
When we increase the price factor the "tip" of the bonding curve is elevated. Below the green horizontal line represents the boosted (inverted) price, whereas the orange line represents the initial price in the live phase.
The area under the curve, always needs to be equal to
There's a natural upper bound limit on the Price Factor, given that the area under the curve always needs to equal
Where