def make_book(orders, isBidBook):
        book = {}
        for o in orders:
            if o['give_asset'] == base_asset:
                if base_asset == config.BTC and o['give_quantity'] <= config.ORDER_BTC_DUST_LIMIT_CUTOFF:
                    continue  # filter dust orders, if necessary

                give_quantity = blockchain.normalize_quantity(o['give_quantity'], base_asset_info['divisible'])
                get_quantity = blockchain.normalize_quantity(o['get_quantity'], quote_asset_info['divisible'])
                unit_price = float((D(get_quantity) / D(give_quantity)))
                remaining = blockchain.normalize_quantity(o['give_remaining'], base_asset_info['divisible'])
            else:
                if quote_asset == config.BTC and o['give_quantity'] <= config.ORDER_BTC_DUST_LIMIT_CUTOFF:
                    continue  # filter dust orders, if necessary

                give_quantity = blockchain.normalize_quantity(o['give_quantity'], quote_asset_info['divisible'])
                get_quantity = blockchain.normalize_quantity(o['get_quantity'], base_asset_info['divisible'])
                unit_price = float((D(give_quantity) / D(get_quantity)))
                remaining = blockchain.normalize_quantity(o['get_remaining'], base_asset_info['divisible'])
            id = "%s_%s_%s" % (base_asset, quote_asset, unit_price)
            #^ key = {base}_{bid}_{unit_price}, values ref entries in book
            book.setdefault(id, {'unit_price': unit_price, 'quantity': 0, 'count': 0})
            book[id]['quantity'] += remaining  # base quantity outstanding
            book[id]['count'] += 1  # num orders at this price level
        book = sorted(iter(book.values()), key=operator.itemgetter('unit_price'), reverse=isBidBook)
        #^ convert to list and sort -- bid book = descending, ask book = ascending
        return book