Documentation ¶
Index ¶
- func CalculatePurchaseAmount(supply *big.Int, reserve *big.Int, crr uint32, wantReceive *big.Int) *big.Int
- func CalculatePurchaseReturn(supply *big.Int, reserve *big.Int, crr uint32, deposit *big.Int) *big.Int
- func CalculateSaleAmount(supply *big.Int, reserve *big.Int, crr uint32, wantReceive *big.Int) *big.Int
- func CalculateSaleReturn(supply *big.Int, reserve *big.Int, crr uint32, sellAmount *big.Int) *big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePurchaseAmount ¶ added in v0.0.6
func CalculatePurchaseAmount(supply *big.Int, reserve *big.Int, crr uint32, wantReceive *big.Int) *big.Int
CalculatePurchaseAmount is the reversed version of function CalculatePurchaseReturn Deposit = reserve * (((wantReceive + supply) / supply)^(100/c) - 1)
func CalculatePurchaseReturn ¶
func CalculatePurchaseReturn(supply *big.Int, reserve *big.Int, crr uint32, deposit *big.Int) *big.Int
CalculatePurchaseReturn calculates amount of coin that user will receive by depositing given amount of BIP Return = supply * ((1 + deposit / reserve) ^ (crr / 100) - 1)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.