mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
autoborrow: remove extra sign check
This commit is contained in:
parent
743ad0455f
commit
7b66d36f15
|
@ -102,10 +102,6 @@ func (s *Strategy) checkAndBorrow(ctx context.Context) {
|
|||
// check if we over borrow
|
||||
if toBorrow.Add(b.Borrowed).Compare(marginAsset.MaxTotalBorrow) > 0 {
|
||||
toBorrow = toBorrow.Sub( toBorrow.Add(b.Borrowed).Sub(marginAsset.MaxTotalBorrow) )
|
||||
if toBorrow.Sign() < 0 {
|
||||
log.Warnf("over borrowed, skip borrowing %+v", marginAsset)
|
||||
continue
|
||||
}
|
||||
}
|
||||
toBorrow = fixedpoint.Min(toBorrow.Add(b.Borrowed), marginAsset.MaxTotalBorrow)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user