mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
xbalance: add foreign fee for withdrawal
This commit is contained in:
parent
18f72a9118
commit
990da5ad3b
|
@ -109,9 +109,10 @@ func (r *WithdrawalRequest) SlackAttachment() slack.Attachment {
|
|||
}
|
||||
|
||||
type Address struct {
|
||||
Address string `json:"address"`
|
||||
AddressTag string `json:"addressTag"`
|
||||
Network string `json:"network"`
|
||||
Address string `json:"address"`
|
||||
AddressTag string `json:"addressTag"`
|
||||
Network string `json:"network"`
|
||||
ForeignFee fixedpoint.Value `json:"foreignFee"`
|
||||
}
|
||||
|
||||
func (a *Address) UnmarshalJSON(body []byte) error {
|
||||
|
@ -207,6 +208,10 @@ func (s *Strategy) checkBalance(ctx context.Context, sessions map[string]*bbgo.E
|
|||
return
|
||||
}
|
||||
|
||||
if toAddress.ForeignFee > 0 {
|
||||
requiredAmount += toAddress.ForeignFee
|
||||
}
|
||||
|
||||
if s.state != nil {
|
||||
if s.MaxDailyNumberOfTransfer > 0 {
|
||||
if s.state.DailyNumberOfTransfers >= s.MaxDailyNumberOfTransfer {
|
||||
|
@ -380,4 +385,3 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user