No bank that I talk to these days can find an easy way to make money in their investment portfolio. Low interest rates have cut income on all but the longest Treasury debt, and the low-rate environment is showing no signs of abating anytime soon. The simplest agency debt trades at yields just above the Treasury curve. And the simplest agency mortgage-backed securities have historically modest yields compared to other markets.

But the steps many community banks are taking to increase their investment yields in this environment are giving silent rise to another risk in bank portfolios: illiquidity.

Smaller institutions have added steadily to their holdings of securities that, while earning them a higher return, are more difficult to trade or liquidate if the bank suddenly needed to rebalance the balance sheet. For example, state and municipal bonds typically allow banks to earn more than Treasury bonds. But they also are more difficult to turn quickly into cash. Community bank holdings in state and municipal debt have jumped by 60% since 2010. Holdings in callable agency debt, which are less liquid than simpler forms of agency-backed debt, also remain sizable.

The difference in portfolio composition between the smallest and largest banks has become striking since January 2015 when regulators’ liquidity coverage ratio began applying to banks with more than $50 billion in total assets. The LCR requires large banks to keep a steady crop of “high-quality liquid assets” that can be sold off quickly in a stressed liquidity environment. While this has meant a rush to liquid assets by large firms, banks with total assets of $100 million to $500 million hold more than 30% of their portfolio today in state and municipal debt. By comparison, banks with more than $50 billion in assets hold only 7%. In addition, while smaller banks hold more than 23% in less liquid agency debt, the larger banks hold 2%.

Of course, the lure of less liquid securities is understandable. Higher-return investments count in today’s markets. Liquidity risk may be exactly the right risk to take as long as the return adequately compensates. But managers need to know the risk they are taking. To measure the liquidity of each security, a bank must consider three important factors: cash flow, financing and marketability.

Cash flow may be the most predictable, least expensive and most overlooked source of liquidity in any security. Getting interest and principal is the simplest and least expensive way to turn a security into the most flexible of all assets: cash.

Financing creates liquidity too by allowing a bank to borrow against its securities. That can give a bank fast access to cash. And if a security has a higher credit rating than the bank itself, then the interest rate and other borrowing terms can be much better than if the bank borrowed on its own. The Federal Reserve Bank of New York posts an extraordinary monthly snapshot of the largest part of the market for borrowing against securities: the tri-party repurchase market. That snapshot — $1.6 trillion in May — can help a bank benchmark the amounts and terms of borrowing against most securities and some whole loans.

The best way to turn any security into cash is to sell it, of course, but measuring marketability is more of an art than a science. Trading volume ends up being the most visible piece of the market liquidity puzzle, and the New York Fed again provides a valuable picture. The Fed posts a weekly series showing average daily trading volume in most key sectors of fixed income, and that data can be illuminating. The data from the second week of June showed average daily trading volume in Treasury debt of $467 billion, for instance, state and municipal debt volume of only $9 billion.

Liquidity clearly can come from other parts of the balance sheet besides the investment portfolio. Some loans are relatively liquid. There’s debt, wholesale funding and deposits. Securitization counts. But the investment portfolio typically is the fastest, most efficient source.

While the return of a security is important, bank managers need to consider the value of liquidity, or they could find themselves too far out on the risk spectrum. The liquidity capability allows the bank to respond smoothly to the ups and downs of credit, the flows of deposits and the demands of earnings. That flexibility is worth something. If you invest in less liquid securities, know what you’re getting into and make sure you get paid.

For every investment that goes into a portfolio, know how to get out. That is a commandment that governed both the JPMorgan and HSBC NA investment portfolios when my business partner, Brian Egnatz, ran them. Every good bank portfolio knows its true liquidity.

Steven Abrahams is a co-founder of Milepost Capital Management and former head of securitization research for Deutsche Bank.