xalign

package
v1.64.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: AGPL-3.0 Imports: 24 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ID = "xalign"

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetTransfer added in v1.64.0

type AssetTransfer struct {
	Withdraws []types.Withdraw
	Deposits  []types.Deposit
}

func (*AssetTransfer) SlackAttachment added in v1.64.0

func (at *AssetTransfer) SlackAttachment() slack.Attachment

type CriticalBalanceDiscrepancyAlert added in v1.62.0

type CriticalBalanceDiscrepancyAlert struct {
	SlackAlert *slackalert.SlackAlert

	Warning bool

	BaseCurrency      string
	Delta             fixedpoint.Value
	SustainedDuration time.Duration

	QuoteCurrency string
	AlertAmount   fixedpoint.Value

	Side     types.SideType
	Price    fixedpoint.Value
	Quantity fixedpoint.Value
	Amount   fixedpoint.Value
}

func (*CriticalBalanceDiscrepancyAlert) Comment added in v1.64.0

func (*CriticalBalanceDiscrepancyAlert) ObjectID added in v1.64.0

func (*CriticalBalanceDiscrepancyAlert) SlackAttachment added in v1.62.0

func (m *CriticalBalanceDiscrepancyAlert) SlackAttachment() slack.Attachment

func (*CriticalBalanceDiscrepancyAlert) WarnComment added in v1.64.0

type InteractiveOrderConfig added in v1.64.0

type InteractiveOrderConfig struct {
	Enabled bool `json:"enabled"`
	// Delay is the delay duration for interactive order confirmation in Slack
	Delay types.Duration `json:"delay"`
	// MinAmount is the minimum amount required for interactive order confirmation in Slack
	MinAmount fixedpoint.Value `json:"minAmount"`
}

type InteractiveSubmitOrder added in v1.64.0

type InteractiveSubmitOrder struct {
	sync.Mutex

	CancelOnce  func()
	ConfirmOnce func()
	// contains filtered or unexported fields
}

func NewInteractiveSubmitOrder added in v1.64.0

func NewInteractiveSubmitOrder(order types.SubmitOrder, delay time.Duration, mentions []string, slackEvtID string) *InteractiveSubmitOrder

func (*InteractiveSubmitOrder) AsyncSubmit added in v1.64.0

func (itOrder *InteractiveSubmitOrder) AsyncSubmit(ctx context.Context, session *bbgo.ExchangeSession, onSubmittedOrderCallback OnSubmittedOrderCallback)

func (*InteractiveSubmitOrder) SetHelpMessage added in v1.64.0

func (itOrder *InteractiveSubmitOrder) SetHelpMessage(msg string)

func (*InteractiveSubmitOrder) SlackBlocks added in v1.64.0

func (itOrder *InteractiveSubmitOrder) SlackBlocks() []slack.Block

type LargeAmountAlertConfig added in v1.61.0

type LargeAmountAlertConfig struct {
	Slack *slackalert.SlackAlert `json:"slack"`

	QuoteCurrency string           `json:"quoteCurrency"`
	Amount        fixedpoint.Value `json:"amount"`
}

type OnSubmittedOrderCallback added in v1.64.0

type OnSubmittedOrderCallback func(*bbgo.ExchangeSession, *types.SubmitOrder, *types.Order, error)

OnSubmittedOrderCallback is the callback function type on order submitted event Parameters: - session: the exchange session used to submit the order - submitOrder: the original submit order request - order: the created order, nil if error occurs - error: error if any during order submission

type QuoteCurrencyPreference

type QuoteCurrencyPreference struct {
	Buy  []string `json:"buy"`
	Sell []string `json:"sell"`
}

type Strategy

type Strategy struct {
	*bbgo.Environment
	ActiveTransferInterval   types.Duration              `json:"interval"` // keep the same tag name for backward compatibility
	IdleInterval             *types.Duration             `json:"idleInterval,omitempty"`
	PreferredSessions        []string                    `json:"sessions"`
	PreferredQuoteCurrencies *QuoteCurrencyPreference    `json:"quoteCurrencies"`
	ExpectedBalances         map[string]fixedpoint.Value `json:"expectedBalances"`
	UseTakerOrder            bool                        `json:"useTakerOrder"`
	DryRun                   bool                        `json:"dryRun"`
	BalanceToleranceRange    fixedpoint.Value            `json:"balanceToleranceRange"`
	Duration                 types.Duration              `json:"for"`
	InstantAlignAmount       fixedpoint.Value            `json:"instantAlignAmount"`
	Disabled                 bool                        `json:"disabled"`

	InteractiveOrderConfig *InteractiveOrderConfig `json:"interactiveOrder,omitempty"`

	WarningDuration types.Duration `json:"warningFor"`

	SkipTransferCheck bool `json:"skipTransferCheck"`

	MaxQuantity map[string]fixedpoint.Value `json:"maxQuantity"`

	LargeAmountAlert *LargeAmountAlertConfig `json:"largeAmountAlert"`

	SlackNotify                bool             `json:"slackNotify"`
	SlackNotifyMentions        []string         `json:"slackNotifyMentions"`
	SlackNotifyThresholdAmount fixedpoint.Value `json:"slackNotifyThresholdAmount,omitempty"`

	SkipAlignOnAnyActiveTransfer bool `json:"skipAlignOnAnyActiveTransfer"`

	ActiveTransferTimeWindow types.Duration `json:"activeTransferTimeWindow"`
	// contains filtered or unexported fields
}

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) Defaults added in v1.49.0

func (s *Strategy) Defaults() error

func (*Strategy) ID

func (s *Strategy) ID() string

func (*Strategy) Initialize added in v1.61.0

func (s *Strategy) Initialize() error

func (*Strategy) InstanceID

func (s *Strategy) InstanceID() string

func (*Strategy) Subscribe

func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)

func (*Strategy) Validate

func (s *Strategy) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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