mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
autoborrow: use debt instead of using b.Borrowed
This commit is contained in:
parent
157de4b2ee
commit
a2a062e95b
|
@ -213,9 +213,9 @@ func (s *Strategy) reBalanceDebt(ctx context.Context) {
|
||||||
|
|
||||||
log.Infof("checking repayable balance: %+v", b)
|
log.Infof("checking repayable balance: %+v", b)
|
||||||
|
|
||||||
toRepay := b.Borrowed
|
toRepay := debt
|
||||||
if !b.Available.IsZero() {
|
if !b.Available.IsZero() {
|
||||||
toRepay = fixedpoint.Min(b.Borrowed, b.Available)
|
toRepay = fixedpoint.Min(toRepay, b.Available)
|
||||||
} else {
|
} else {
|
||||||
log.Errorf("available balance is 0: %#v", b)
|
log.Errorf("available balance is 0: %#v", b)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user