I analyse the dynamics of a New Keynesian DSGE model where the financing of investments is affected by a moral hazard problem. I solve for jointly Ramsey-optimal monetary and macroprudential policies. I find that when a financial friction is present in addition to the standard nominal friction,...