Appearance
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
| Name | Type | Description |
|---|---|---|
| supply | uint256 | total shares supply |
| amount | uint256 | number of shares to buy/sell |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | the price of the shares (all amount amount) |