I build a dynamic model of the shadow banking system that intermediates funds through the interbank repo market to understand its efficiency and stability. The model emphasizes a key friction: the maturity mismatch between the short-term repo and the long-term investment that banks need to finance. The haircut, interest rate, default rate of the repo contract and liquidity hoarding of banks are all determined endogenously in the equilibrium with repo rollover. And default is contagious. When collateral risk increases unexpectedly, the haircut and interest rate overshoot, triggering massive initial default and persistently hiking default rate and depressed investment.