BitShares Forum

Main => Technical Support => Topic started by: jz831 on April 27, 2016, 04:57:52 am

Title: Orders not getting fulfilled/executed via BitShares2-light.app
Post by: jz831 on April 27, 2016, 04:57:52 am
I've had this happen several times now, where I place an order to buy an asset, and the order gets broadcast & transmitted, and i see it on the market, but it never executes.  I just tried it via the web client (using a different account), and it worked just fine.  I am running the latest BitShares2-light.app (for OSX) available, Version 2.0.160406

I can't figure out what it happening - any clue?  :-\

eg: check out open.lisk asset http://cryptofresh.com/a/OPEN.LISK (http://cryptofresh.com/a/OPEN.LISK) - there are matching orders there, currently a bid for 325 BTS for 19.07 units for a total of: 6,197 BTS, and an ask for 325 BTS 11.76 units, total of 3,821, and the orders don't execute, never get fulfilled - can someone explain this behavior, and/or how to work around it?


Well, after testing some more, it seems this issue can be resolved if the market is inverted (selling/buying BTS, instead of the asset in question, i.e. orders made on the BTS:OPEN.LISK market work as expected, but orders placed on the OPEN.LISK:BTS market stall) - at least that's what seems to be happening.
Title: Re: Orders not getting fulfilled/executed via BitShares2-light.app
Post by: xeroc on April 27, 2016, 06:50:16 am
That usually happens when prices are off by a satoshi.
It's not an issue of the exchange but of Javascript that can't represent prices accurately
Title: Re: Orders not getting fulfilled/executed via BitShares2-light.app
Post by: jz831 on April 27, 2016, 02:25:33 pm
I can see why that would happen, were the prices off by an amount (a satoshi, or fraction of a BTS) - but when I submit these stalled orders, I click on the Ask (or Bid) to make the purchase (or sale), as I have done any number of other times and have had it work correctly.   My above example isn't ideal, as the order went threw after more testing (once i inverted the market) - however, here's another current example, in the MOONFUND asset market (http://cryptofresh.com/a/MOONFUND (http://cryptofresh.com/a/MOONFUND)):

Bid = Price: 0.68 BTS amount: 3,821 total: 2,599
Ask = Price 0.68 BTS amount: 3,821 total: 2,599

These prices, amounts and totals match verbatim, but the order remains stalled, and unexecuted.  The depth chart matches and touches, yet the order never gets made.  Puzzling, no?
Title: Re: Orders not getting fulfilled/executed via BitShares2-light.app
Post by: svk on April 27, 2016, 06:45:26 pm
Like @xeroc says we've had some issues with Javascript floating point math, but I believe that's been fixed and this is actually different, good find!

I checked the actual orders and they're actually not matching if you go beyond 8 decimals (1 satoshi), but that's something that should happen in the matching engine in my opinion.

The bid is at 1.4705882351582962 MOONFUND/BTS
The ask is at 1.4705882352500002 MOONFUND/BTS

The actual prices are represented as integers:

Code: [Select]
{
  base: {
    amount: 3821415632
    asset_id: "1.3.432"
  },
  quote: {
    amount: 259856263
    asset_id: "1.3.0"
  }
}

And:

Code: [Select]
{
  base: {
    amount: 2000000000
    asset_id: "1.3.0"
  },
  quote: {
    amount: 29411764705
    asset_id: "1.3.432"
  }
}

@abit How hard would it be to force orders that match at the satoshi level to be matched by the witness_node?
Title: Re: Orders not getting fulfilled/executed via BitShares2-light.app
Post by: jz831 on April 27, 2016, 09:44:05 pm
Ahh interesting.  The devil's in the details! In this case, details are beyond 8 9 decimal places it would seem... silly computers  :D
Title: Re: Orders not getting fulfilled/executed via BitShares2-light.app
Post by: pc on April 28, 2016, 03:34:52 pm

I checked the actual orders and they're actually not matching if you go beyond 8 decimals (1 satoshi), but that's something that should happen in the matching engine in my opinion.


Not matching is the correct behaviour, IMO, because if you trade more than 1 unit the sub-satoshi price difference might make more than 1 satoshi absolute difference.

Edit: Hint: if you create an order with the intent of matching an existing order you can use a slightly worse (for yourself) price. The order will always be filled at the price of the existing order.
Title: Re: Orders not getting fulfilled/executed via BitShares2-light.app
Post by: jz831 on April 28, 2016, 08:58:33 pm
Not matching is the correct behaviour, IMO, because if you trade more than 1 unit the sub-satoshi price difference might make more than 1 satoshi absolute difference.

Edit: Hint: if you create an order with the intent of matching an existing order you can use a slightly worse (for yourself) price. The order will always be filled at the price of the existing order.

Coming from a user experience view, what's suggested here, is a platform which, at times, does not function properly (unless the fractional math behind the scenes gets fixed).  As a user, if I click on an Ask or Bid in the UI, with the intent to have the client make the transaction, when i fund the order, I expect it to actually execute (in fact, everything that is easily visible to the user means being confounded by why the intended trade never happens - this seems like a less than ideal implementation).  What I don't expect is having to manually over/under bid an Ask or Bid, to execute the transaction.