Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: The market engine is not matching shorts properly  (Read 1141 times)

0 Members and 1 Guest are viewing this topic.

Offline biophil

  • Hero Member
  • *****
  • Posts: 814
  • Incentives run the world
    • View Profile
    • Sign up for a Bitshares account!
  • BTS: zebulon
The market engine is not matching shorts properly
« on: April 10, 2015, 10:35:01 PM »

Right now, there are bids for BitUSD above the feed price. The feed price is about 211, the highest bid is 225. To test the market, I shorted BitUSD with 1000 BTS of collateral, and was able to borrow 2.3637 BitUSD. Now in my margin order it says I have about 1500 BTS, which means the proceeds of my short order were about 500 BTS. THAT IS THE WRONG AMOUNT!! I should have been matched with the highest bid and gotten the 225 price, but as you can calculate (500/2.3637), I only got the 211 price. I'm guessing I matched one of the many expired shorts.

I know the devs aren't allowed to talk to us anymore or some such insane bullshit, but is there anybody out there who knows how to get a fix for this in the pipeline? Thanks.

Offline bytemaster

Re: The market engine is not matching shorts properly
« Reply #1 on: April 10, 2015, 10:49:40 PM »
There are a ton of market order fixes that have been heavily tested in the current DEV shares release.   Those fixes will migrate to BTS soon.   

In the mean time we have the issue that the expired orders are not being properly displayed in the GUI and the LIMIT prices are not properly included.   bitsharesblocks.com seems to do it properly.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline Riverhead

Re: The market engine is not matching shorts properly
« Reply #2 on: April 11, 2015, 12:41:05 AM »

Is that what's happening here? Those shorts aren't really there? My bot is very low on bitUSD can I can't seem to buy more.

Code: [Select]
     BIDS (* Short, + Relative, - Relative Limit)                            |                                   ASKS                                 
TOTAL                     QUANTITY                                     PRICE | PRICE                                        QUANTITY                     TOTAL   COLLATERAL
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.1250 USD                250.00000 BTS                   0.004500000000 USD*| 0.004444344444 USD                  132,000.00000 BTS              586.6534 USD
444.4444 USD              100,000.00000 BTS               0.004444444444 USD*| 0.004651162791 USD                   10,750.00000 BTS               50.0000 USD

Offline toast

Re: The market engine is not matching shorts properly
« Reply #3 on: April 11, 2015, 03:09:59 AM »
Not only are shorts not getting matched, normal sells that match only fill one order but keep the other on the book!
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline svk

Re: The market engine is not matching shorts properly
« Reply #4 on: April 11, 2015, 06:45:57 AM »
At the moment we seem to have simple buy orders not getting matched with shorts either, see the screenshot below for the current state in my wallet:

Worker: dev.bitsharesblocks

Offline pc

  • Hero Member
  • *****
  • Posts: 1194
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: The market engine is not matching shorts properly
« Reply #5 on: April 11, 2015, 07:29:34 AM »
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.
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline Riverhead

Re: The market engine is not matching shorts properly
« Reply #6 on: April 11, 2015, 10:52:11 AM »
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: 1194
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: The market engine is not matching shorts properly
« Reply #7 on: April 11, 2015, 12:56:26 PM »
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.
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline svk

Re: The market engine is not matching shorts properly
« Reply #8 on: April 11, 2015, 01:02:23 PM »
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

zerosum

  • Guest
Re: The market engine is not matching shorts properly
« Reply #9 on: April 11, 2015, 01:36:06 PM »
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 pc

  • Hero Member
  • *****
  • Posts: 1194
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: The market engine is not matching shorts properly
« Reply #10 on: April 11, 2015, 03:02:12 PM »
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.
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BTS: arhag
  • GitHub: arhag
Re: The market engine is not matching shorts properly
« Reply #11 on: April 11, 2015, 09:10:29 PM »


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 svk

Re: The market engine is not matching shorts properly
« Reply #12 on: April 11, 2015, 09:50:12 PM »




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
  • BTS: arhag
  • GitHub: arhag
Re: The market engine is not matching shorts properly
« Reply #13 on: April 11, 2015, 09:55:11 PM »
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

Re: The market engine is not matching shorts properly
« Reply #14 on: April 12, 2015, 08:20:40 AM »
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

 

Google+