Skip to content

Solidity API

IBondingCurve

A bonding curve definition

Bonding curve defines the price of the smallest unit of the asset as a function of the asset supply

getPrice

solidity
function getPrice(uint256 supply, uint256 amount) external pure returns (uint256)

Bonding curve function definition. The function calculating the price of the amount of shares given the current total supply supply

Parameters

NameTypeDescription
supplyuint256total shares supply
amountuint256number of shares to buy/sell

Return Values

NameTypeDescription
[0]uint256the price of the shares (all amount amount)