The activity of an insurance company with a reinsurance condition system is modeled on an infinite time interval. Payment times and sums insured are random. The amount of money replenished is selected as a control parameter. The task is to minimize the average insurance payment per unit time, thus optimizing investments.Let us consider a model of an insurance company with continuous insurance premiums. Naturally, the company is interested in the maximum investment of this money. However, it should have a reserve for immediate payments. The reserve can be replenished continuously and is bounded from above by Q.Insurance claims arrive at random times, and in premium rate y n the nth claim has a distribution function F. The company has reinsurance conditions. Premium payments greater than M are not paid and are transferred to a reinsuring company. The company's resources are checked before payment, and then, depending on the result of the check x, a decision on replenishment is made. We believe that the reserve is replenished immediately by the necessary value a with probability p or is not replenished with probability ( ) 1-p (for example, when replenishment involves money that cannot be withdrawn immediately, i.e., when the company operates under the conditions of unstable market). Then premium is paid, and the system remains in this state during a period t n , which is a random variable with distribution function F( / , , ) × x y a , until a new claim arrives.We believe that all the random variables of the model are defined on a probability space ( , , ) W J P . Denote by r t x a ( / , )losses of the system that is in a state x during a period t if a decision a was made at the beginning of this period. The model accounts for the following losses: r a 1 ( )-reserve replenishment costs (i.e., the sum lost due to withdrawal of money invested), r Q R 1 0 :[ , ] ® + ; r x 2 ( ) -costs of failed premium payment x because of a lack of reserved money, r R R 2 : + + ®; r x 3 ( ) -costs of maintaining the reserve per unit time (i.e., profit lost because the reserved money have not been invested), r Q R 3 0 :[ , ] ® + ; r 4 -rate of premium payment to the reinsuring company per unit time.The functions r i , i = 1 2 3 , , , are monotonic, non-negative, and non-decreasing, r r xd Fx 2 2 0 0 0 ( ) , ( ) ( ) = < ¥ ¥ ò .