Starting from the agent-based decentralized matching macroeconomic model proposed in Riccetti et al. (2012), we explore the effects of banking regulation on macroeconomic dynamics. In particular, we study the overall credit exposure and the lending concentration towards a single counterparty, finding that the portfolio composition seems to be more relevant than the overall exposure for banking stability, even if both features are very important. We show that a too tight regulation is dangerous because it reduces credit availability. Instead, on one hand, too loose constraints could help banks to make money and to increase their net worth, thus making the constraints not binding. However, on the other hand, if bank profits are tied to higher payout ratio (as it really happened along the deregulation phase of the last 20 years), then the financial fragility increases causing a weaker economic environment (e.g., higher mean unemployment rate), a more volatile business cycle, and a higher probability of triggering financial crises. Accordingly, simulation results support the introduction of the Capital Conservation Buffer (Basel 3 reform).