The work is a normative approach towards the financial stability of a society comprising banks, firms, and a central bank (research field: macroeconomics/financial stability). I propose new rules that will endogenously emerge from the analysis to decrease the financial instability of the system. This institution (the central bank) decreases the average instability of the economic system by using the newly proposed rules that regularize the interbank market connections, the interest rate, the minimum reserve factor for the banks, among others. To find and test the new proposed regulations I have implemented a dynamical model by means of a multi-agent system, where an economic model (banks and firms that interact with each other) is simulated and optimized. A statistical analysis of the results is presented. A stress test and a comparison of these results with respect to the real-life properties of interbank markets are proposed.