Bonding curve - Base

Introduction

This is an implementation of a bonding curve mechanism for buying and selling Moonshot tokens based on virtual collateral and token reserves, also known as a Constant Product curve. The curve has an exponential shape so that the price rises slowly at the start and fast towards the end.

Once ~80% of the 1B token supply is sold on the curve, the fully diluted market cap reaches over 25 ETH and all remaining tokens & collateral migrate to Uniswap V2. Approximately ~4.9 ETH of collateral is collected on the curve.

The price at migration is 16.56 times the initial price on curve

Definitions

Curve

vTOKEN * vETH = k

Where,

  • vTOKEN = virtual reserve of the token

  • vETH = virtual reserve of the collateral (ETH)

  • k = constant that determines the shape of the curve

Setting initial values

We set the value of the coefficient k based on the initial price of the token

k = vTOKEN * vETH = iVTOKEN * iVETH - (1)

Where, iVTOKEN and iVETH are the initial amount of vTOKEN and vETH respectively

We set these as follows :

  • iVTOKEN = 1.06 * 10^27 minimal unit token

  • iVETH = 1.6 * 10^18 minimal unit token

So initial price = iVETH/iVTOKEN = 1.509433962 gwei

Values

  • Total supply of tokens (T) = 1,000,000,000

  • Minimum price is set to 1gwei or 10^-9 ETH

  • MarketCapThreshold is set to a fully diluted market cap of 25 ETH at ~80% of tokens sold. It is simply the (1 billion ) * (Price of token at allocation A)

  • Allocation at Migration (A) = ~80% of total supply

    • The exact minimal token amount is 799,538,871. Tokens have 18 decimals. That will be the exact point passed when trading stops and the migration begins.

    • If a buyer places a larger trade right before the ~80% threshold, a max allocation of 80.94% can be sold on the curve

  • Fee to be deducted at the time of migration (F) = 0.15 ETH

Calculation on tokens to Migrate (M) :

For calculating M, we will calculate, at the time of migration (when supply reaches the allocation A),

  • ETH collected as collateral

  • Reduce the fee to be charged from the collateral ETH

  • Calculate the price at the time of migration (allocation reached)

  • Determine the no of tokens (to be migrated) based on the collateral collected and price at allocation

M = (collateral collected - migration fees) / price of token

  • Collateral Collected= current_virtual_collateral_reserves - initial_collateral_reserves

  • Migration fees = Fee charged for creating a pool on Uniswap + Moonshot migration Fee = 0.15 ETH

  • Price of token = current_virtual_collateral_reserve / current_virtual_token_reserve

Calculating tokens to Burn (B)

Tokens to Burn (B) = T - A - M

= Total Supply - allocation(tokens sold at migration) - tokens to migrate (M)

So the total tokens in circulation post migration would be = A + M

Last updated