Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-712] send updates for both normal order matches and liquidation (… #1281

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading