The paper considers the problem of designing an allocation rule which tells a decision-maker at any (discrete) time instant t=0,1,2,... how much of his current budget is to be used for funding each of the projects available at t. The number and profit rates of the projects are random, change over time, and arbitrary dependencies are permitted. The budget at any time is given by a certain percentage of the output of the investments made in the preceding period. It is shown that maximizing a logarithmic utility function at each stage leads to an asymptotically optimal outcome sequence. The meaning of optimality in this context is made clear by describing the long-run properties of the suggested allocation rule.