placer

package
v0.0.0-...-0e8b5bb Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BET  = "b"
	HEAL = "h"
)

Variables

This section is empty.

Functions

func DecimalToFloat64

func DecimalToFloat64(d decimal.Decimal) float64

Types

type ClientID

type ClientID struct {
	ID   int64  `json:"i"`
	Side string `json:"s"`
	Try  int64  `json:"t"`
}

type PlaceConfig

type PlaceConfig struct {
	MaxStake             decimal.Decimal
	TargetProfit         decimal.Decimal
	TargetAmount         decimal.Decimal
	ReferralRate         decimal.Decimal
	BinFtxVolumeRatio    decimal.Decimal
	ProfitDiffRatio      decimal.Decimal
	AvgPriceDiffRatio    decimal.Decimal
	ProfitIncRatio       decimal.Decimal
	MinVolume            decimal.Decimal
	RehealThreshold      decimal.Decimal
	SizeRatioMultiplayer decimal.Decimal
}

type Placer

type Placer struct {
	// contains filtered or unexported fields
}

func NewPlacer

func NewPlacer(cfg *config.Config, log *zap.Logger, ctx context.Context, sto *store.Store) (*Placer, error)

func (*Placer) AccountInfo

func (p *Placer) AccountInfo() error

func (*Placer) BalanceAdd

func (p *Placer) BalanceAdd(coin string, usdValueDiff decimal.Decimal, coinValueDiff decimal.Decimal)

func (*Placer) BalanceSub

func (p *Placer) BalanceSub(coin string, usdValueDiff decimal.Decimal, coinValueDiff decimal.Decimal)

func (*Placer) Calc

func (p *Placer) Calc(sb *store.Surebet) chan int64

func (*Placer) Close

func (p *Placer) Close()

func (*Placer) ConnectAndSubscribe

func (p *Placer) ConnectAndSubscribe() error

func (*Placer) FindBalance

func (p *Placer) FindBalance(coin string) *store.BalanceEmb

func (*Placer) FindHeal

func (p *Placer) FindHeal(id int64, withOrders bool) *store.Heal

func (*Placer) FindMarket

func (p *Placer) FindMarket(symbol string) *store.MarketEmb

func (*Placer) GetBalances

func (p *Placer) GetBalances() error

func (*Placer) GetMarkets

func (p *Placer) GetMarkets() error

func (*Placer) GetOpenBuySell

func (p *Placer) GetOpenBuySell(coin string) (decimal.Decimal, decimal.Decimal)

func (*Placer) GetOpenOrders

func (p *Placer) GetOpenOrders() error

func (*Placer) GetOrdersHistory

func (p *Placer) GetOrdersHistory() error

func (*Placer) Lock

func (p *Placer) Lock(symbol string) chan int64

func (*Placer) PlaceOrder

func (p *Placer) PlaceOrder(ctx context.Context, param store.PlaceParamsEmb) (*store.Order, error)

func (*Placer) Run

func (p *Placer) Run() error

func (*Placer) SurebetHandler

func (p *Placer) SurebetHandler(sb *store.Surebet)

func (*Placer) Unlock

func (p *Placer) Unlock(symbol string)

Jump to

Keyboard shortcuts

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