Usually, the No. 1 risk for a bank is credit quality on the loans it originates. But in the banking crisis earlier this year, credit was not the problem. Rather, banks got into trouble because they invested their excess deposits into bonds right before interest rates rose.

Bond yields and bond values have an inverse relationship, so as yields rose bond values got crushed. As deposits began to leave the banking system, a few banks found themselves in the uncomfortable position of having to sell bonds while they were trading at a loss to cover deposit outflows. This dynamic ultimately led to the downfall of a few banks earlier this year.

Banks saw the unrealized losses in their bond portfolios decline in the first quarter of the year. Will they do so again when banks report second-quarter earnings this month? Let's take a look.

A bumpy road for banks

Banks are largely in the business of lending but following the height of the pandemic, most banks found themselves in an odd situation. They were drowning in deposits but had nowhere to deploy the liquidity. Interest rates were ultra-low and many in 2021 did not expect inflation to come on as strong as it did or for the Federal Reserve to have to raise interest rates as fast and as aggressively as it did.

A person sits at a desk looking at computer screens with financial charts on them

Image source: Getty Images.

So banks deployed excess liquidity into longer-duration bonds that had a higher yield to maturity at a time when interest rates were practically zero. The two types of bonds that banks typically invest in are U.S. Treasury bills and mortgage-backed securities (MBS), most of which are guaranteed by the government and therefore safe from a credit perspective. Banks can then classify these bonds as available for sale (AFS), meaning the bank intends to sell them prior to maturity, or held to maturity (HTM), meaning the bank intends to hold the bonds until they mature.

Banks' decision to do this turned out to be very poor in hindsight because while Treasury bills and MBS have very little credit risk, they do have duration risk. Essentially, they lose value as similar bonds with higher yields are printed. This pushed most bank bond portfolios underwater and investors got very nervous about banks that had too many unrealized losses, especially with deposit competition and pricing ramping up. As a reminder, bond portfolio losses are just paper losses. As long as the bank can hold the bond until maturity or until interest rates stabilize, the losses will be recouped. But if a bank has to sell bonds while they trade at a loss to cover deposit outflows, that's when it can get into some serious trouble because the losses destroy shareholder equity.

After banks like SVB Financial's Silicon Valley Bank failed due to this dynamic and the banking crisis began, bond yields actually went lower because people assumed a recession and potential rate cuts were coming. This actually helped bank bond portfolios in the first quarter. Total AFS and HTM unrealized bond losses in Q1 came in at $516 billion, which is down $109 billion from the end of 2022.

In second-quarter earnings results, investors will get an update on how bond portfolios are doing because banks mark these to market each quarter, although only unrealized AFS losses are incorporated into a bank's equity calculation. While we don't know what the exact numbers are, we know that Treasury and MBS bond portfolios are inversely impacted by yields, which, after falling at the end of Q1, have largely been on the rise in Q2.

2 Year Treasury Rate Chart

2 Year Treasury Rate data by YCharts

What to expect from bond portfolios

Given that yields have moved higher in Q2, I'm expecting unrealized losses to have increased from first-quarter levels. But it may not be too dramatic of an increase because, with each passing quarter, the duration of most bonds purchased back in 2021 declines, which should help with some of the losses.

Banks can also hedge their bond portfolios but I think a lot of them will likely try to ride it out. For instance, Bank of America had $99 billion of unrealized HTM bond losses at the end of Q1 and CFO Alastair Borthwick said the bank expects to grind it down by letting the portfolios get smaller and shorter in duration. Given the diversity and size of Bank of America's deposit base I would expect the strategy to work, not that it hasn't put on investors on edge while they wait.

Ultimately, it's still a wait-and-see game, with most banks waiting for yields to fall, which would likely happen if the economy shows signs of weakening or the Fed indicates it is done hiking rates.