-
Notifications
You must be signed in to change notification settings - Fork 44
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
Trading Test Cases (WIP) #638
Comments
Mind that the price is taken from the maker order, not the taker. So it's
so you were supposed to send
It makes sense to be 5300000, because the |
Yes I am pretty sure only one swap succeeded, the other failed. Reason: only one server was capable of swaping at the time of my test and see swapResult above. And yes, removing both sell orders in this case is correct, sorry if that reads differently. What is NOT correct: 0.003 remaining order should be added to the order book, whereas only 0.001 get added. Very likely related to Bug03.
Damn, yes of course. Ignore.
I am almost 100% sure I only executed 0.001 quantity since only one server in our test cloud with 0.001 quantity was actually swap enabled. |
BUG1 - no problem here. 2 orders removed, one for execution and one for failed execution. Remaining order is 0.003 as it should. The wrong balances are a result of 3 swaps and not one. The taker initiates a swap for 0.001 and create a remaining order of 0.003. The remaining order is sent to the peer (maker) where it is match with the same order that is being swapped (there is no check for I would start solving this by properly using and checking the |
It says remaining order 0.003 in the SwapResult which is correct, but actually only adds 0.001 to the order book (run |
again, the first match added 0.003 but there are another 2 swaps of 0.001 each. |
There were 2 swaps at print 1.1 and one swap at 1.101. This is why the calculation does not work out. |
We may have to discuss this on the call today but there's no concept of putting orders on hold during the taker matching process. |
We will never put orders on-hold since this is incompatible with how order book exchanges currently work (at least in |
OK. Need more time on this one to better understand the root cause. It might be the fact the the matching engine is not using a On the other hand, as I understand, the matching engine should never match a peer order with and existing own order, is this correct @moshababo ? Regardless, I will dive into it and find the reason |
This is correct. I rechecked the code and I'm not seeing how this could happen. |
So, here is what going on in #638: The maker (nodeA) created 5 buy orders and 5 sell orders The taker (nodeB) is sending There is a match for 0.001 (swap) and a reminder order of 0.003 is created on NodeB and added to order book. The reminder order is sent to node A and added to the order book The swap (#1) is over and the maker order (nodeA) is removed from the book. Now, a new player steps in, the Swap (#2) is working fine. Quantity in node B is reduced to 0.002. The bot order is removed on Node A. Now, the bot issue another order Swap (#3) is working fine. Quantity in node B is reduced to 0.001. The bot order is removed on Node A. Now, the bot issue another order This time, there is no availability at node B (quantity is 0.001 buy 0.002 is hed). As a result, on node B there is an own order of 0.001 (can't be traded). 3 swaps done. |
So, after #626 installed, the command is working it should. It is still very confusing to the user:
getorder should be imported:
We should consider to change the bot to be more dynamic with new orders. When checking
Easy to see :
So, still a bug but not top priority any more. |
We have an issue to sort the It's not unusual for the same order to be "removed" multiple times, since each time could just be removing only part of the order. I know it's a bit confusing terminology, but it was tricky to get right and it's what we went with. Maybe the cli output can just be tweaked to say "Order quantity removed" - but either way at the end of the day I don't think this command will be used by end users. I'm confused as to why we'd only show 3 swaps when we should have 4, are the steps to reproduce just |
@sangaman
To reproduce setup a simnet machine against the cloud servers and use @sangaman
With all the above, I think we should, again, take an example from LND and make sure we have a very strong an solid CLI interface that can be used for the above points. |
We all agree with you on the importance of the CLI (!) @offerm and let's continue open issues for improving it! Maybe let's start with "change the bot to be more dynamic with new orders" in a way, that once an order is completely filled, the bot issues a new order e.g. 1% above/below the previous order. This will clear things a lot to not mistake it with the "same order". Can you do that? |
It would be quite easy to add a |
No need to change the RPC layer for it.
showing the data as date string has to do with presentation layer.
It should be done on the CLI level.
…On Mon, Nov 12, 2018 at 1:04 AM Daniel McNally ***@***.***> wrote:
The problem with createdAtis its format. If it was a string datetime
format it could be a solution.
It would be quite easy to add a createdAtDate field or something to the
JSON output which is the toLocaleTimeString of createdAt, if that works
for you I can open an issue. FWIW the cli for lnd is printing all time
stamps as epochs as far as I know.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#638 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJQ0cl0QwhzZimZeJjS015klxnO4yKc2ks5uuKzvgaJpZM4YO1qg>
.
|
Yes I didn't say to change the RPC layer, the cli can just add that field to the JSON output that it prints to console. |
Is there a way to see everything happened to an order? |
Execute
xucli buy 0.004 LTC/BTC 1.101
on these 10 default sell orders in the
xud-simnet
:BEFORE:
AFTER (as is):
Swap result indicates 0.001 succeeded, 0.003 remaining which is what happened in reality but
Bug01: NOT the case when looking into the order book after the swap. Both matching orders for in total 0.002 BTC were removed (even though one swap definitely failed), and only 0.001 remaining order was added whereas it should 0.003.
Bug02: Shouldn't the
lndbtc
balance be 5000000−(1.101×300000)=4669700?Bug03: The
lndltc
balance defifinitely should be 5100000, not 5300000AFTER (#612 how it should be):
The text was updated successfully, but these errors were encountered: