You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The matching queue is configured with the setting clean_start: true. I assume this is because when initializing matching we load all wait orders and try to match them, and we do not have a straightforward way to know if a submit event in the queue corresponds to an already-loaded order or not, which might trigger processing an order twice.
Consider the following case:
Market maker publishes an order A, Peatio answers 201
matching crashes, starts restarting
Market maker cancels order A, Peatio answers 201
matching finishes restarting, purging its queue, deleting all cancel events
Market maker assumes it has no active orders
The text was updated successfully, but these errors were encountered:
This is not a design flaw.
The market maker should listen for websocket events and then cancel the order from its memory.
When exchange replies 201 for orders api it means instruction received not executed.
I understand that you may do a workaround by listening to the websocket, but note that the cancellation event has been lost and thus the order status will not be updated to cancel. You can only know about this situation and how to create a hacky workaround by understanding the underlying exchange implementation.
Second consideration, what exchange (or just any popular service in general) in the world asks you to implement a client for a RESTful API along with a websocket client to check if your request has actually been processed successfully?
The
matching
queue is configured with the settingclean_start: true
. I assume this is because when initializingmatching
we load allwait
orders and try to match them, and we do not have a straightforward way to know if a submit event in the queue corresponds to an already-loaded order or not, which might trigger processing an order twice.Consider the following case:
matching
crashes, starts restartingmatching
finishes restarting, purging its queue, deleting all cancel eventsThe text was updated successfully, but these errors were encountered: