In the presence of uninsurable idiosyncratic risk, the optimal credit contract allows for the possibility of default. In addition, the optimal contract incorporates a precautionary savings motive over and above what agents would otherwise save. When default is sufficiently high, credit markets...