The article is devoted to the stochastic modelling of optimal links between the shadow and legal economies using Wiener and Poisson processes. The study focuses on identifying the best management strategies that will help reduce the size of the shadow economy. The paper first considers a deterministic economic and mathematical model of the relationship between the shadow and legal economies, which is presented in the form of differential equations with initial conditions. These differential equations describe the rate of change of real sector workers' savings, the dynamics of owners' savings, the rate of change of the price of aggregate output, etc. The assumptions about the dynamics of cash savings and the price of aggregate output are supplemented by initial conditions. Restrictions on the consumer shares of savings used for consumption of legal and shadow products for employees and entrepreneurs are formed. To build an optimal process, the author formalizes an objective function (objective criterion) that maximizes the average total (integral) savings of employees and entrepreneurs over a certain period of time and uses stochastic sufficient conditions for optimality, where the controls are the shares of savings used to purchase aggregate products of the legal and shadow economies of employees and business owners, and the phase trajectories are the monetary savings of employees and business owners of legal and shadow economies, the price of a unit of aggregate products, and the price of a unit of aggregate products. Thus, the main idea of the process of solving the optimal management problem takes into account both the management process itself (strategies, management methods) and the paths along which the system moves from the initial state to the final result (phase trajectories). The structure of the optimal process of the proposed stochastic model is described. It is established that the optimal controls are deterministic values and do not depend on the coefficients of the Wiener processes in the proposed stochastic dynamic model. It is also worth noting that the specific formulation of this problem of optimal control of the interaction between the shadow and legal economies depends on the context of the study and may vary depending on the tasks and assumptions set.