-
Notifications
You must be signed in to change notification settings - Fork 43
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
Handle remove order request when order is on hold for pending swap #552
Comments
I'll take this one, related #587 (comment) |
Only applicable for matching mode. Your suggestion sounds good. Would definitely go for a different error message, sth along the lines "order currently swapping, order will be automatically removed if swap doesn't succeed". |
I don't think this would apply only to matching mode - in non-matching mode you can still submit orders to xud and remove them. There's the same possibility that someone tries to swap your order at the same time as you try to remove it. And instead of an error message I'm adding a field to the response to indicate whether a portion of the order was on hold. I don't think it's an "error" per se since the order will still be removed eventually, just that some of it was in the middle of being swapped. |
This handles the possibility that we attempt to remove an order via the rpc layer while that order has a hold for a pending swap. Instead of removing the entire order immediately, this only removes the available portion of the order and then waits until any swaps finish before removing the portions that were on hold. It also adds a field to the `RemoveOrder` rpc response which indicates whether any portion of the order was on hold. This gives feedback up front as to whether an order was removed immediately, or whether there are ongoing swaps which are being allowed to finish. Closes #552.
This handles the possibility that we attempt to remove an order via the rpc layer while that order has a hold for a pending swap. Instead of removing the entire order immediately, this only removes the available portion of the order and then waits until any swaps finish before removing the portions that were on hold. It also adds a field to the `RemoveOrder` rpc response which indicates whether any portion of the order was on hold. This gives feedback up front as to whether an order was removed immediately, or whether there are ongoing swaps which are being allowed to finish. Closes #552.
This handles the possibility that we attempt to remove an order via the rpc layer while that order has a hold for a pending swap. Instead of removing the entire order immediately, this only removes the available portion of the order and then waits until any swaps finish before removing the portions that were on hold. It also adds a field to the `RemoveOrder` rpc response which indicates whether any portion of the order was on hold. This gives feedback up front as to whether an order was removed immediately, or whether there are ongoing swaps which are being allowed to finish. Closes #552.
I understand what you are saying is that the exchange could still try to invalidate/remove its
Sounds good. |
With the possibility that an order is on hold for a pending swap, we need to handle the case when we receive a request to remove such an order from the order book. I'm thinking the best approach would probably be to hold off on removing that order until any holds are removed, but there are a few things to consider.
removeOrder
request if the order gets fully swapped - do we just respond with the "order not found" error as if the order never existed in the first place?swap.failed
andswap.paid
events and recheck iforder.hold === 0
after each one, does that sound reasonable?The text was updated successfully, but these errors were encountered: