check if restQuantity is less than 0

This commit is contained in:
c9s 2021-05-18 13:44:57 +08:00
parent 21f7fa7846
commit 896518f5c2

View File

@ -158,7 +158,7 @@ func (e *TwapExecution) newBestPriceOrder() (orderForm types.SubmitOrder, err er
restQuantity := e.TargetQuantity - fixedpoint.Abs(base)
if restQuantity == 0 {
if restQuantity <= 0 {
if e.cancelContextIfTargetQuantityFilled() {
return
}