Bonding Curve Formula
Last updated
Last updated
A simple constant product x * y = virtual_base_reserve * virtual_curve_reserve
can be presented as x * y = liquidity * liquidity
, while liquidity = sqrt(virtual_base_reserve * virtual_curve_reserve)
.
With a constraint on migration_quote_threshold
, it can be presented as a function of liquidity
, min_price
, max_price
.
We denote liquidity = l
, min_price = pa
, max_price = pb
.
So we have:
bonding_curve_constant_product = function(l, pa, pb)
On our dynamic bonding curve protocol:
bonding_curve = function([l_i, pa_i, pb_i])
That means partner can configure a bonding curve with any liquidity distribution up on their strategy.
For example, if the pool has this configuration:
sqrt_start_price = 1
curve = [sqrt_price = 2, liquidity = 100), (sqrt_price = 4, liquidity = 500)]
Then the bonding curve will function of 2 price ranges: (l = 100, pa = 1, pb = 2)
and (l = 500, pa = 2, pb = 4)
.
Please visit .