bitshares-core icon indicating copy to clipboard operation
bitshares-core copied to clipboard

get_ticker API base / quote / price denotation issue

Open abitmore opened this issue 5 years ago • 1 comments

Bug Description

@sschiessl-bcp mentioned in Telegram:

Did anyone ever notice (or maybe I am looking wrong now) that the get_ticker denotes quote and base wrong?

Response is e.g.

{
 "time": "2020-02-03T12:34:39",
 "base": "OPEN.BTC",
 "quote": "BTS",
 "latest": "0.0000039215685000482011",
 "lowest_ask": "0.000003905770881883969",
 "highest_bid": "0.0000035929221157085541",
 "percent_change": "11.44",
 "base_volume": "0.95764133",
 "quote_volume": "260008.45989"
}

According to the definition, a price (exchange rate) should be how much quote I need to put on the >table to get 1 unit of base.

A market BTS/BTC (base/quote) has a price defined how much BTC do I need to buy BTS, at least outside BitShares, but the ticker returns the inverse.

Fun thing is, order book call does it the other way round again

In my opinion, since the API has been (mis)behaving in that way for a long time, it might be broadly used by a lot of client applications, so it's inappropriate to just fix the (mis)behavior, instead, a better approach for us is to clearly document the (mis)behavior.

Impacts Describe which portion(s) of BitShares Core may be impacted by this bug. Please tick at least one box.

  • [x] API (the application programming interface)
  • [ ] Build (the build process or something prior to compiled code)
  • [ ] CLI (the command line wallet)
  • [ ] Deployment (the deployment process after building such as Docker, Travis, etc.)
  • [ ] DEX (the Decentralized EXchange, market engine, etc.)
  • [ ] P2P (the peer-to-peer network for transaction/block propagation)
  • [ ] Performance (system or user efficiency, etc.)
  • [ ] Protocol (the blockchain logic, consensus, validation, etc.)
  • [ ] Security (the security of system or user data, etc.)
  • [ ] UX (the User Experience)
  • [ ] Other (please add below)

CORE TEAM TASK LIST

  • [ ] Evaluate / Prioritize Bug Report
  • [ ] Refine User Stories / Requirements
  • [ ] Define Test Cases
  • [ ] Design / Develop Solution
  • [ ] Perform QA/Testing
  • [ ] Update Documentation

abitmore avatar Feb 03 '20 21:02 abitmore

my suggestion would be to follow the lead of centralized exchanges for this type of change with a new api endpoint: "v2_get_trade_history" allow 12 months for integration and announcement; then kill: "get_trade_history" Any type of abrupt change on this type of thing could cause massive losses when buy/sell orders are placed for: 1/0.00000200 instead of 0.000000200

litepresence avatar Feb 03 '20 22:02 litepresence