Lately, it doesn't seem like anything can go wrong for Bank of America (BAC 1.70%), the nation's second largest bank by assets. Despite a blistering article in The New York Times over the weekend that criticized the Federal Reserve for ostensibly releasing B of A from liability to insurance giant AIG (AIG -0.04%), shares are nevertheless up considerably. At roughly halfway through the trading session, shares in the bank are higher by 2.12%.

B of A vs. AIG
The gist of the lawsuit is this. In the lead-up to the financial crisis, Countrywide Financial, now a subsidiary of B of A, sold billions of dollars in mortgage-backed securities to institutional investors like AIG. Many of the underlying mortgages have since defaulted, and companies like AIG now want their money back.

But in AIG's case, there's a twist. As a part of the government's 2008 bailout of the insurance giant, the Federal Reserve Bank of New York acquired control of the mortgage-backed securities at issue. And along with the transfer of control went the right to sue -- at least according to the Federal Reserve and B of A, that is. AIG is claiming that no such transfer occurred and that it still has the right to recover damages from Countrywide (and therefore B of A). It's accordingly filed a lawsuit that is awaiting the decision of a federal judge on this very issue.

To say that the impending ruling is important to B of A -- as well as other potential litigants including Goldman Sachs (GS 1.59%) and JPMorgan Chase (JPM 1.44%) -- would be an understatement. All told, Countrywide sold an estimated $10 billion in MBSes to AIG -- $7 billion of which were ostensibly transferred to the Fed. A favorable decision could save it billions of dollars in liability. But if the judge adopts the same attitude toward the purported transfer as The New York Times did, then it may not be so lucky.

To read more about this particular case, check out my colleague Amanda Alix's take on it here. And to get an overarching view of B of A's legal situation, I strongly encourage you to read this multipart series that we published last week.

Why B of A's shares are nevertheless up
Despite this lingering threat, there are at least three factors fueling B of A's climb today.

In the first case, there's mounting evidence that investment banking activity is gaining momentum. The personal computer maker Dell is going private in one of the largest leveraged buyouts in years. American Airlines and US Airways are in the process of consummating a merger. And most recently, Warren Buffet's Berkshire Hathaway (BRK.B -0.01%) announced a $23 billion takeover of Heinz.

While one doesn't think of these things as necessarily good for banks, they most certainly are -- at least for the too-big-to-fail banks on Wall Street. In B of A's case, specifically, its investment bank (which advises on mergers and acquisitions, among other things) was ranked second in terms of revenue in the fourth quarter of last year.

In the second case, Bloomberg News reported this morning that B of A attracted "record new assets last year to its unit servicing retirement and other employee-benefit plans." According to the report, the bank increased its retirement-related assets by $24.3 billion, or 28%, on a year-over-year basis. As a spokesman for the bank noted: "It is critically important for the bank overall to have a robust retirement business. It's the starting place for many employees and individuals toward their long-term financial security."

And finally, while one should always be suspect of analyst upgrades and downgrades, as they often come too little and too late, it can't be denied that they influence daily market swings. On this note, the investment bank Keefe, Bruyette, and Woods upgraded B of A to an "outperform" from a "market perform."