We study the time-varying demand for dollar-denominated bonds in a New Keynesian model of the global economy with heterogeneity in risk-bearing capacity and incomplete markets. A flight to dollar bonds generates a dollar appreciation and global recession. Dollar bonds thus command a negative risk premium and relatively risk tolerant agents borrow in dollars. Quantitatively, the model can rationalize properties of the dollar carry trade, the valuation channel in U.S. external adjustment, and the asymmetric risk premium effects of monetary shocks originating in the U.S. versus abroad. We use the model to quantify the global stimulus from dollar swap lines in recent crises.