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

blockchain_market_* api calls are way too complicated

Open pmconrad opened this issue 10 years ago • 2 comments

It is almost impossible to extract a simple order book for a given market using RPC API calls. Where "simple" means an ordered list of currently executable bid/ask offers, each with volume and price.

Currently, various API calls exist for retrieving partial order books etc., which can be combined into a "simple" orderbook by applying complicated (and mostly undocumented, and changing) market logic. Examples:

  • blockchain_market_order_book doesn't include shorts.
  • not all shorts are executable at all times, they depend on the feed price.
  • not all cover orders are executable at all times, they depend on the feed price and on their expiration time.

Things will get even more complicated with the upcoming relative order types.

pmconrad avatar Jan 21 '15 21:01 pmconrad

I agree. @valzav What are all the commands you use to construct the order book shown in the frontend?

vikramrajkumar avatar Jan 21 '15 21:01 vikramrajkumar

He does it the same way I do: by avoiding the use of blockchain_market_order_book :)

We both pull the individual orders using list_asks, list_bids, list_shorts and list_covers and then construct the order book ourselves.

svk31 avatar Jan 22 '15 16:01 svk31