If I were you, I'd ignore the fact that Bank of America's (BAC 1.70%) shares fell sharply over the last few days. The fact of the matter is that the $2.2 trillion bank is in the best shape it's been in for nearly a decade.

The market's declines on Thursday and Friday seem to stem from China's decision to devalue its currency, the yuan. Not only will this effectively reduce the price of products manufactured in China relative to products produced elsewhere, but even more importantly it seems to suggest that the East Asian giant may be in a worse economic position than previously assumed.

This isn't good for the global economy, and it isn't good for Bank of America. While the Charlotte, North Carolina-based bank purports to have only $12 billion in direct exposure to China, an economic cataclysm in Asia would reverberate throughout the entire world.

Yet, I still believe that Bank of America is in a better position today than it's been in since the financial crisis. And I also believe that the valuation of its shares, and particularly after last week's decline, isn't reflecting the three things that matter most to the megabank right now.

First, Bank of America's credit rating was increased by all three of the nation's leading ratings agencies last quarter. If this trend continues, it isn't unreasonable to think that the nation's second biggest bank by assets could earn $2 billion more a year over the foreseeable future with little to no added effort or expense.

In the second quarter of this year, Bank of America paid an annualized interest rate of 2.2% to borrow $240 billion in long-term debt. Meanwhile, the higher-rated Wells Fargo paid only 1.32%. If Bank of America had faced the same rate over the past year, holding all else equal, its pre-tax income would have increased by 24%.

Second, a legal decision handed down by New York's highest court in June allowed Bank of America to reduce its estimate of outstanding legal liabilities by $7.6 billion. It also throttled the inflow of new claims against the bank. An average of $2.6 billion worth of fresh claims were filed against Bank of America in each of the four quarters preceding the decision. But this dropped to only $224 million in its wake.

Billions of dollars that were once consumed by legal expenses are thus finally free to hit Bank of America's bottom line. Not only will this reduce the uncertainty weighing on the valuation of its shares -- based on Friday's closing price, they trade for a 24% discount to book value -- it will also fuel Bank of America's return on equity, which, in turn, should filter through to its stock price (to learn about return on equity as well as bank stock valuations, scroll through the following slideshow).

Finally, if you listen to Bank of America's latest conference call, one thing stands out from the rest. Namely, CEO Brian Moynihan focused his prepared comments on revenue growth, departing from previous calls where he spent the majority of his time discussing expenses and legal risk.

To be clear, this isn't the first time that Moynihan has hinted that Bank of America's worst days are behind it. At the bank's investor day in March 2011, Moynihan predicted that it would soon earn between $35 billion and $40 billion on an annual pre-tax basis. Fast forward to 2014, and it generated only $6.9 billion in earnings before taxes.

But far from eroding Moynihan's credibility, I believe his past mistakes, and the public indignation suffered because of them, have most likely tempered his optimism. Regardless of what you think of the 55-year-old bank chief, he's incredibly astute. If anything, then, the recent change in his tone probably understates the opportunities that lie ahead for Bank of America.

In sum, I believe that Bank of America's shares are a bargain compared to other banks. This is particularly true after last week's 10% rout. I could be wrong, and I apologize if I am, but that's my honest opinion.