diff --git a/x/exchange/types/matching.go b/x/exchange/types/matching.go index 73379983..c0a27516 100644 --- a/x/exchange/types/matching.go +++ b/x/exchange/types/matching.go @@ -178,6 +178,9 @@ func (ctx *MatchingContext) ExecuteOrder( remainingQty = sdk.MinDec(remainingQty, qty) } } + if !remainingQty.IsNil() && !remainingQty.IsPositive() { + break + } executedQty := executableQty if !remainingQty.IsNil() {