Skip to content

Commit

Permalink
exclude MsgBatchCancel from mempool (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx authored and roy-dydx committed Apr 26, 2024
1 parent a7ed4c2 commit c8beeea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mempool/dydx_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// IsShortTermClobOrderTransaction returns true if the provided `tx` is a
// Cosmos transaction containing a short-term `MsgPlaceOrder` or
// short-term `MsgCancelOrder` message.
// short-term `MsgCancelOrder` or `MsgBatchCancel` message.
func IsShortTermClobOrderTransaction(
tx types.Tx,
mempoolLogger log.Logger,
Expand Down Expand Up @@ -44,6 +44,10 @@ func IsShortTermClobOrderTransaction(
}
return msgCancelOrder.OrderId.IsShortTermOrder()
}
if cosmosTx.Body.Messages[0].TypeUrl == "/dydxprotocol.clob.MsgBatchCancel" {
// MsgBatchCancel only processes short term order cancellations as of right now.
return true
}
}

return false
Expand Down

0 comments on commit c8beeea

Please sign in to comment.