This paper presents a model of an over-the-counter bond market in which bond dealers and cash investors arrange repurchase agreements (repos) endogenously. If cash investors buy bonds to store their cash, then they suffer an endogenous bond-liquidation cost because they must sell their bonds before the scheduled times of their cash payments. This cost provides incentive for both dealers and cash investors to arrange repos with endogenous margins. As part of multiple equilibria, the bond-liquidation cost also gives rise to another equilibrium in which cash investors stop transacting with dealers all at once. Credit market interventions block this equilibrium.