We show how a stability pact based on deficit sanctions eliminates the exacerbation of debt accumulation that may arise from monetary unification. Moreover, by making sanctions contingent upon the economic situation of countries, the stability pact provides for risk sharing. Differences in initial debt levels, however, reduce the scope for unanimous support for a pact. We introduce also endogenous fiscal discipline whose unobservability leads to moral hazard in its provision. If countries are ex ante identical, it is nevertheless optimal to make sanctions at least to some extent contingent on countries economic situation. However, with cross-country differences in the costs of providing discipline, some countries may oppose such contingency.