US financial institutions are subject to accounting rules and leverage regulations that require an agent to record the gross assets of a repo trade on its balance-sheet while placing an upper bound on total assets, which limits the volume of repo trades. Our smart contract increases the attainable volume of repo trades without compromising financial stability. It novates and replaces repo contracts with an arrangement wherein intermediaries become guarantors of contracts between ultimate repo borrowers and lenders, without materially altering payoffs. Transforming an agent from principal to guarantor reduces the balance-sheet impact of a repo trade, thereby increasing the volume of repo the agent can intermediate. In contrast to current proposals to increase repo volume, our solution does not require a loosening of financial regulation or a restructuring of the repo market. It preserves transaction privacy while enabling regulators to timely audit information. More generally, we demonstrate that when financial objects are appended to programmable electronic ledgers it is possible to combine decentralized markets and privacy with informed regulatory oversight.