Documentation
¶
Index ¶
Constants ¶
View Source
const ID = "autoborrow"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarginAction ¶
type MarginAction struct {
Exchange types.ExchangeName `json:"exchange"`
Action string `json:"action"`
Asset string `json:"asset"`
Amount fixedpoint.Value `json:"amount"`
MarginLevel fixedpoint.Value `json:"marginLevel"`
MinMarginLevel fixedpoint.Value `json:"minMarginLevel"`
}
func (*MarginAction) SlackAttachment ¶
func (a *MarginAction) SlackAttachment() slack.Attachment
type MarginAssetConfig ¶ added in v1.61.0
type MarginAssetConfig struct {
Asset string `json:"asset"`
Low fixedpoint.Value `json:"low"`
MaxTotalBorrow fixedpoint.Value `json:"maxTotalBorrow"`
MaxQuantityPerBorrow fixedpoint.Value `json:"maxQuantityPerBorrow"`
MinQuantityPerBorrow fixedpoint.Value `json:"minQuantityPerBorrow"`
DebtRatio fixedpoint.Value `json:"debtRatio"`
}
type MarginHighInterestRateAlert ¶ added in v1.62.0
type MarginHighInterestRateAlert struct {
AlertID string
AccountLabel string
SessionName string
Exchange types.ExchangeName
HighRateAssets types.MarginNextHourlyInterestRateMap
NextTotalInterestValueInUSD fixedpoint.Value
Debts types.BalanceMap
}
func (*MarginHighInterestRateAlert) ObjectID ¶ added in v1.62.0
func (a *MarginHighInterestRateAlert) ObjectID() string
func (*MarginHighInterestRateAlert) SlackAttachment ¶ added in v1.62.0
func (a *MarginHighInterestRateAlert) SlackAttachment() slack.Attachment
type MarginHighInterestRateAlertConfig ¶ added in v1.62.0
type MarginHighInterestRateAlertConfig struct {
Slack *slackalert.SlackAlert `json:"slack,omitempty"`
Interval types.Duration `json:"interval"`
MinDebtAmount fixedpoint.Value `json:"minDebtAmount"`
MinAnnualInterestRate fixedpoint.Value `json:"minAnnualInterestRate"`
}
type MarginHighInterestRateWorker ¶ added in v1.62.0
type MarginHighInterestRateWorker struct {
// contains filtered or unexported fields
}
func (*MarginHighInterestRateWorker) Run ¶ added in v1.62.0
func (w *MarginHighInterestRateWorker) Run(ctx context.Context)
type MarginLevelAlert ¶ added in v1.56.0
type MarginLevelAlert struct {
AlertID string
AccountLabel string
CurrentMarginLevel fixedpoint.Value
MinimalMarginLevel fixedpoint.Value
SessionName string
Exchange types.ExchangeName
TotalDebtValueInUSD fixedpoint.Value
Debts types.BalanceMap
}
MarginLevelAlert is used to send the slack mention alerts when the current margin is less than the required margin level
func (*MarginLevelAlert) ObjectID ¶ added in v1.61.0
func (m *MarginLevelAlert) ObjectID() (str string)
func (*MarginLevelAlert) SlackAttachment ¶ added in v1.61.0
func (m *MarginLevelAlert) SlackAttachment() slack.Attachment
type MarginLevelAlertConfig ¶ added in v1.61.0
type MarginLevelAlertConfig struct {
Slack *slackalert.SlackAlert `json:"slack"`
Interval types.Duration `json:"interval"`
MinMargin fixedpoint.Value `json:"minMargin"`
}
type MarginRepayAlertConfig ¶ added in v1.61.0
type MarginRepayAlertConfig struct {
Slack *slackalert.SlackAlert `json:"slack,omitempty"`
}
type RepaidAlert ¶ added in v1.56.0
type RepaidAlert struct {
SessionName string
Asset string
Amount fixedpoint.Value
SlackMentions []string
}
RepaidAlert
func (*RepaidAlert) SlackAttachment ¶ added in v1.56.0
func (m *RepaidAlert) SlackAttachment() slack.Attachment
type Strategy ¶
type Strategy struct {
Interval types.Interval `json:"interval"`
MinMarginLevel fixedpoint.Value `json:"minMarginLevel"`
MaxMarginLevel fixedpoint.Value `json:"maxMarginLevel"`
AutoRepayWhenDeposit bool `json:"autoRepayWhenDeposit"`
MarginLevelAlert *MarginLevelAlertConfig `json:"marginLevelAlert"`
MarginRepayAlert *MarginRepayAlertConfig `json:"marginRepayAlert"`
MarginHighInterestRateAlertConfig *MarginHighInterestRateAlertConfig `json:"marginHighInterestRateAlert"`
Assets []MarginAssetConfig `json:"assets"`
ExchangeSession *bbgo.ExchangeSession
// contains filtered or unexported fields
}
func (*Strategy) Initialize ¶ added in v1.62.0
func (*Strategy) Run ¶
func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error
This strategy simply spent all available quote currency to buy the symbol whenever kline gets closed
func (*Strategy) Subscribe ¶
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
Click to show internal directories.
Click to hide internal directories.