mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
bbgo: make the max borrowing error message clear
This commit is contained in:
parent
7ef008dc4f
commit
b3ae4929be
|
@ -72,7 +72,7 @@ func (e *GeneralOrderExecutor) startMarginAssetUpdater(ctx context.Context) {
|
||||||
func (e *GeneralOrderExecutor) updateMarginAssetMaxBorrowable(ctx context.Context, marginService types.MarginBorrowRepayService, market types.Market) {
|
func (e *GeneralOrderExecutor) updateMarginAssetMaxBorrowable(ctx context.Context, marginService types.MarginBorrowRepayService, market types.Market) {
|
||||||
maxBorrowable, err := marginService.QueryMarginAssetMaxBorrowable(ctx, market.BaseCurrency)
|
maxBorrowable, err := marginService.QueryMarginAssetMaxBorrowable(ctx, market.BaseCurrency)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Errorf("can not query margin base asset max borrowable")
|
log.WithError(err).Errorf("can not query margin base asset %s max borrowable", market.BaseCurrency)
|
||||||
} else {
|
} else {
|
||||||
log.Infof("updating margin base asset %s max borrowable amount: %f", market.BaseCurrency, maxBorrowable.Float64())
|
log.Infof("updating margin base asset %s max borrowable amount: %f", market.BaseCurrency, maxBorrowable.Float64())
|
||||||
e.marginBaseMaxBorrowable = maxBorrowable
|
e.marginBaseMaxBorrowable = maxBorrowable
|
||||||
|
@ -80,7 +80,7 @@ func (e *GeneralOrderExecutor) updateMarginAssetMaxBorrowable(ctx context.Contex
|
||||||
|
|
||||||
maxBorrowable, err = marginService.QueryMarginAssetMaxBorrowable(ctx, market.QuoteCurrency)
|
maxBorrowable, err = marginService.QueryMarginAssetMaxBorrowable(ctx, market.QuoteCurrency)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Errorf("can not query margin base asset max borrowable")
|
log.WithError(err).Errorf("can not query margin quote asset %s max borrowable", market.QuoteCurrency)
|
||||||
} else {
|
} else {
|
||||||
log.Infof("updating margin quote asset %s max borrowable amount: %f", market.QuoteCurrency, maxBorrowable.Float64())
|
log.Infof("updating margin quote asset %s max borrowable amount: %f", market.QuoteCurrency, maxBorrowable.Float64())
|
||||||
e.marginQuoteMaxBorrowable = maxBorrowable
|
e.marginQuoteMaxBorrowable = maxBorrowable
|
||||||
|
|
Loading…
Reference in New Issue
Block a user