Why are emerging economies excessively vulnerable to shocks to external funding? What was the role of financial flows from emerging to developed economies in setting the stage for the subprime crisis? This paper addresses these questions in a simple general equilibrium framework that emphasizes the aggregate implications of the misallocation of funds on the micro level. The analysis shows that the misallocation of funds amplifies volatility even in a closed economy. Financial integration between relatively distorted emerging economies and relatively undistorted developed economies leads to a further divergence in volatility, thereby providing a new and simple explanation for the divergent trends in output volatility up to the recent crisis. In the integrated environment, cheap funding leads to an endogenous deterioration of the financial system in developed economies. These predictions are consistent with a wide variety of microfoundations, in which distortions cause productive projects to be relatively more sensitive to aggregate shocks. The paper provides some empirical evidence for these microfoundations.