def roi_to_reward_rate(roi_5day, n_rebase_per_day):
    """

    APY = (1 + reward_rate)**(n_rebase_per_day * 365)
    APY**(1 / n_rebase_per_day * 365) = 1 + reward_rate
    """
    reward_rate = roi_5day**(1 / (n_rebase_per_day * 5)) - 1

    return reward_rate