### ?

## Modelling the system of agents in the presence of random moments of transactions

This paper presents the approach to modelling the system of agents making transactions at random time. The two main ideas are, to obtain the agents' optimal control in the form of synthesis (feedback) and, secondly, to make the aggregate dynamics stock-flow consistent on the average, not strictly at any moment of time. We present a model of a large number of consumers and producers that take loans from the bank to buy consumption goods or investment. The moments of deals form described the Poisson flow. Consumers and producers optimally solve their stochastic optimal control problems. The solution to the OC problems are in the closed-loop form, obtained using asymptotic methods for large frequency of transactions. The optimal policy functions appear to be linear in the state variables, if time is far from the planning horizon. This enables aggregation across a large population of consumers or producers. As a result, the description of the dynamics of their aggregate state might be substituted by deterministic dynamics. The system of equations for the aggregate dynamics is reduced to one differential equation. The equation is studied numerically and the results are presented.