Author Topic: Market order matching bug?  (Read 1501 times)

0 Members and 1 Guest are viewing this topic.

Offline clayop

  • Hero Member
  • *****
  • Posts: 2033
    • View Profile
    • Bitshares Korea
  • BitShares: clayop
Market order matching bug?
« on: October 20, 2015, 11:19:21 pm »


Curious of this...
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop

Xeldal

  • Guest
Re: Market order matching bug?
« Reply #1 on: October 20, 2015, 11:28:43 pm »


Curious of this...

Hmm I'm not showing the yellow orders at all.


Offline liondani

  • Hero Member
  • *****
  • Posts: 3731
  • Inch by inch, play by play
    • View Profile
    • My detailed info
  • BitShares: liondani
  • GitHub: liondani
Re: Market order matching bug?
« Reply #2 on: October 20, 2015, 11:33:39 pm »
if you refresh your browser are you still seeing it?

Offline clayop

  • Hero Member
  • *****
  • Posts: 2033
    • View Profile
    • Bitshares Korea
  • BitShares: clayop
Re: Market order matching bug?
« Reply #3 on: October 20, 2015, 11:38:40 pm »
Oh its gone... Maybe a display bug
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop

Offline alt

  • Hero Member
  • *****
  • Posts: 2806
    • View Profile
  • BitShares: baozi
Re: Market order matching bug?
« Reply #4 on: October 20, 2015, 11:43:37 pm »
it's not a market engine bug or display bug, it's the rule how it works
https://bitsharestalk.org/index.php/topic,19102.0.html

Xeldal

  • Guest
Re: Market order matching bug?
« Reply #5 on: October 20, 2015, 11:49:26 pm »
Oh its gone... Maybe a display bug

I think its just slow to respond.  I've placed an order and its taken several minutes to display, and another couple minutes to show that its been filled.

I hope its a bug and not proper operation.

it's not a market engine bug or display bug, it's the rule how it works
https://bitsharestalk.org/index.php/topic,19102.0.html

Are you saying the BID and ASK are not supposed to match and fill?  That doesn't seem right. 

Offline alt

  • Hero Member
  • *****
  • Posts: 2806
    • View Profile
  • BitShares: baozi
Re: Market order matching bug?
« Reply #6 on: October 21, 2015, 12:02:13 am »
Oh its gone... Maybe a display bug

I think its just slow to respond.  I've placed an order and its taken several minutes to display, and another couple minutes to show that its been filled.

I hope its a bug and not proper operation.

it's not a market engine bug or display bug, it's the rule how it works
https://bitsharestalk.org/index.php/topic,19102.0.html

Are you saying the BID and ASK are not supposed to match and fill?  That doesn't seem right.
no, look at the draft by BM, the margin call will occur only when highest bid is less than call price and greater than SQP.
it's not match because the bid price is greater than call price
https://bitsharestalk.org/index.php/topic,19102.0.html

Xeldal

  • Guest
Re: Market order matching bug?
« Reply #7 on: October 21, 2015, 12:17:56 am »
Oh its gone... Maybe a display bug

I think its just slow to respond.  I've placed an order and its taken several minutes to display, and another couple minutes to show that its been filled.

I hope its a bug and not proper operation.

it's not a market engine bug or display bug, it's the rule how it works
https://bitsharestalk.org/index.php/topic,19102.0.html

Are you saying the BID and ASK are not supposed to match and fill?  That doesn't seem right.
no, look at the draft by BM, the margin call will occur only when highest bid is less than call price and greater than SQP.
it's not match because the bid price is greater than call price
https://bitsharestalk.org/index.php/topic,19102.0.html

Its difficult to explain using BM example because the market is flipped but heres my attempt.
Correct me if I'm wrong.   

The yellow price indicates an order that is being margin called, it is limited by the SQP or 10% below the feed.

The only way this order would even be displayed is if the highest bid was below the orders Call price.   And there were no orders to match above the SQP.

It would be filled with any Bid above the SQP. 

In the above picture there is a Bid at (1/265) that should fill the yellow order.  And i believe that is what happened but the display was delayed.

Offline alt

  • Hero Member
  • *****
  • Posts: 2806
    • View Profile
  • BitShares: baozi
Re: Market order matching bug?
« Reply #8 on: October 21, 2015, 12:23:43 am »
bid(margin call) price is 269.74391
ask price is 265
it doesn't fill because the call price is greater than 265, for an example, it's 268.
if you want to fill it, you can give a bid order at price 265, this will fill the ask order.
then you give a ask order at price 269.74391(between 268 and 269.74391), this will fill the margin call order

Xeldal

  • Guest
Re: Market order matching bug?
« Reply #9 on: October 21, 2015, 12:41:07 am »
bid(margin call) price is 269.74391
ask price is 265
it doesn't fill because the call price is greater than 265, for an example, it's 268.
if you want to fill it, you can give a bid order at price 265, this will fill the ask order.
then you give a ask order at price 269.74391(between 268 and 269.74391), this will fill the margin call order

I don't think you can know what the call price is(unless you own the order).  As each order will have a different call price and it won't change.
Because the order is yellow and on the book you can assume the highest bid is less than than this orders call price.
The yellow order is the SQP price, or 10% below the feed.

So Flipping it over, lets look at the same order:
margin call price is somewhere above the highest BID of .00377
The ASK (SQP margin call order) is 10% below the feed or .0037 (yellow)
The highest bid is .00377 which is above the SQP and so the Margin Call should execute.

If the highest BID were higher, say .004 the yellow (SQP margin call order) would disappear off the book, if this BID were higher than the orders Call price, whatever it is.

Edit: I'm confusing myself here, so I may have something backward or wrong, but I think the above is right.  I need to think of a better example maybe.
« Last Edit: October 21, 2015, 12:47:04 am by Xeldal »

Xeldal

  • Guest
Re: Market order matching bug?
« Reply #10 on: October 21, 2015, 10:40:49 am »
This bring up another question for me.

Given:
Call price: .004
Highest BID: .0038
Feed Price: .0044
SQP(-10% Feed): .0039

So you have (blue)BID: .0038 || .0039 ASK (yellow)

The yellow margin call order is on the book because the highest BID is below the order Call Price

If a new BID were put on the book at .006 ( clearly above the orders Call Price).  Would the Margin Call order be filled or would it get pulled from the book because the highest Bid was now above the Call Price.

Basically, what comes first in order matching.  Calculating and placing\removing Margin Call orders or Filling existing orders(including Margin Call orders).

I would assume because we are no longer using the "get what you order" system like in BTS1 it would essentially be a limit order and fill at the best available price, which is still below the Call Price and so the Margin Call order would in fact be filled, regardless of how high this new BID was placed. 

Offline svk

Re: Market order matching bug?
« Reply #11 on: October 21, 2015, 09:12:49 pm »
Yea this seems to be a "feature" of the market engine, I've made posts about it in several other threads as well, look through my post history for that.

I do not like to think of the market in USD/BTS terms, my examples assume a call is a buy order looking to buy USD.

What is displayed in the GUI in yellow are all current margin called orders. The line called Call limit is the call price of the least collateralized position currently being margin called. (Yes we know the call price of all margin positions)

Call orders will only execute in the range between that call limit and the margin call price.

If there are sell orders below that range, the margin orders won't execute at all, so you get a negative spread.

Crazy imo but as far as I can tell that's how it works.

I do not pull margin orders from the books just because there are sells below their range, that seems unfair to me, you should see that there are orders being margin called so you can sell to them.

Worker: dev.bitsharesblocks

Xeldal

  • Guest
Re: Market order matching bug?
« Reply #12 on: October 21, 2015, 09:31:31 pm »
Yea this seems to be a "feature" of the market engine, I've made posts about it in several other threads as well, look through my post history for that.

I do not like to think of the market in USD/BTS terms, my examples assume a call is a buy order looking to buy USD.

What is displayed in the GUI in yellow are all current margin called orders. The line called Call limit is the call price of the least collateralized position currently being margin called. (Yes we know the call price of all margin positions)

Call orders will only execute in the range between that call limit and the margin call price.

If there are sell orders below that range, the margin orders won't execute at all, so you get a negative spread.

Crazy imo but as far as I can tell that's how it works.

I do not pull margin orders from the books just because there are sells below their range, that seems unfair to me, you should see that there are orders being margin called so you can sell to them.

Thanks for the explanation.  I think I've read nearly every explanation so far from various people.  I still don't quite get it.
I think I'm close, I've just got something backwards somewhere and I can't let it go,its blocking the full picture.  : )
I'd like to get it though, so I don't continue to spread wrong info. 

Having the orders not matching like that is really bad though, (even if thats proper function) and gives a really bad image.  I don't think generally people are going to understand this.

Offline botfund

  • Full Member
  • ***
  • Posts: 174
    • View Profile
  • BitShares: botfund
Re: Market order matching bug?
« Reply #13 on: October 21, 2015, 11:14:28 pm »
The current rule makes the order book look silly and I think this should be changed to something like:

A margin call will occur any time the highest bid is greater than SQP and CALL PRICE is greater than SQP.

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Re: Market order matching bug?
« Reply #14 on: October 21, 2015, 11:31:26 pm »
The current rule makes the order book look silly and I think this should be changed to something like:

A margin call will occur any time the highest bid is greater than SQP and CALL PRICE is greater than SQP.

This doesn't capture the fact that the highest bid has to be lower than the call price.

I think the rule is fine, just the way the GUI displays it should be changed. Just don't show yellow orders (margin calls) unless the highest bid is less than the SQP. Then display all margin calls as an order at the SQP. That actually reflects what is happening.
maintains an Ubuntu PPA: https://launchpad.net/~showard314/+archive/ubuntu/bitshares [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true