A flow network analysis of direct balance-sheet contagion in financial networks