With the Nasdaq Composite approaching bear market territory again -- down 20% from its high -- investors are looking for bargains among the rubble. Many of the most popular stocks have been cut in half or more in the last six months. Some will never recover.

Shopify (SHOP 2.95%) -- a platform that lets merchants manage their entire e-commerce business from one application -- is one company with a beaten-down stock that seems to have years of growth head of it. But some metrics point to trouble ahead. Here are a few charts to see before picking up shares.

A business owner using an e-commerce application to manage orders and ship products.

Image source: Getty Images.

Shares have been pummeled

Long-term shareholders should be very happy with Shopify. The stock has returned 500% in the past five years. That's fantastic. Yet those returns had eclipsed 2,100% before the recent downturn. Shares currently sit 73% below the peak.

SHOP Chart

SHOP data by YCharts

Partner referral continues to slow

Shopify has always grown fast. Revenue rose almost 50% in 2019. That accelerated to 85% in 2020 thanks to the pandemic. The need for legacy brands to get online, as well as more online sales overall, fueled expansion.

One of the most important levers to expand its customer base was its partner referral program. Heading into 2020, the number of existing customers -- partners -- who referred a new customer was rising steadily each quarter. In 2020 it spiked. That's done a 180 degree turn. It declined sequentially -- quarter-over-quarter -- for the back half of last year.

Graph showing quarter over quarter drop in referring partners.

Data source: Shopify. Chart by author. QoQ = Quarter-over-Quarter.

It isn't just a sequential decline. For the first time, the number of partners referring at least one merchant fell year-over-year in the fourth quarter of 2021 -- from 43,000 to 40,000. It had grown between 35% and 70% every quarter from April 2019 to June 2021. Those referrals were a source of sales that didn't require much marketing. And that boosted profits.

Profits declining even with higher revenue

One of the attributes investors love about online businesses is how easily they scale. Once initial investments are covered every additional customer is almost all profit. After demonstrating that quality for years, the story is cracking at Shopify. Profits and sales are diverging. Even after management's adjustments, trailing 12 month operating income declined in the fourth quarter.

It's still up huge over the previous year. But like many fast-growing companies, that's too much of a lag to see what's happening in the business right now.

Graph showing trailing 12 month operating income falling in the most recent quarter.

Data source: Shopify. Chart by author. TTM = Trailing 12 months.

The reason Wall Street rewards a fast-growing company is the assumption it can turn on the profit spigot whenever it chooses. All bets are off when profits start heading in reverse.

All is not lost

In the fourth quarter of 2021, e-commerce sales made up only 13% of all retail sales in the U.S. That leaves a lot of room for Shopify, as well as companies like Amazon and Etsy, to grow. The company is still expanding, it's profitable, and it has a myriad of ways it can capture more of its customers' spending.

That said, the stampede of businesses online may have artificially inflated how large and fast Shopify's network of partners could grow. Until the partner referral number stops declining it's hard to say what the company is worth. Don't be surprised if Wall Street prices in much slower growth once that trough is found. It took Amazon's stock nearly a decade to reach a new high after the dot-com bubble burst. Don't be surprised if Shopify takes longer -- even if the business performs well.