cryptonomex / graphene

MIT License
1.05k stars 337 forks source link

get_ticker bid and ask not corrected for precision and not correct #592

Closed svk31 closed 7 years ago

svk31 commented 8 years ago

Playing around with the new API calls I noticed the highest_bid and lowest_ask have two bugs:

  1. They're not correctly corrected for precision, unlike the latest price field.
  2. They're not up to date. You can see in the screenshot that the current lowest ask and highest bid are quite different from what get_ticker returns.

image

Everything else seems to be ok.

svk31 commented 8 years ago

Another example: image

In this one most things are wrong, actual volume was 14 EUR and 3960 BTS. There's definitely some issues with precision, and probably something to do with inversion of markets as well.

svk31 commented 8 years ago

image image

Some more observations:

Volumes don't get switched when the market is inverted, but the precisions get do get inverted. Latest price does not get inverted at all, only the precision changes.

svk31 commented 8 years ago

We're almost there, everything seems to be correct now except for the 24 hr change which is inversed. The below screens were taken at 18.45 on the 24th. The latest price was 35.9361, the last closing price at 18.45 on the 23rd was 39.5. get_ticker is returning a 24hr change of +9.92%.

The correct change should be (35.9361 - 39.5) / 39.5 = -9.02%

image

image

mvandeberg commented 8 years ago

The 24 hr change displayed on the web is not using the get_ticker call. From the same market, get_ticker returned the correct 24hr change.

ticker

mvandeberg commented 8 years ago

Patch has already been merged into Bitshares,

mvandeberg commented 8 years ago

@theoreticalbts This branch is ready for review to be merged.

abitmore commented 8 years ago

Just a note, the branch https://github.com/cryptonomex/graphene/compare/592-get_ticker contains new commits which will fix a witness crash issue, and need to be reviewed and merged (if haven't done already).

svk31 commented 8 years ago

@abitmore @mvandeberg was that fix from 592-get_ticker ever merged into master?

abitmore commented 8 years ago

It's merged into develop branch: https://github.com/cryptonomex/graphene/commit/2fb3cb107840efe75235d69c07b942970b048b28, but not yet merged into bitshares branch, see https://github.com/bitshares/bitshares-2/compare/bitshares...cryptonomex:develop

vikramrajkumar commented 7 years ago

This issue was moved to bitshares/bitshares-core#178