project-serum / serum-dex

Project Serum Rust Monorepo
https://projectserum.com
Apache License 2.0
629 stars 329 forks source link

CancelOrdersByClientIds: error on dex failure #253

Closed yuhanfang closed 2 years ago

yuhanfang commented 2 years ago

This instruction currently returns Ok even if an order cancellation fails. In most cases this is the desired behavior, since the most common error is that the order no longer exists. However, for other errors, we should return the error instead of Ok since the cancellation removes the order from the order book, and that partial state update is no longer valid.