bitshares1-core
bitshares1-core copied to clipboard
blockchain_market_* api calls are way too complicated
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.
I agree. @valzav What are all the commands you use to construct the order book shown in the frontend?
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.