Using a bilateral approach, we document a loan portfolio swap for lending management. This swap provides insurance against credit-related losses through diversification. We find that the bank’s optimal non-swap-performing (swap-performing) loan rate is negatively (positively) related to its credit improvement, to its counterparty’s credit deterioration, to the capital-to-deposits ratio, and to the deposit insurance premium under strategic substitutes if the bank is sufficiently powerful in the two loan markets. The most obvious application of our result is to the theory of how a bank should select a lending portfolio to compete. The strategic effect on one lending market in another market must be considered. Our findings provide alternative explanations for loan portfolio swap transactions concerning bank loan-rate-setting behavior and regulation.