formula

package
v1.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 3 Imported by: 16

Documentation

Index

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 uint, wantReceive *big.Int) *big.Int

reversed function CalculatePurchaseReturn deposit = reserve * (((wantReceive + supply) / supply)^(100/c) - 1)

func CalculatePurchaseReturn

func CalculatePurchaseReturn(supply *big.Int, reserve *big.Int, crr uint, deposit *big.Int) *big.Int

Return = supply * ((1 + deposit / reserve) ^ (crr / 100) - 1)

func CalculateSaleAmount

func CalculateSaleAmount(supply *big.Int, reserve *big.Int, crr uint, wantReceive *big.Int) *big.Int

reversed function CalculateSaleReturn -(-1 + (-(wantReceive - reserve)/reserve)^(1/crr)) * supply

func CalculateSaleReturn

func CalculateSaleReturn(supply *big.Int, reserve *big.Int, crr uint, sellAmount *big.Int) *big.Int

Return = reserve * (1 - (1 - sellAmount / supply) ^ (100 / crr))

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL