# Curve Initialization

Any user is able to generate an IBC curve by providing an initial amount of an ERC20 token as the selected reserve asset. An IBC is created per reserve asset type, and only one IBC can exist per reserve asset type.&#x20;

An IBC using ETH as the reserve asset is created at protocol genesis, with ibETH (the minted ibAsset) marking the first history of assets that follow inversed market dynamics. Other types of ibAssets can be generated by any user providing ERC20 reserve assets.&#x20;

The provided initial parameter values of initial liquidity reserves ($$R\_0$$) is used to compute the initial minted supply ($$S\_0$$), and the starting spot price ($$P\_0$$).&#x20;

## Initial Parameters

The curve initializes to contain the provided $$R\_0$$ amount of liquidity reserves. The generated IBC starts off with a price curve equation of:&#x20;

$$
price=\frac{1}{\sqrt{supply}}
$$

Where the price starts as $$1$$ ibAsset = $$1$$ reserve asset at a minted ibAsset supply of $$1$$.&#x20;

The initial minted supply and price values are then calculated as:&#x20;

$$
S\_0=\frac{{R\_0}^{2}}{4}
$$

$$
P\_0=\frac{2}{R\_0}
$$

### Minimum Initial Reserve

A minimum amount of initial reserves is enforced, preventing rounding errors during further interactions. The minimum initial reserve is set as $$0.0002$$ reserve assets for all initializing IBCs. Furthermore, a small reserve amount from the minimum initial reserve is deducted away and made non-withdrawable and is locked in the IBC eternally in order to prevent further rounding errors and disallow the reserve being drained to zero.

### Initial LP Token Supply

The IBC also starts with an initial minted supply of LP tokens, later used to calculate the LP token mint amounts to those providing liquidity to the initialized curve. The initial LP token amount is calculated as:&#x20;

$$
P\_0\left(R\_0-P\_0S\_0\right)
$$

Which is equal to the initial price, times the specified amount of virtual reserves minus the amount of virtual reserves that would be needed to fully back the initial virtual minted supply at the initial price.&#x20;

The LP token amount minted for a small deduction of the minimum initial reserve is also made non-removable, preventing potential rounding errors and total drainage of the reserve.&#x20;

### Curve Formation

Following from a generic IBC of $$\frac{m}{x^k}$$, the initialized curve must show a spot price of $$P\_0$$ at a minted virtual supply of $$S\_0$$:&#x20;

$$
\frac{m}{{S\_0}^k}=P\_0
$$

The curve should also contain a liquidity reserve of $$R\_0$$ at a minted supply of $$S\_0$$:&#x20;

$$
\int\_{0}^{S\_0}\frac{m}{x^{k}}dx=\frac{m{S\_0}^{1-k}}{1-k}=R\_0
$$

Whereby combining the two yields the values for $$m$$and $$k$$:&#x20;

$$
m=P\_0{S\_0}^{1-\frac{P\_0S\_0}{R\_0}},,k=1-\frac{P\_0S\_0}{R\_0}
$$

The curve is then defined as the below:&#x20;

$$
P(x)=P\_0{\left(\frac{S\_0}{S\_0+x}\right)}^{1-\frac{P\_0S\_0}{R\_0}}
$$

Where $$x$$ is the amount of ibAssets being minted by further interactions post-initialization.&#x20;

### Curve Invariant

The generated IBC is observed to have the below invariant ($$i$$) as mints and burns occur. $$i$$ does not update during mints and burns, but updates with LP additions and withdraws.

$$
i=\frac{R}{S^{u}}
$$

$$u$$ represents the utilization of provided liquidity vs. liquidity used to back minted ibAssets at the current spot price. $$u$$ is defined at curve initialization and is made to never update. $$u$$ is defined as:&#x20;

$$
u=\frac{PS}{R}=0.5
$$

For all initialized IBCs, $$u$$ is always set to have a value of $$0.5$$.&#x20;

With initialized values of $$R\_0$$, $$S\_0$$, $$P\_0$$, the values $$i$$ and $$u$$ are set as:&#x20;

$$
i=\frac{R\_0}{{S\_0}^{u}},,u=\frac{P\_0S\_0}{R\_0}=0.5
$$

The newly added values of $$i$$ and $$u$$ allow the price curve to also be written as:&#x20;

$$
P(x)=\frac{iu}{{\left(S\_0+x\right)}^{1-u}}
$$

The invariant is used extensively in the IBC's implementation.&#x20;


---

# 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.inversebondingcurve.com/concepts-and-protocol/curve-initialization.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.
