diff --git a/protocol/x/clob/abci.go b/protocol/x/clob/abci.go index 27f4492589..f7e371c82f 100644 --- a/protocol/x/clob/abci.go +++ b/protocol/x/clob/abci.go @@ -169,7 +169,26 @@ func PrepareCheckState( // For orders that are filled in the last block, send an orderbook update to the grpc streams. if keeper.GetGrpcStreamingManager().Enabled() { allUpdates := types.NewOffchainUpdates() + orderIdsToSend := make(map[types.OrderId]bool) + + // Send an update for reverted local operations. + for _, operation := range localValidatorOperationsQueue { + if match := operation.GetMatch(); match != nil { + orderIdsToSend[match.GetMatchOrders().TakerOrderId] = true + + for _, fill := range match.GetMatchOrders().Fills { + orderIdsToSend[fill.MakerOrderId] = true + } + } + } + + // Send an update for orders that were proposed. for _, orderId := range processProposerMatchesEvents.OrderIdsFilledInLastBlock { + orderIdsToSend[orderId] = true + } + + // Send update. + for orderId := range orderIdsToSend { if _, exists := keeper.MemClob.GetOrder(ctx, orderId); exists { orderbookUpdate := keeper.MemClob.GetOrderbookUpdatesForOrderUpdate(ctx, orderId) allUpdates.Append(orderbookUpdate)