But in the process of buying the loans and packaging them up, investment banks retain some risk of loss, including accounting items like loansheldforsale, loansheldfor investment, retained interests in the securitizations themselves, and so-called warehouse loans that keep the origination engines at the small mortgage lenders humming.