def lookup(pair, date, cache):
    """
    query cache: if answer not existing, return None.
    """
    price = None
    prices = cache.get(pair, None)
    if prices:
        price = prices.get(date, None)
    return price