# Bonding curve - EVM

### Introduction <a href="#introduction" id="introduction"></a>

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](https://app.uniswap.org/swap)(for base) and [Abstract Swap](https://www.abs.xyz/trade)(for Abstract). 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 <a href="#definitions" id="definitions"></a>

#### **Curve** <a href="#curve" id="curve"></a>

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** <a href="#setting-initial-values" id="setting-initial-values"></a>

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** <a href="#values" id="values"></a>

* 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) :** <a href="#calculation-on-tokens-to-migrate-m" id="calculation-on-tokens-to-migrate-m"></a>

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)** <a href="#calculating-tokens-to-burn-b" id="calculating-tokens-to-burn-b"></a>

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moonshot.cc/developers/bonding-curve-evm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
