factored out get_rate_for_date