Investment bank and financial services giant Goldman Sachs (GS -0.20%) saw its stock price surge in recent days after reporting better-than-expected second-quarter earnings on July 18. There was a lot to like about the company in that earnings report, but there were also some concerns.

As we move through the second half of 2022, here is one green flag for investors on Goldman Sachs and one red flag to be wary of.

Green flag: Low valuation

Goldman Sachs stock price is down about 16% year to date, trading at about $320 per share -- and that's after a nearly 10% run-up after it posted earnings. The company saw a revenue decline of 23% and an earnings drop of 48% in the quarter, year over year, but both numbers beat analysts' expectations in what was a very difficult quarter for financial services firms.

The most attractive thing about this stock right now is its valuation. For a company that is either the leading or one of the leading investment banks in the world by most measures, it has rarely been available at a valuation this low since it became a public company. The price-to-earnings ratio is around 7.2, which is right around the lows it hit at the start of the pandemic in 2020. It has moved up a bit from P/E ratios of 5 or 6 earlier this year, but it is still historically low for the company.

Also, Goldman Sachs is trading below book value with a price-to-book ratio of 0.9. When a company of this caliber is trading below the value of its assets on the books, it's usually a good time to buy.

The last time these metrics were this low was at the start of the pandemic in 2020 when the stock price sank to $135 per share. Over the following 18 months, the price surged to over $400 per share. While this is a completely different market than that was, the opportunity to buy an established market leader at this valuation is a good one.

Red flag: An M&A market slowdown

Last year was a record year for mergers and acquisitions (M&A), and Goldman Sachs did more deals than anyone else. But M&A activity was down 27% globally in the first half of 2022, year over year, according to Ernst and Young, and Goldman Sachs felt the pain. While the company maintained its leadership position, the volume was far lower, and Goldman Sachs saw investment banking revenue decrease 41% year over year in the second quarter.

Many of the factors that caused the slowdown remain in place -- inflation, high interest rates, the war in Ukraine -- so there is a great deal of uncertainty about what the market will do in the second half of the year, especially if the economy goes into recession, as some predict.

Goldman Sachs Chairman and CEO David Solomon said on the second quarter earnings call:

"I think our tone is cautious because the environment is uncertain. The environment is very uncertain. We don't have a crystal ball to tell you exactly how monetary policy will navigate the inflationary environment that exists, but there is no question that economic conditions are tightening to try to control inflation. And as economic conditions tighten, it will have a bigger impact on corporate confidence and also consumer activity in the economy." 

This could certainly prove to be a headwind for Goldman Sachs through the rest of 2022, along with a stock market that some analysts say could end the year lower than present levels. That would hurt its asset management business, which saw revenue plunge 79% year over year in the second quarter.

Goldman Sachs is definitely a stock that should be on your radar at this rock-bottom valuation. While it is a buy, investors may want to move cautiously on it and watch inflation rates and how interest rates impact the economy.