xmaker: add more logs

This commit is contained in:
c9s 2024-09-01 16:41:16 +08:00 committed by lychiyu
parent ffc490aab5
commit bb33c956b0

View File

@ -481,6 +481,7 @@ func (s *Strategy) updateQuote(ctx context.Context) {
makerQuota.BaseAsset.Add(b.Available) makerQuota.BaseAsset.Add(b.Available)
} else { } else {
disableMakerAsk = true disableMakerAsk = true
s.logger.Infof("%s maker ask disabled: insufficient base balance %s", s.Symbol, b.String())
} }
} }
@ -489,6 +490,7 @@ func (s *Strategy) updateQuote(ctx context.Context) {
makerQuota.QuoteAsset.Add(b.Available) makerQuota.QuoteAsset.Add(b.Available)
} else { } else {
disableMakerBid = true disableMakerBid = true
s.logger.Infof("%s maker bid disabled: insufficient quote balance %s", s.Symbol, b.String())
} }
} }
@ -572,13 +574,13 @@ func (s *Strategy) updateQuote(ctx context.Context) {
if b.Available.Compare(minAvailable) > 0 { if b.Available.Compare(minAvailable) > 0 {
hedgeQuota.BaseAsset.Add(b.Available.Sub(minAvailable)) hedgeQuota.BaseAsset.Add(b.Available.Sub(minAvailable))
} else { } else {
s.logger.Warnf("%s maker bid disabled: insufficient base balance %s", s.Symbol, b.String()) s.logger.Warnf("%s maker bid disabled: insufficient hedge base balance %s", s.Symbol, b.String())
disableMakerBid = true disableMakerBid = true
} }
} else if b.Available.Compare(s.sourceMarket.MinQuantity) > 0 { } else if b.Available.Compare(s.sourceMarket.MinQuantity) > 0 {
hedgeQuota.BaseAsset.Add(b.Available) hedgeQuota.BaseAsset.Add(b.Available)
} else { } else {
s.logger.Warnf("%s maker bid disabled: insufficient base balance %s", s.Symbol, b.String()) s.logger.Warnf("%s maker bid disabled: insufficient hedge base balance %s", s.Symbol, b.String())
disableMakerBid = true disableMakerBid = true
} }
} }
@ -591,17 +593,16 @@ func (s *Strategy) updateQuote(ctx context.Context) {
if b.Available.Compare(minAvailable) > 0 { if b.Available.Compare(minAvailable) > 0 {
hedgeQuota.QuoteAsset.Add(b.Available.Sub(minAvailable)) hedgeQuota.QuoteAsset.Add(b.Available.Sub(minAvailable))
} else { } else {
s.logger.Warnf("%s maker ask disabled: insufficient quote balance %s", s.Symbol, b.String()) s.logger.Warnf("%s maker ask disabled: insufficient hedge quote balance %s", s.Symbol, b.String())
disableMakerAsk = true disableMakerAsk = true
} }
} else if b.Available.Compare(s.sourceMarket.MinNotional) > 0 { } else if b.Available.Compare(s.sourceMarket.MinNotional) > 0 {
hedgeQuota.QuoteAsset.Add(b.Available) hedgeQuota.QuoteAsset.Add(b.Available)
} else { } else {
s.logger.Warnf("%s maker ask disabled: insufficient quote balance %s", s.Symbol, b.String()) s.logger.Warnf("%s maker ask disabled: insufficient hedge quote balance %s", s.Symbol, b.String())
disableMakerAsk = true disableMakerAsk = true
} }
} }
} }
// if max exposure position is configured, we should not: // if max exposure position is configured, we should not: