Battered hedge funds may still be the best-looking clients out there for banks, which face a dearth of opportunities to do deals in the dead M&A and IPO markets.

The business of providing an array of services to hedge funds, known as prime brokerage, went up for grabs in 2008. It is highly specialized, expensive, and difficult to run, but potentially very lucrative. It typically accounts for about 6% of

Goldman Sachs'

(GS) - Get Goldman Sachs Group, Inc. (GS) Report

revenues, though that does not include ancillary benefits, like trading commissions.

In the fourth quarter, Goldman's first money-losing effort as a public company, prime brokerage helped offset some of the damage. The $799 million the business accounted for some 15% of total revenues.

Potentially even more lucrative for prime brokers -- though dicey -- is their access to privileged information and levers of power. For example, when hedge fund Amaranth Advisors got into trouble on natural gas trades in 2006,

JPMorgan Chase

(JPM) - Get JPMorgan Chase & Co. (JPM) Report

, an important financial backer to the hedge fund, took over the trading positions and sold them for a profit of $725 million. The situation is the subject of an ongoing lawsuit, in which Amaranth blames its ultimate failure on JPMorgan.

Until 2008, the equity prime brokerage business was dominated by Goldman and

Morgan Stanley

,

(MS) - Get Morgan Stanley (MS) Report

, with Bear Stearns a distant third and a handful of other firms bringing up the rear, according to Sandler O'Neill analyst Jeff Harte. Bear's failure in March gave acquirer JPMorgan an opportunity to break into the top tier, and subsequent concerns over the financial soundness of Morgan Stanley and Goldman caused some of their hedge fund clients to flee.

Robert Sloan, managing partner at prime brokerage risk manager S3 Partners, says the competitive landscape has changed drastically, with Goldman and Morgan Stanley falling to second-tier status due to concerns about the strength of their balance sheet and subsequent cutbacks in the business. He says JPMorgan,

Credit Suisse

(CS) - Get Credit Suisse Group AG Sponsored ADR Report

and

Deutsche Bank

(DB) - Get Deutsche Bank AG Report

TheStreet Recommends

are now the top prime brokers.

"What happened in September is hedge funds started to understand they're a counterparty to their prime broker. This is not a warm and fuzzy relationship-driven event," Sloan says, alluding to the bankruptcy of

Lehman Brothers

. Lehman's failure has forced several of its hedge fund clients to recover their collateral through the bankruptcy process.

Harte, however, argues the flight from Goldman and Morgan Stanley was short-lived.

"When solvency concerns were dominant, you saw a rush away from Goldman and Morgan Stanley to banks perceived as being more stable, but when it comes to quality of service Goldman and Morgan Stanley are the gold standard," he says. "My understanding is they didn't stay away too long. All hedge funds have multiple prime brokers, so the shifting of assets can in theory be a one-day phenomenon."

Despite his educated hunch, Harte acknowledges it will take some time to be sure that Goldman and Morgan Stanley have maintained their dominance in prime brokerage, as disclosures about the business typically offer little visibility. Alas, he says Bear Stearns offered the clearest picture into the business in its earnings reports. Other banks are not so helpful.

"They'll tell you what the revenues are, but not the amount of underlying assets they're derived from. Or they'll tell you assets under management are up or down, but they won't say by how much," Harte says.

Harte notes Goldman's prime brokerage revenues were 19% higher in the fourth quarter, despite what he expects is a substantial drop in total assets under management, given widespread losses and client withdrawals in the hedge fund industry. He attributes the gain to higher prices and increased market share following the failure of Lehman Brothers and the sale of Bear Stearns.

Both Harte and Sloan see a tremendous opportunity for

Bank of America

(BAC) - Get Bank of America Corp Report

following its acquisition of

Merrill Lynch

( MER). Though BofA sold its prime brokerage business to

BNP Paribas

earlier this year, Harte believes Merrill's sizeable presence in the space will convince BofA to take another stab at success.

"I don't think anyone would not want to be a leading player in prime brokerage," Harte says. "The problem is it has high barriers to entry. By acquiring Merrill, BofA gets to knock down a lot of those barriers."

Sloan notes that Merrill's unrivalled access to retail investors, through its "thundering herd" of financial advisors, gives it a large inventory of securities it can lend out to hedge funds looking to short the market. (Securities lending is a major prime brokerage service.)

"Merrill should dominate the prime brokerage business," he says.

A Merrill spokeswoman declined to comment and BofA spokespeople did not return calls.