xalign: round up requiredQuoteAmount

This commit is contained in:
c9s 2023-06-09 11:04:31 +08:00
parent 8baafdf329
commit f6f3293191
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -139,6 +139,7 @@ func (s *Strategy) selectSessionForCurrency(ctx context.Context, sessions map[st
}
requiredQuoteAmount := q.Mul(price)
requiredQuoteAmount = requiredQuoteAmount.Round(market.PricePrecision, fixedpoint.Up)
if requiredQuoteAmount.Compare(quoteBalance.Available) < 0 {
log.Warnf("required quote amount %f < quote balance %v", requiredQuoteAmount.Float64(), quoteBalance)
continue