We develop a general policy analysis framework that features nominal rigidities and financial frictions with endogenous PPP and UIP deviations. The goal of the optimal policy is to balance output gap stabilization and international risk sharing using a mix of monetary policy and FX interventions. The nominal exchange rate plays a dual role. First, it allows for the real exchange rate adjustments when prices are sticky, which are necessary to close the output gap. Monetary policy can eliminate the output gap, but this generally requires a volatile nominal exchange rate. Volatility in the nominal exchange rate, in turn, limits the extent of international risk sharing in the financial market with risk averse intermediaries. Optimal monetary policy closes the output gap, while optimal FX interventions eliminate UIP deviations. When the first-best real exchange rate is stable, both goals can be achieved by a fixed exchange rate policy – an open-economy divine coincidence. Generally, this is not the case, and the optimal policy requires a managed peg by means of a combination of monetary policy and FX interventions, without requiring the use of capital controls. We explore various constrained optimal policies, when either monetary policy or FX interventions are restricted, and characterize the possibility of central bank’s income gains and losses from FX interventions.