mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
xfunding: adjust quote investment according to the fee rate
This commit is contained in:
parent
6848e11e8a
commit
6ca85b175a
|
@ -196,7 +196,10 @@ func (s *Strategy) CrossRun(ctx context.Context, orderExecutionRouter bbgo.Order
|
|||
// adjust QuoteInvestment
|
||||
if b, ok := s.spotSession.Account.Balance(s.spotMarket.QuoteCurrency); ok {
|
||||
originalQuoteInvestment := s.QuoteInvestment
|
||||
s.QuoteInvestment = fixedpoint.Min(b.Available, s.QuoteInvestment)
|
||||
|
||||
// adjust available quote with the fee rate
|
||||
available := b.Available.Mul(fixedpoint.NewFromFloat(1.0 - (0.01 * 0.075)))
|
||||
s.QuoteInvestment = fixedpoint.Min(available, s.QuoteInvestment)
|
||||
|
||||
if originalQuoteInvestment.Compare(s.QuoteInvestment) != 0 {
|
||||
log.Infof("adjusted quoteInvestment from %s to %s according to the balance",
|
||||
|
|
Loading…
Reference in New Issue
Block a user