marketmaking

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 1 Imported by: 0

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

Directories

Path Synopsis
Package formula defines the formulas that implements the MarketFormula interface
Package formula defines the formulas that implements the MarketFormula interface

Jump to

Keyboard shortcuts

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