Risk trading, network topology and banking regulation