Banks should evaluate whether a borrower is likely to default. The author applies several techniques in the extensive mathematical literature of stochastic optimal control/dynamic programming to derive an optimal debt in an environment where there are risks on both the asset and liabilities...