Author Topic: The market engine is not matching shorts properly  (Read 6010 times)

0 Members and 1 Guest are viewing this topic.

Offline sudo

  • Hero Member
  • *****
  • Posts: 2255
    • View Profile
  • BitShares: ags
With the current market engine, it reverts to normal status. I suppose the new engine will behave in the same way.

Another question: does an expired cover that later gets margin called execute at call price or call price + 10%? In other words, is the priority on expiry or on margin?

I am curious too

Offline svk

With the current market engine, it reverts to normal status. I suppose the new engine will behave in the same way.

Another question: does an expired cover that later gets margin called execute at call price or call price + 10%? In other words, is the priority on expiry or on margin?
Worker: dev.bitsharesblocks

Offline Shentist

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 1601
    • View Profile
    • metaexchange
  • BitShares: shentist
wow,

so a matching bug again. i hope it will get fixed soon. This costs not only me money, but will not get new people in BitShares.

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
With the current market engine, it reverts to normal status. I suppose the new engine will behave in the same way.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline svk

Another question about the mechanics, what happens to a short that gets margin called, but before it fills the call price drops below the margin call price? Does it remain a forced cover, or does it revert to normal status and wait for either another margin call or the expiration date?
Worker: dev.bitsharesblocks

Offline svk

You're right I could sum them, those are all expired orders actually, I forgot about the margin called orders. I was under the impression the 10% above price was a bug, isn't it? Expired orders should be at the feed price though right?

The bug was that expired cover orders had a limit price at 10% above the price feed when it was supposed to be at the price feed. However, margin call cover orders should have a price limit 10% above the price feed.

Thanks for the clarifications, I've worked some more on the wallet this morning and I believe I have it right this time. One thing that I'm unsure about is, what happens to a margin called order that expires before getting filled? Does it stay at +10% price, or does it revert to the feed price? I suppose it's the former, but unfortunately there's no way for me to distinguish between a call that had previously been margin called but is now expired..

Here's a screenie from bitBTC which currently has expired and forced margin calls at the top of the books:



FYI atm bitUSD as of right now still has an invisible buy order of 1275.55 bitUSD at 243.4266 BTS/bitUSD, and the expired orders make up a whopping 186944 bitUSD at 221.29 BTS/bitUSD. At least this makes the whole trading action make a lot more sense, what was missing from my understanding was the forced margin calls at +10% which were invisible in the client.
Worker: dev.bitsharesblocks

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
You're right I could sum them, those are all expired orders actually, I forgot about the margin called orders. I was under the impression the 10% above price was a bug, isn't it? Expired orders should be at the feed price though right?

The bug was that expired cover orders had a limit price at 10% above the price feed when it was supposed to be at the price feed. However, margin call cover orders should have a price limit 10% above the price feed.


Offline svk





Shouldn't your buy table also have entries at 10% above the feed price for the margin-called orders?

Also I think it would look much better if you coalesced orders at the same price together. That means there shouldn't be more than at most two yellow items (one for expired cover orders and one for margin-called cover orders). If a user wants to a see a more detailed break down than that, they always could click the "Margin Orders" button (which I think is misleading and should instead be labelled "Cover Orders").

You're right I could sum them, those are all expired orders actually, I forgot about the margin called orders. I was under the impression the 10% above price was a bug, isn't it? Expired orders should be at the feed price though right?
Worker: dev.bitsharesblocks

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag


Shouldn't your buy table also have entries at 10% above the feed price for the margin-called orders?

Also I think it would look much better if you coalesced orders at the same price together. That means there shouldn't be more than at most two yellow items (one for expired cover orders and one for margin-called cover orders). If a user wants to a see a more detailed break down than that, they always could click the "Margin Orders" button (which I think is misleading and should instead be labelled "Cover Orders").

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
It is possible to buy bitUSD from regular sellers, but not from shorts.

It is also possible to short bitUSD at the feed price by either setting no limit or a limit above ~.0047 USD/BTS. These shorts will be eaten up immediately by the margin calls, so it is not possible to self-short.

That doesn't seem to be the case either, there's currently a short wall of 354 bitUSD for sale (no limit or below the limit), and several thousand bitUSD worth of cover orders that are not eating into this short wall. Is the single BUY order at 226 BTS/bitUSD blocking the other trades from happening?

All shorts have a limit below .004652 USD/BTS. It doesn't matter if that limit is above or below the feed. The bug is triggered because the margin call with the highest priority has a limit of 0.00469622149801484 which is greater than the limit of the shorts and therefore causes the shorts to be skipped.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

zerosum

  • Guest
In what world this belongs to the trading sub section?

PS
Sorry for not checking each illogical subsection before posting this  https://bitsharestalk.org/index.php/topic,15170.msg201296.html#msg201296

Offline svk

So it seems the long and, er, short of it is currently it's not possible to acquire bitUSD?

It is possible to buy bitUSD from regular sellers, but not from shorts.

It is also possible to short bitUSD at the feed price by either setting no limit or a limit above ~.0047 USD/BTS. These shorts will be eaten up immediately by the margin calls, so it is not possible to self-short.

That doesn't seem to be the case either, there's currently a short wall of 354 bitUSD for sale (no limit or below the limit), and several thousand bitUSD worth of cover orders that are not eating into this short wall. Is the single BUY order at 226 BTS/bitUSD blocking the other trades from happening?

Another picture to help the explanation:



If what you say is true, shouldn't the expired margin calls (in yellow) be matched with the short wall (first entry in blue in the SELL table)?
« Last Edit: April 11, 2015, 01:05:53 pm by svk »
Worker: dev.bitsharesblocks

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
So it seems the long and, er, short of it is currently it's not possible to acquire bitUSD?

It is possible to buy bitUSD from regular sellers, but not from shorts.

It is also possible to short bitUSD at the feed price by either setting no limit or a limit above ~.0047 USD/BTS. These shorts will be eaten up immediately by the margin calls, so it is not possible to self-short.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline Riverhead

This is a known bug: https://github.com/BitShares/bitshares/issues/1495

The problem here is that the huge volume of expired BitUSD shorts have a call price that's close to the feed price, and shorts with a limit above the call price are skipped in the order matching. Also, the engine tries to match covers before regular orders. So when the engine get to match your regular offer, the matching short will already have been skipped.

Thank you PC. That is a perfect explanation. So it seems the long and, er, short of it is currently it's not possible to acquire bitUSD?

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
This is a known bug: https://github.com/BitShares/bitshares/issues/1495

The problem here is that the huge volume of expired BitUSD shorts have a call price that's close to the feed price, and shorts with a limit above the call price are skipped in the order matching. Also, the engine tries to match covers before regular orders. So when the engine get to match your regular offer, the matching short will already have been skipped.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de