def on_message(self, message):
    super(OrderBookConsole, self).on_message(message)
    bid = self.get_bid()
    bids = self.get_bids(bid)
    bid_depth = sum([b['size'] for b in bids])
    ask = self.get_ask()
    asks = self.get_asks(ask)
    ask_depth = sum([a['size'] for a in asks])
    if ((self._bid == bid) and (self._ask == ask) and (self._bid_depth == bid_depth) and (self._ask_depth == ask_depth)):
        pass
    else:
        self._bid = bid
        self._ask = ask
        self._bid_depth = bid_depth
        self._ask_depth = ask_depth
        print('{} {} bid: {:.3f} @ {:.2f}\task: {:.3f} @ {:.2f}'.format(dt.datetime.now(), self.product_id, bid_depth, bid, ask_depth, ask))
def on_message(self, message):
    super(OrderBookConsole, self).on_message(message)
    bid = self.get_bid()
    bids = self.get_bids(bid)
    bid_depth = sum([b['size'] for b in bids])
    ask = self.get_ask()
    asks = self.get_asks(ask)
    ask_depth = sum([a['size'] for a in asks])
    if ((self._bid == bid) and (self._ask == ask) and (self._bid_depth == bid_depth) and (self._ask_depth == ask_depth)):
        pass
    else:
        self._bid = bid
        self._ask = ask
        self._bid_depth = bid_depth
        self._ask_depth = ask_depth
        print('{} {} bid: {:.3f} @ {:.2f}\task: {:.3f} @ {:.2f}'.format(dt.datetime.now(), self.product_id, bid_depth, bid, ask_depth, ask))