diff --git a/x/dex/contract/market_order.go b/x/dex/contract/market_order.go index 179884d165..e207e612ef 100644 --- a/x/dex/contract/market_order.go +++ b/x/dex/contract/market_order.go @@ -41,10 +41,15 @@ func getUnfulfilledPlacedMarketOrderIds( continue } if order.OrderType == types.OrderType_MARKET || order.OrderType == types.OrderType_LIQUIDATION || - order.OrderType == types.OrderType_FOKMARKET || order.OrderType == types.OrderType_FOKMARKETBYVALUE { + order.OrderType == types.OrderType_FOKMARKET { if settledQuantity, ok := orderIDToSettledQuantities[order.Id]; !ok || settledQuantity.LT(order.Quantity) { res = append(res, order.Id) } + } else if order.OrderType == types.OrderType_FOKMARKETBYVALUE { + // cancel market order by nominal if zero quantity is executed + if _, ok := orderIDToSettledQuantities[order.Id]; !ok { + res = append(res, order.Id) + } } } return res