A bank's core business is deceptively simple: borrow money at one rate, lend it out at a higher rate, and keep the difference. That difference — net interest income, or NII — is typically 60–70% of total revenue at a commercial bank. The ratio of NII to average earning assets is the net interest margin, NIM. It is the single most important profitability metric in banking and the primary thing the ALM function exists to protect and grow.
This module builds NIM from scratch — not as an accounting formula but as a living, rate-sensitive spread that moves every time the Fed acts, every time deposit costs shift, every time the bank makes a lending or investment decision. Understanding NIM construction is the mental model on which everything else in this course rests. Every subsequent module connects back to this one.
We work through a realistic bank balance sheet step by step — what earns, what costs, how the spread is calculated, and what makes it widen or compress. We then trace NIM history across the industry to show how the same business model produces very different earnings in different rate environments.
Before any models, any regulatory frameworks, any hedging strategies — there is a spread. The bank pays depositors 1.5% on their savings accounts. It lends that money to a homebuyer at 7% on a 30-year mortgage. It earns the 5.5% difference. That is the business.
The complexity comes from the fact that a real bank has thousands of assets and liabilities, each with different rates, different maturities, different repricing characteristics, and different behavioral patterns. The NIM line in the income statement is the weighted average of all those individual spreads, aggregated across a balance sheet that might be $500 billion or $4 trillion in size.
The ALM manager's job is to understand that aggregate spread — what is driving it, what is changing it, and what the bank can do to protect it or improve it. That starts with knowing how NIM is constructed.
Earning assets are the assets on the balance sheet that generate interest income: loans, investment securities, interest-bearing deposits at other banks, and certain other instruments. Cash held in the vault does not earn interest. Goodwill does not earn interest. The earning asset base is typically 85–95% of total assets at a commercial bank.
Take a simplified example. A bank has $100 billion in earning assets:
Average yield on earning assets = $5.45B / $100B = 5.45%
Not all liabilities cost money. Noninterest-bearing demand deposits (checking accounts that pay zero) are a free funding source — one of the most valuable assets a retail bank possesses. But most liabilities do carry an explicit cost.
Using the same bank:
Average cost of interest-bearing liabilities = $1.77B / $50B = 3.54%
NII = Interest income − Interest expense = $5.45B − $1.77B = $3.68 billion
NIM = NII / Average earning assets = $3.68B / $100B = 3.68%
This is exactly how every bank calculates and reports NIM. The numbers move every quarter as loan yields reset, deposit costs change, the portfolio mix shifts, and the rate environment evolves.
Notice the 40 billion in noninterest-bearing deposits in the example above. That free funding source contributes materially to NIM even though it has no explicit rate. The bank deploys that funding into earning assets at 5–6% and pays nothing for it. In a higher-rate environment, the value of noninterest-bearing deposits increases dramatically — the bank is funding earning assets at zero while those assets yield more. In a zero-rate environment, the benefit collapses because the assets earn nothing either.
This dynamic is one of the most important but least intuitive aspects of bank NIM. When rates rose from near-zero to 5.25% between 2022 and 2023, banks with large noninterest-bearing deposit bases initially benefited significantly — free funding supporting assets that were finally earning real returns. JPMorgan, which had approximately $700–800 billion in noninterest-bearing deposits at the peak, captured enormous NIM benefit from this dynamic in 2022 and 2023 before the deposit migration to interest-bearing accounts began to erode it.
The most obvious driver. When the Fed hikes, short-term interest rates go up. Floating-rate loans (those tied to SOFR, Prime, or other floating benchmarks) reprice upward immediately. Deposit costs also rise — but how quickly depends on competitive dynamics and the bank's deposit mix. The timing difference between when assets reprice and when liabilities reprice determines whether a rate hike initially helps or hurts NIM.
For an asset-sensitive bank (one where assets reprice faster than liabilities), rising rates help NIM. For a liability-sensitive bank (liabilities reprice faster), rising rates hurt NIM. The 2022–2024 cycle was particularly painful for liability-sensitive institutions — deposit costs rose faster than loan yields for much of the cycle, compressing NIMs.
NIM is a weighted average, so changing the mix of assets and liabilities changes the average. A bank that shifts from low-yielding securities into higher-yielding commercial loans will see NIM improve, all else equal. A bank that replaces cheap noninterest-bearing deposits with more expensive CDs will see NIM compress. Mix decisions — what assets to grow, what liabilities to favor — are central to ALM strategy.
In 2023 and 2024, virtually every major bank discussed "deposit mix shift" on earnings calls as a NIM headwind. The migration from noninterest-bearing checking accounts into higher-rate savings accounts and CDs was reducing the benefit of free funding and increasing the average cost of the deposit base. Bank of America, for example, saw its noninterest-bearing deposit percentage drop from approximately 35% of total deposits in 2022 to roughly 25% by 2024 — a direct NIM headwind worth tens of basis points.
Holding yields and costs constant, growing earning assets faster than interest-bearing liabilities expands NIM. Shrinking the balance sheet or growing liabilities faster than assets compresses it. This is the "volume" component of the standard three-factor NIM decomposition — rate, mix, and volume — that the ALM manager uses to explain NIM changes to ALCO.
The most productive exercise is mapping actual industry NIM to rate environments over the past twenty years.
As the Fed raised rates from 1% to 5.25% between 2004 and 2006, the industry NIM story was initially positive — floating rate loan yields rose as deposit costs lagged. But by 2006 and 2007, deposit competition had intensified, deposit betas were accelerating, and the curve had flattened significantly. Industry-wide NIM compressed approximately 30–40 basis points between the rate peak and the onset of the financial crisis. Banks that had extended asset duration earlier in the cycle were stuck with below-market fixed-rate assets while paying increasingly competitive deposit rates.
The Federal Reserve's decision to hold rates at zero from December 2008 through December 2015 produced one of the most sustained NIM compression cycles in banking history. Banks were flush with deposits (excess reserves hit $2.5 trillion) but earning almost nothing on the short end. The industry NIM, which had been in the 3.5–4.0% range pre-crisis, compressed to 3.0–3.3% by 2015. Banks responded by extending asset duration to pick up yield — buying longer-dated MBS and Treasuries — which set up the 2022–2023 problem.
When the Fed raised rates 525 basis points in 16 months, banks with floating-rate asset books initially saw strong NIM expansion. JPMorgan's NII ex-Markets grew from $44 billion in 2021 to $56 billion in 2022 and $65 billion in 2023. Wells Fargo's NII grew from $35 billion in 2021 to $45 billion in 2022 and $52 billion in 2023 — a 49% increase over two years. But the expansion was uneven: banks with fixed-rate-heavy asset books (long MBS, fixed mortgages, long-duration securities) did not benefit nearly as much, and liability-sensitive institutions actually saw NIM compress before eventually recovering.
As the Fed began cutting rates in September 2024, the NIM story became more nuanced. Banks with large fixed-rate asset books that had been waiting for old vintages to mature and reprice higher began to see portfolio yield accretion — old 2–3% mortgages and securities rolling off and being replaced by new assets at 6–7%. Banks with liability-sensitive profiles saw deposit costs finally begin declining. But the pace of NIM expansion varied enormously based on asset duration, deposit mix, and hedge book positioning.
Everything the ALM team does — building the NII simulation model, setting duration limits, designing the hedge program, advising on deposit pricing, managing the investment portfolio — ultimately affects NIM. It is the most direct measure of whether the balance sheet is positioned correctly.
When a bank's NIM consistently outperforms peers across rate environments, it usually reflects good ALM: appropriate duration positioning, well-constructed hedges, disciplined deposit pricing, and a securities portfolio managed as an ALM tool rather than a return-chasing vehicle. When NIM consistently underperforms, the causes are almost always traceable to ALM decisions — excessive duration extension, inadequate hedging, deposit assumptions that proved too optimistic, or balance sheet mix decisions that prioritized near-term yield over long-term stability.
This is why understanding NIM construction is the foundation of everything that follows. You cannot manage something you do not understand how to measure.