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

Add failed swaps to placeOrder (buy/sell) response #609

Closed
sangaman opened this issue Oct 27, 2018 · 4 comments
Closed

Add failed swaps to placeOrder (buy/sell) response #609

sangaman opened this issue Oct 27, 2018 · 4 comments
Assignees
Labels
Milestone

Comments

@sangaman
Copy link
Collaborator

It might be useful to know whether a placed order attempted to swap with any peer orders but failed. Currently placeOrder only returns information about successful swaps and internal matches. We could make it also return failed swaps. I figure for each failed swap we'd want to know the orderId and maybe quantity and peerPubKey, maybe the error message for why the swap failed`? Comment if you can think of anything else that might be worth returning.

@kilrau
Copy link
Contributor

kilrau commented Oct 27, 2018

So instead of only persisting it in the db as per #562 you suggest also to return failed swap info in placeOrder (sync and streaming event) until a swap succeeds, correct?

Important imo:
orderID, pair, quantity, price, peerPubKey, error message

@kilrau kilrau added this to the 1.0.0-alpha.3 milestone Oct 27, 2018
@sangaman
Copy link
Collaborator Author

It would be for both the sync and streaming place order calls, but yeah otherwise that's right. Altho even if a swap never succeeds, we'd still want to return any swaps that failed.

@kilrau kilrau added the P2 mid priority label Oct 27, 2018
@kilrau kilrau changed the title Add failed swaps to placeOrder response Add failed swaps to placeOrder (buy/sell) response Oct 29, 2018
@kilrau
Copy link
Contributor

kilrau commented Oct 30, 2018

Solves parts of #620

@kilrau
Copy link
Contributor

kilrau commented Dec 6, 2018

Output today:

$ xucli buy 0.0025 LTC/BTC 1.105
swapped 0.001 LTC with peer order 62e45ed0-eccb-11e8-a9ee-5d8556a34cdc
remaining 0.0015 LTC entered the order book as 92a14980-eccb-11e8-bb8f-69b162a0c6a5
admins-MacBook-Pro-2:xud admin$ 

How it should be:

$ xucli buy 0.0025 LTC/BTC 1.105
matched 0.001 LTC with peer order 62e45ed0-eccb-11e8-a9ee-5d8556a34cdc
matched 0.0015 LTC with peer order 87e44ed9-xxxx-xxxx-xxxx-xxxxxxxxxx
swapped 0.001 LTC with peer order 62e45ed0-eccb-11e8-a9ee-5d8556a34cdc
failed to swap 0.0015 LTC with peer order 87e44ed9-xxxx-xxxx-xxxx-xxxxxxxxxx
remaining 0.0015 LTC entered the order book as 92a14980-eccb-11e8-bb8f-69b162a0c6a5

@kilrau kilrau modified the milestones: 1.0.0-alpha.6, 1.0.0-alpha.8 Jan 2, 2019
sangaman added a commit that referenced this issue Jan 16, 2019
This adds a `FailedSwap` message type to the asynchronous `PlaceOrder`
rpc call. It is used to notify the caller in real time when a swap fails
for a given order.

Closes #609.
@ghost ghost added the in progress label Jan 16, 2019
sangaman added a commit that referenced this issue Jan 22, 2019
This adds a `SwapFailure` message type to the asynchronous `PlaceOrder`
rpc call. It is used to notify the caller in real time when a swap fails
for a given order. This also renames `SwapResult` to `SwapSuccess` to
clearly distinguish it from the unsuccessful `SwapFailure`.

Closes #609. Closes #734.
sangaman added a commit that referenced this issue Jan 23, 2019
This adds a `SwapFailure` message type to the asynchronous `PlaceOrder`
rpc call. It is used to notify the caller in real time when a swap fails
for a given order. This also renames `SwapResult` to `SwapSuccess` to
clearly distinguish it from the unsuccessful `SwapFailure`.

Closes #609. Closes #734.
@ghost ghost removed the in progress label Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants