@classmethod
def parse_l2_depth(cls, instmt, raw):
    """
        Parse raw data to L2 depth
        :param instmt: Instrument
        :param raw: Raw data in JSON
        """
    l2_depth = instmt.get_l2_depth()
    keys = list(raw.keys())
    if cls.get_order_book_timestamp_field_name(
        ) in keys and cls.get_bids_field_name(
        ) in keys and cls.get_asks_field_name() in keys:
        timestamp = raw[cls.get_order_book_timestamp_field_name()]
        timestamp = timestamp.replace('T', ' ').replace('Z', '').replace('-',
            '')
        l2_depth.date_time = timestamp
        bids = raw[cls.get_bids_field_name()]
        bids = sorted(bids, key=lambda x: x[0], reverse=True)
        for i in range(0, len(bids)):
            l2_depth.bids[i].price = float(bids[i][0]) if type(bids[i][0]
                ) != float else bids[i][0]
            l2_depth.bids[i].volume = float(bids[i][1]) if type(bids[i][1]
                ) != float else bids[i][1]
        asks = raw[cls.get_asks_field_name()]
        asks = sorted(asks, key=lambda x: x[0])
        for i in range(0, len(asks)):
            l2_depth.asks[i].price = float(asks[i][0]) if type(asks[i][0]
                ) != float else asks[i][0]
            l2_depth.asks[i].volume = float(asks[i][1]) if type(asks[i][1]
                ) != float else asks[i][1]
    else:
        raise Exception(
            'Does not contain order book keys in instmt %s-%s.\nOriginal:\n%s'
             % (instmt.get_exchange_name(), instmt.get_instmt_name(), raw))
    return l2_depth
