In this paper, we show that there exists an optimal investment policy for the surplus in a risk model, in which the surplus is continuously invested to other business at a constant rate a > 0, whenever the level of the surplus exceeds a given threshold V > 0. We assign, to the risk model, two costs, the penalty per unit time while the level of the surplus being under V > 0 and the opportunity cost per unit time by keeping a unit amount of the surplus. After calculating the long-run average cost per unit time, we show that there exists an optimal investment rate a * > 0 which minimizes the long-run average cost per unit time, when the claim amount follows an exponential distribution.