Author Topic: Order matching bug (when margin call order is on the book)  (Read 6995 times)

0 Members and 1 Guest are viewing this topic.

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
Technically, this is not a bug. A user places an order on the exchange, and it gets filled at the specified price.

Nevertheless, I have come to agree that the behaviour is less than optimal and should be improved.

We must find a balance between the interests of traders and those of the blockchain. The blockchain must try to keep short positions sufficiently collateralized, but of course it should pay a reasonable price for that.

P.S.  I understand there are several fixes queued up for the next hard fork.  Does anyone know when that is expected to happen?  If it's not soon, perhaps a temporary fix should be made in the UI pending the next hard fork containing this fix?

I expect the BSIP-0018 hardfork to happen in the next two months or so, but a date has not been set yet.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline tbone

  • Hero Member
  • *****
  • Posts: 632
    • View Profile
  • BitShares: tbone2
Traders often place orders outside the spread (i.e. buy orders above the best offer, or sell orders below the best bid).  The expectation is that the order matching engine will walk the order book sequentially until the order is filled.  This is how the trading engine of every platform I have ever seen works. 

However, this does not work on the DEX as expected under one particular condition.  It appears that when there is a margin call order on the book and the user places an order with the same price, the order matching engine matches the user's order with the margin call order, completely skipping the orders on the book that are inside the margin call order. 

This issue was discovered by @alexpmorris, who posted about it on steemit.com, which sparked some discussion:

http://bit.ly/2tKiDfb


The ability to place orders outside the spread is particularly necessary in cryptocurrency trading, where the quantity of tokens available at the best bid or best ask is so often less than the quantity a trader is interested in buying or selling.  In the vast majority of cases, the DEX handles such orders as expected.  But this edge case could cause people to lose confidence in the platform and should therefore be corrected ASAP.

P.S.  I understand there are several fixes queued up for the next hard fork.  Does anyone know when that is expected to happen?  If it's not soon, perhaps a temporary fix should be made in the UI pending the next hard fork containing this fix?
« Last Edit: July 28, 2017, 07:44:29 pm by tbone »