Financial stability in networks of financial institutions and market infrastructures