# Bonding Curves

### How it works <a href="#how-it-works" id="how-it-works"></a>

similiar to the Liquidity Book on Magicsea, our curves are setup using **bins** to store token amounts and prices.

As more **IOTA** is exchanged for a token, the bin will fill up until their is no more tokens in that bin, then it will go to the next non empty bin.

Token prices per bin goes up 20% incrementally. This is a step-wise approach to the bonding curve problem. Compare that to moonshot or pumpdotfun whose bonding curves follow the a distinct curve.

This allows Catapus to cater to multiple pricing strategies.

### Mathematical Formulas <a href="#mathematical-formulas" id="mathematical-formulas"></a>

#### **Price Calculation for Each Bin**: <a href="#price-calculation-for-each-bin" id="price-calculation-for-each-bin"></a>

Calculate the price for the bin using the formula:

price=basePrice×(100+(i×20​))/100price=basePrice×(100+(i×20​))/100

#### Calculate Last Non-Zero Bin Price <a href="#calculate-last-non-zero-bin-price" id="calculate-last-non-zero-bin-price"></a>

Determine the price for the last non-zero bin using:

lastNonZeroPrice=basePrice×(1+(length−1)×20​100)lastNonZeroPrice=basePrice×(1+100(length−1)×20​​)

#### Market Cap Calculation <a href="#market-cap-calculation" id="market-cap-calculation"></a>

This is the market cap at the last bin. This is the value of the token when migrated to Magicsea.

requiredMarketCap=totalDistribution×lastNonZeroPricerequiredMarketCap=totalDistribution×lastNonZeroPrice

#### Fraction Validation <a href="#fraction-validation" id="fraction-validation"></a>

This is the fraction of the total supply that we want added to the bins.

cumulativeValue=∑i=un−1​lists\[i]×priceicumulativeValue=i=u∑n−1​​lists\[i]×pricei​fraction=10,000×requiredMarketCapcumulativeValue+requiredMarketCapfraction=10,000×cumulativeValue+requiredMarketCaprequiredMarketCap​<br>


---

# 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://doc.catapus.com/bonding-curves.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.
