xbalance

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: AGPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const ID = "xbalance"

Variables

This section is empty.

Functions

This section is empty.

Types

type Address added in v1.17.0

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

func (*Address) UnmarshalJSON added in v1.17.0

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 added in v1.17.0

func (s *State) IsOver24Hours() bool

func (*State) PlainText added in v1.17.0

func (s *State) PlainText() string

func (*State) Reset added in v1.17.0

func (s *State) Reset()

func (*State) SlackAttachment added in v1.17.0

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 added in v1.17.0

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

func (*WithdrawalRequest) PlainText added in v1.17.0

func (r *WithdrawalRequest) PlainText() string

func (*WithdrawalRequest) SlackAttachment added in v1.17.0

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

func (*WithdrawalRequest) String added in v1.17.0

func (r *WithdrawalRequest) String() string

Jump to

Keyboard shortcuts

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