We study the optimal design of a fiscal union within a currency union using an open economy model with nominal rigidities. We show that the optimal design of a fiscal union depends crucially on the degree of financial integration across countries as well as the elasticity of substitution between domestic and foreign goods. Empirical estimates of substitutability range between 1 and 12. If substitutability is low (around 1), risk-sharing occurs naturally via terms of trade movements even in financial autarky, country-level monopoly power is high and losses from terms of trade externalities dominate other distortions. On the other hand, if substitutability is high (greater than 1), risk-sharing does not occur naturally via terms of trade movements, country-level monopoly power is low and losses from nominal rigidities dominate other distortions. We show that members of a fiscal union should (1) coordinate labor and consumption taxes when substitutability is low to eliminate terms of trade distortions, and (2) coordinate contingent cross-country transfers when substitutability is high to improve risk-sharing, particularly when union members lose access to international financial markets. Contingent fiscal policy at the national level is also necessary to eliminate nominal rigidities in the presence of asymmetric shocks, and yields large welfare gains when goods are close substitutes.