In market.py, orderbook function:
asks = list(map(lambda x: Order(
Amount(x["quote"], self["quote"], bitshares_instance=self.bitshares),
Amount(x["base"], self["base"], bitshares_instance=self.bitshares),
bitshares_instance=self.bitshares
), orders["asks"]))
bids = list(map(lambda x: Order(
Amount(x["quote"], self["quote"], bitshares_instance=self.bitshares),
Amount(x["base"], self["base"], bitshares_instance=self.bitshares),
bitshares_instance=self.bitshares
), orders["bids"]))
Orders are constructed with base amount and quote amount only. This leads to wrong price when the order was partially filled.
For example, with this data:
Mon Mar 19 22:19:22 UTC 2018
{"id":1037,"jsonrpc":"2.0","result":{"base":"USD","quote":"BTS","bids":[{"price":"0.127431355173731879","quote":"2.88782","base":"0.3680"}],"asks":[{"price":"0.12743137102808178","quote":"431.10656","base":"54.9365"}]}}
The bid price returned by market.orderbook is 0.3680/2.88782 = 0.12743177, which is far from the real price returned by the API server which is 0.127431355.
In market.py, orderbook function:
Orders are constructed with base amount and quote amount only. This leads to wrong price when the order was partially filled.
For example, with this data:
The bid price returned by
market.orderbookis0.3680/2.88782 = 0.12743177, which is far from the real price returned by the API server which is0.127431355.