Skip to content

Commit

Permalink
[CT-712] send updates for both normal order matches and liquidation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jayy04 authored Mar 29, 2024
1 parent a87b05b commit a5276b2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions protocol/x/clob/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,18 @@ func PrepareCheckState(
// 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
// For normal order matches, we send an update for the taker and maker orders.
if matchedOrders := match.GetMatchOrders(); matchedOrders != nil {
orderIdsToSend[matchedOrders.TakerOrderId] = true
for _, fill := range matchedOrders.Fills {
orderIdsToSend[fill.MakerOrderId] = true
}
}
// For liquidation matches, we send an update for the maker orders.
if matchedLiquidation := match.GetMatchPerpetualLiquidation(); matchedLiquidation != nil {
for _, fill := range matchedLiquidation.Fills {
orderIdsToSend[fill.MakerOrderId] = true
}
}
}
}
Expand Down

0 comments on commit a5276b2

Please sign in to comment.