Inverse Bonding Curve
  • The Inverse Bonding Curve
  • Security
    • Trust Security Audit Report
  • Usecases
    • Exponents
  • Concepts & Protocol
    • Bonding Curves
    • Inverse Bonding Curves (IBCs)
    • Curve Initialization
    • Minting / Burning
    • Liquidity Providing
    • Inverse Bonded Assets (ibAssets)
    • Fees
  • Smart Contracts
    • Deployed Contracts
    • Inverse Bonding Curve
    • IBC Factory
    • IBC Router
    • IBC Admin
Powered by GitBook
On this page
  • Initial Parameters
  • Minimum Initial Reserve
  • Initial LP Token Supply
  • Curve Formation
  • Curve Invariant
  1. Concepts & Protocol

Curve Initialization

PreviousInverse Bonding Curves (IBCs)NextMinting / Burning

Last updated 1 year ago

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.

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.

The provided initial parameter values of initial liquidity reserves (R0R_0R0​) is used to compute the initial minted supply (S0S_0S0​), and the starting spot price (P0P_0P0​).

Initial Parameters

The curve initializes to contain the provided R0R_0R0​ amount of liquidity reserves. The generated IBC starts off with a price curve equation of:

price=1supplyprice=\frac{1}{\sqrt{supply}}price=supply​1​

Where the price starts as 111 ibAsset = 111 reserve asset at a minted ibAsset supply of 111.

The initial minted supply and price values are then calculated as:

S0=R024S_0=\frac{{R_0}^{2}}{4}S0​=4R0​2​
P0=2R0P_0=\frac{2}{R_0}P0​=R0​2​

Minimum Initial Reserve

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:

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.

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.

Curve Formation

The curve is then defined as the below:

Curve Invariant

The invariant is used extensively in the IBC's implementation.

A minimum amount of initial reserves is enforced, preventing rounding errors during further interactions. The minimum initial reserve is set as 0.00020.00020.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.

P0(R0−P0S0)P_0\left(R_0-P_0S_0\right)P0​(R0​−P0​S0​)

Following from a generic IBC of mxk\frac{m}{x^k}xkm​, the initialized curve must show a spot price of P0P_0P0​ at a minted virtual supply of S0S_0S0​:

mS0k=P0\frac{m}{{S_0}^k}=P_0S0​km​=P0​

The curve should also contain a liquidity reserve of R0R_0R0​ at a minted supply of S0S_0S0​:

∫0S0mxkdx=mS01−k1−k=R0\int_{0}^{S_0}\frac{m}{x^{k}}dx=\frac{m{S_0}^{1-k}}{1-k}=R_0∫0S0​​xkm​dx=1−kmS0​1−k​=R0​

Whereby combining the two yields the values for mmmand kkk:

m=P0S01−P0S0R0, k=1−P0S0R0m=P_0{S_0}^{1-\frac{P_0S_0}{R_0}},\,k=1-\frac{P_0S_0}{R_0}m=P0​S0​1−R0​P0​S0​​,k=1−R0​P0​S0​​
P(x)=P0(S0S0+x)1−P0S0R0P(x)=P_0{\left(\frac{S_0}{S_0+x}\right)}^{1-\frac{P_0S_0}{R_0}}P(x)=P0​(S0​+xS0​​)1−R0​P0​S0​​

Where xxx is the amount of ibAssets being minted by further interactions post-initialization.

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

i=RSui=\frac{R}{S^{u}}i=SuR​

uuu represents the utilization of provided liquidity vs. liquidity used to back minted ibAssets at the current spot price. uuu is defined at curve initialization and is made to never update. uuu is defined as:

u=PSR=0.5u=\frac{PS}{R}=0.5u=RPS​=0.5

For all initialized IBCs, uuu is always set to have a value of 0.50.50.5.

With initialized values of R0R_0R0​, S0S_0S0​, P0P_0P0​, the values iii and uuu are set as:

i=R0S0u, u=P0S0R0=0.5i=\frac{R_0}{{S_0}^{u}},\,u=\frac{P_0S_0}{R_0}=0.5i=S0​uR0​​,u=R0​P0​S0​​=0.5

The newly added values of iii and uuu allow the price curve to also be written as:

P(x)=iu(S0+x)1−uP(x)=\frac{iu}{{\left(S_0+x\right)}^{1-u}}P(x)=(S0​+x)1−uiu​