SDKs@solio/coreUtilscomputeBondingCurvePrice

computeBondingCurvePrice()

function computeBondingCurvePrice(props): number

Computes the current price of a given bonding curve.

Parameters

ParameterTypeDescription
propsComputeBondingCurvePropsComputeBondingCurveProps An object containing the bonding curve type, its parameters, and the current supply of the token.

Returns

number

The current price of the token.

Example

const params = {
  type: 'linear',
  param: {
    k: 0.1,
    p: 10,
  },
  supply: 10,
}
const res = computeBondingCurvePrice(params)
console.log(res)