Inherits: LinFormula
This contract is used to get the purchase and sale return values for a linear curve.
Returns the purchase value using a Linear Curve.
function getPurchaseReturn(
uint256 supply,
uint256 reserveBalance,
uint256 initialCost,
uint32 scalingFactor,
uint256 depositAmount
) internal pure returns (uint256 purchaseReturn);
Parameters
supply
uint256
token total supply
reserveBalance
uint256
current balance of the reserve token
initialCost
uint256
initial cost of the token
scalingFactor
uint32
Returns
purchaseReturn
uint256
return of the conversion
Returns the sale value using a Linear Curve.
function getSaleReturn(
uint256 supply,
uint256 reserveBalance,
uint256 initialCost,
uint32 scalingFactor,
uint256 sellAmount
) internal pure returns (uint256 saleReturn);
Parameters
supply
uint256
token total supply
reserveBalance
uint256
balance of the reserve token
initialCost
uint256
initial cost of the token
scalingFactor
uint32
Returns
saleReturn
uint256
return of the conversion
scaling factor, represented in ppm, 1-1000000 token
depositAmount
uint256
amount of tokens to purchase
scaling factor, represented in ppm, 1-1000000 token
sellAmount
uint256
amount of tokens to sell