xbalance

package
v0.0.0-...-cb4139d Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ID = "xbalance"

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Address    string           `json:"address"`
	AddressTag string           `json:"addressTag"`
	Network    string           `json:"network"`
	ForeignFee fixedpoint.Value `json:"foreignFee"`
}

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(body []byte) error

type State

type State struct {
	Asset                  string           `json:"asset"`
	DailyNumberOfTransfers int              `json:"dailyNumberOfTransfers,omitempty"`
	DailyAmountOfTransfers fixedpoint.Value `json:"dailyAmountOfTransfers,omitempty"`
	Since                  int64            `json:"since"`
}

func (*State) IsOver24Hours

func (s *State) IsOver24Hours() bool

func (*State) PlainText

func (s *State) PlainText() string

func (*State) Reset

func (s *State) Reset()

func (*State) SlackAttachment

func (s *State) SlackAttachment() slack.Attachment

type Strategy

type Strategy struct {
	Interval types.Duration `json:"interval"`

	Addresses map[string]Address `json:"addresses"`

	MaxDailyNumberOfTransfer int              `json:"maxDailyNumberOfTransfer"`
	MaxDailyAmountOfTransfer fixedpoint.Value `json:"maxDailyAmountOfTransfer"`

	CheckOnStart bool `json:"checkOnStart"`

	Asset string `json:"asset"`

	// Low is the low balance level for triggering transfer
	Low fixedpoint.Value `json:"low"`

	// Middle is the middle balance level used for re-fill asset
	Middle fixedpoint.Value `json:"middle"`

	Verbose bool `json:"verbose"`

	State *State `persistence:"state"`
}

func (*Strategy) CrossRun

func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, sessions map[string]*bbgo.ExchangeSession) error

func (*Strategy) CrossSubscribe

func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession)

func (*Strategy) ID

func (s *Strategy) ID() string

type WithdrawalRequest

type WithdrawalRequest struct {
	FromSession string           `json:"fromSession"`
	ToSession   string           `json:"toSession"`
	Asset       string           `json:"asset"`
	Amount      fixedpoint.Value `json:"amount"`
}

func (*WithdrawalRequest) PlainText

func (r *WithdrawalRequest) PlainText() string

func (*WithdrawalRequest) SlackAttachment

func (r *WithdrawalRequest) SlackAttachment() slack.Attachment

func (*WithdrawalRequest) String

func (r *WithdrawalRequest) String() string

Jump to

Keyboard shortcuts

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