diff --git a/pkg/strategy/autoborrow/strategy.go b/pkg/strategy/autoborrow/strategy.go index dec228fa0..8acacb38b 100644 --- a/pkg/strategy/autoborrow/strategy.go +++ b/pkg/strategy/autoborrow/strategy.go @@ -213,9 +213,9 @@ func (s *Strategy) reBalanceDebt(ctx context.Context) { log.Infof("checking repayable balance: %+v", b) - toRepay := b.Borrowed + toRepay := debt if !b.Available.IsZero() { - toRepay = fixedpoint.Min(b.Borrowed, b.Available) + toRepay = fixedpoint.Min(toRepay, b.Available) } else { log.Errorf("available balance is 0: %#v", b) }