Merge pull request #1485 from c9s/narumi/xgap/improve-log

CHORE: [xgap] print currency when insufficient balance
This commit is contained in:
c9s 2024-01-09 00:53:16 +08:00 committed by GitHub
commit f33ed6a527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -336,12 +336,12 @@ func (s *Strategy) placeOrders(ctx context.Context) {
minQuantity := s.tradingMarket.AdjustQuantityByMinNotional(s.tradingMarket.MinQuantity, price)
if baseBalance.Available.Compare(minQuantity) < 0 {
log.Infof("base balance: %s is not enough, skip", baseBalance.Available.String())
log.Infof("base balance: %s %s is not enough, skip", baseBalance.Available.String(), s.tradingMarket.BaseCurrency)
return
}
if quoteBalance.Available.Div(price).Compare(minQuantity) < 0 {
log.Infof("quote balance: %s is not enough, skip", quoteBalance.Available.String())
log.Infof("quote balance: %s %s is not enough, skip", quoteBalance.Available.String(), s.tradingMarket.QuoteCurrency)
return
}