Liquidity Shocks, Systemic Risk, and Market Collapse: Theory and Application to the Market for Perps *