We propose a discrete time probabilistic model of depositor behavior which takes into account the information flow among depositors. In each time period each depositors' current state is determined in a stochastic way, based on its previous state, the state of other connected depositors and the strategy of the bank. The bank offers payment to impatient depositors who accept or decline them with certain probability, depending on the offered amount. The connections between depositors affect the evolution of the state trajectory as well: the more other connected depositors demand money from the bank, the larger is the probability that the depositor turns also impatient. Our principal aim is to see how are the optimal offers of the bank if it wants to keep the expected chance of a bank run under a certain level and minimize its expected payments, while taking into account the connection structure of the depositors. We show that in the case of the proposed model this question results in a nonlinear optimization problem with nonlinear constraints, and that the method is capable of accounting for time-varying resource limits of the bank. Optimal offers increase a) in the degree of the depositor; b) in the probability of being hit by a liquidity shock, and c) the effect of a neighboring impatient depositor.