dashed-slug.net › Forums › Exchange extension support › Exchange execution error – version 0.1.3
Tagged: bid, matching engine, Trade execution error
- This topic has 5 replies, 2 voices, and was last updated 7 years, 3 months ago by
alexg.
-
AuthorPosts
-
July 14, 2018 at 10:03 pm #3660
Anonymous
InactiveHi Alex,
After some further testing I found the following issue:
Placed a bid on a pair BTC/EOT on the exchange – Example placed a bid to buy 100 EOT for 0.00000010 BTC
The bid was logged correctly and is shown correctly on the bid side – when this bid is traded, the seller of the 100 EOT correctly receives BTC and 100 EOT gets deducted from the sellers EOT wallet. This is all correct. Where the error comes in is the buyer also receives BTC instead of the BTC being deducted and 100 EOT then also gets deducted from the buyers wallet instead the buyers wallet should be credited with 100 EOT. There seems to be something wrong with the logic?If you need any further information on this issue please let me know what you need and I can provide more details.
July 15, 2018 at 9:02 am #3661Anonymous
InactiveA further update on this from what I have found is that this error occurs only when you are trading on the bid side. If you trade on the ask side the trade executes correctly.
July 16, 2018 at 4:09 am #3665alexg
KeymasterThank you very much for your feedback. It is very helpful.
I was already made aware that there is some error in the matching engine, and it didn’t get caught by my tests.
I plan to fix this very soon, as it obviously is a matter of priority.
There will be a patch as soon as possible.
July 16, 2018 at 7:20 am #3666Anonymous
InactiveHi Alex,
I made the following change that seems to have fixed the issue:
Line 1568 in php-api.phpChanged to: if ( ‘bid’ == $maker_order->direction ) {
July 17, 2018 at 10:14 am #3668alexg
KeymasterThank you for the detailed explanation and for attempting to provide a fix.
Your fix is almost correct except it does not correctly calculate fees.
With your help I have identified the problem and will provide a fix that will also correctly take maker/taker fees into account.
best regards
July 17, 2018 at 2:27 pm #3675alexg
KeymasterIn version
0.2.0-beta, released just now, I have provided a major refactoring and cleanup of the matching engine. A number of bugs on the trading logic and fee calculation were fixed.Thank you for you help.
kind regards
-
AuthorPosts
- You must be logged in to reply to this topic.
