How Markets Fail: The Logic of Economic Calamities