Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MakingFormula ¶
type MakingFormula interface { SpotPrice(spotPriceOpts interface{}) (spotPrice decimal.Decimal, err error) OutGivenIn(outGivenInOpts interface{}, amountIn uint64) (amountOut uint64, err error) InGivenOut(inGivenOutOpts interface{}, amountOut uint64) (amountIn uint64, err error) FormulaType() int }
MakingFormula defines the interface for implementing the formula to derive the spot price
type MakingStrategy ¶
type MakingStrategy struct { Type int // contains filtered or unexported fields }
MakingStrategy defines the automated market making strategy, usingi a formula to be applied to calculate the price of next trade.
func NewStrategyFromFormula ¶
func NewStrategyFromFormula( formula MakingFormula, ) MakingStrategy
NewStrategyFromFormula returns the strategy struct with the name
func (MakingStrategy) Formula ¶
func (ms MakingStrategy) Formula() MakingFormula
Formula returns the mathematical formula of the MM strategy
func (MakingStrategy) IsZero ¶
func (ms MakingStrategy) IsZero() bool
IsZero checks if the given strategy is the zero value
Click to show internal directories.
Click to hide internal directories.