In the blink of an eye, panic on Wall Street over rising interest rates has given way to optimism that the economy remains on course.

That shifting sentiment could be good news for financial stocks, many of which sold off in tandem with a sharp spike in the yield on the 10-year Treasury.

Over the past month, the Philadelphia KBW Bank Index is down 5%, near where it closed on June 26, the day after the

Federal Reserve

cut interest rates by 25 basis points instead of the 50 many had anticipated. Brokerage stocks also have lost ground during that time, with the Amex Broker/Dealer Index dropping 3.6%.

Dump It All

The selling on Wall Street in financials was largely indiscriminate, with traders and investors fearing that a sudden rise in Treasury yields and interest rates would cut into earnings at banks, both big and small.

Goldman Sachs

(GS) - Get Report

,

Merrill Lynch

(MER)

and

Bear Stearns

(BSC)

, for instance, had all feasted on revenue from trading bonds and underwriting new debt offerings.

Investors also worried that the accompanying rise in the yield on a 30-year fixed mortgage to 6.34% -- its highest level in over a year -- would put a chill in the booming mortgage-refinance market and take a bite out of earnings at mortgage finance firms like

Countrywide Financial

(CFC)

.

But just how hard financial-services companies will be hit by the spike in Treasury yields is a matter of dispute. Higher rates can also be good for financial firms, particularly after going so low in the spring that lending margins were threatened. They also help companies with large mortgage servicing businesses and reduce the level of mortgage prepayments -- something that has forced many banks to take large impairment charges each quarter.

A lot depends on rates staying at the current level, the fledgling economic recovery continuing to gain steam and the federal government's ability to keep a lid on the resurgent U.S. deficit. With the yield on the 10-year Treasury settling in at around 4.25%, many believe bond yields are now at a level that's consistent with an improving economy. Treasury yields just got to that level much faster than many anticipated.

"The natural move to a 4% yield was probably priced into the market," said Reilly Tierney, a financial services analyst with Fox, Pitt-Kelton. "A 5% move isn't."

Tierney expects the big selloff in bonds to depress trading revenue on Wall Street, but added that few believed that was sustainable anyway. Tierney said it's hard predicting which Wall Street banks will be hardest hit, because industry analysts traditionally have "a difficult time modeling trading revenue."

"This is going to be a period when you have divergences in performance between the companies," said Tierney.

Solid Bond in Your Heart

Still, the sudden rise in rates will no doubt cause pain for those banks and brokers caught off-guard by the action -- anyone who didn't properly hedge their exposure to rising rates. Indeed, the bond market's travail was sparked by a dangerous combination of new supply via a three-day auction and banks and other big mortgage holders trying to unwind earlier interest-rate hedges. (Banks and other investors commonly use Treasuries to guard against changes in the value of their mortgage portfolios.)

Some on Wall Street believe one big seller of Treasuries was the giant mortgage finance firm

Fannie Mae

TST Recommends

. A hedge fund manager said the government-sponsored company was calling investment banks last Thursday trying to strike a deal to sell Treasuries in bulk. But analysts who cover the government-sponsored firm dispute that, and the company contends it doesn't rely on Treasuries to manage its interest rate risk.

The banks likely to feel the greatest pinch from the jump in Treasury yields are regional lenders such as New Jersey's

Commerce Bank

(CBH) - Get Report

, which have invested heavily in low-yielding mortgage-backed securities. Rising rates are bad for mortgage-backed securities because they extend the life of those investments and reduce the value of the portfolio.

Standard & Poor's has estimated that Commerce is second only to

Roslyn Savings Bank

(RSLN)

, a small New York thrift, in its exposure to mortgage-backed securities. Another bank owning a large proportion of mortgage-backed securities is

Provident Bank

(PBKS)

.

Prudent Bears

Of course, one way for banks to limit their sensitivity to rising rates is to sell some of their mortgage-backed securities, and the latest information from the Federal Reserve shows that's what many have done. Long Island, N.Y.-based

North Fork Bank

(NFB)

said a day before the Fed last cut interest rates that it was beginning to reposition its investment portfolio for a rising rate environment and would start selling mortgage-backed securities.

A rise in rates is not necessarily all bad news for mortgage finance firms, either. Officials at Countrywide, one of the best-performing financial stocks this year, devoted their entire earnings conference call to a discussion about how the California-based lender intends to prosper after the bursting of the refinancing bubble.

The company expects its $559 billion mortgage servicing rights portfolio to start becoming a big revenue producer in the second half of the year, as interest rates go up. That's because the company doesn't expect to take any more impairment charges on the portfolio in the coming quarters.

And some analysts agree. David Hendler, a financial analyst with CreditSights, listed Countrywide as one of the financial firms that is "getting it right" in dealing with a rising interest-rate environment. Others on Hendler's list include

Bank of America

(BAC) - Get Report

,

SunTrust

(STI) - Get Report

and

Fifth Third

(FITB) - Get Report

.

It's too soon to say whether the bond market has returned to a new equilibrium. Too much uncertainty exists about the budget deficit, the dollar and economic trends. But at least it's clear that some of the more catastrophic predictions about the impact on financial companies were overblown.