Recession fears driven by rampant inflation and rising interest rates have led many investors to abandon the stock market. As a result, the S&P 500 has fallen 23% from its high, while the Nasdaq Composite has nosedived 31%. That puts both indexes in a bear market, but some Wall Street analysts see that as a buying opportunity.

Canaccord Genuity analyst Joseph Vafi has a price target of $150 per share on Block (SQ 2.20%), which implies 154% upside from its share price. Similarly, Wolfe Research analyst Andrew Rosivach  has a price target of $183 per share on Walker & Dunlop (WD 8.50%), which implies 115% upside from its current share price.

Is it time to buy these stocks?

Block: A disruptive force in commerce and consumer finance

Block started its disruptive path with the Square platform, a suite of integrated hardware, software, and services that allow merchants to run an omnichannel business. The cohesive nature of the Square ecosystem distinguishes Block from traditional merchant service providers, which tend to bundle products from different vendors. Block eliminates that complexity, providing everything from point-of-sale systems and team-management software to payment-processing and banking services.

Block has taken a similarly disruptive approach to consumer finance. The Cash App allows users to deposit, borrow, spend, and invest money from a single platform. The comprehensive functionality of the platform has resulted in strong demand. In fact, the Cash App ranked as the most downloaded digital wallet in the U.S. in the first half of 2022, according to Apptopia.

In spite of macroeconomic headwinds, Block still delivered solid financial results over the past year. Gross profit increased 37% to $5.1 billion, and free cash flow more than doubled to $563 million. Moreover, investors have good reason to believe that momentum will continue.

Block is making progress on its plans to connect Square and Cash App with Afterpay, the buy now, pay later platform it acquired earlier this year. Square sellers can already accept Afterpay online and in stores, and Cash App consumers will soon be able to browse products and make purchases from Afterpay sellers within the mobile app. Block also plans to deepen its digital-advertising offering as Cash App becomes a commerce engine and plans to scale Cash App Pay among Square and Afterpay merchants.

Those initiatives could supercharge growth. Adding commerce functionality to the Cash App should drive consumer engagement. It should also boost sales for Square and Afterpay merchants. Similarly, greater merchant acceptance of Cash App Pay will enhance the utility of the digital wallet, which should drive consumer adoption.

On that note, Block puts its addressable market at $190 billion in gross profit, an opportunity comprising $120 billion from Square and $70 billion from Cash App. And with shares trading at 1.9 times sales -- a sizable discount compared to the three-year average of 7.4 times sales -- now is a great time to buy this growth stock, though near-term upside of 154% may be overambitious. Block is best viewed as a long-term investment.

Walker & Dunlop: A key lender in the multifamily and affordable housing markets

Walker & Dunlop is the fourth largest commercial real estate lender in the U.S. and the largest provider of capital to the multifamily industry. The company also offers adjacent services -- multifamily property sales, loan servicing, and asset management -- that help it meet the needs of a broad clientele base.

U.S. home prices have skyrocketed since the onset of the pandemic, creating a need for multifamily properties and affordable housing. That plays right into Walker & Dunlop's wheelhouse. Not only is the company a leader in multifamily lending, but it's also the sixth largest low-income housing tax credit (LIHTC) syndicator in the country. For context, LIHTC syndicators invest institutional capital in affordable housing projects that will generate tax credits.

Rising interest rates have hit some lenders hard in the past year, but Walker & Dunlop continued to deliver solid financial results. Revenue climbed 28% to $1.4 billion and earnings jumped 8% to $8.36 per diluted share. Better yet, given the need for affordable housing and multifamily properties, shareholders have good reason to believe that momentum will continue in the coming years.

Walker & Dunlop recently acquired real estate tech company GeoPhy for $85 million in cash; management says that move will strengthen its position in the $2 billion multifamily appraisal market and the $85 billion multifamily small-balance lending market.

More broadly, the real estate lending industry is highly fragmented. Despite its strong market position, Walker & Dunlop accounted for just 1.6% of the $900 billion in commercial real estate loan originations last year and just 9% of the $470 billion in multifamily loan volume. That leaves plenty of room for the company to gain market share.

Currently, shares trade at a reasonable 10.1 times earnings, a discount to the three-year average of 12.4 times earnings. That creates a buying opportunity for patient investors, though near-term upside of 115% is probably too optimistic. Walker & Dunlop is best viewed as a long-term investment.