Roku (ROKU -10.29%) and Shopify (SHOP 1.11%) were huge pandemic favorites during 2020 and early 2021. Investors were optimistic about Roku's position within the connected TV market, and Shopify was putting up fantastic earnings results as it powered a growing number of e-commerce sites. 2022 hasn't nearly been as kind.

With slowing growth, increasing competition, and the current bear market, both Roku and Shopify have been down over 80% in the past year. That means, in order to get back to where they were trading 12 months ago, shares are going to need to 5x and go up by 400%. That feels like a long way off but could provide a buying opportunity for investors with shares trading at depressed prices. 

So what beaten-down stock is more likely to go up by 5x first, Roku or Shopify? Let's take a look. 

Roku remains a potential winner in CTV advertising

Roku sells hardware and runs a software platform for CTV users, or people who have cut out their legacy cable subscriptions. At the end of the second quarter, the company had 63.1 million active accounts, mainly in the United States, Canada, and Mexico. Hours streamed on its platform were up 19% year over year to 20.7 billion in the quarter. The amount of time its customers spend using their Roku devices is important because Roku makes money off of its customers by selling advertisements and sharing revenue with video streaming applications. 

The problem with Roku's advertising ambitions is that its two most popular applications (Netflix and YouTube) are currently not sharing any of the revenue earned on Roku's platform. This will still be true once Netflix starts its advertising-supported tier later this year, as the company has partnered with Microsoft to deliver advertisements to its users. Roku has minimal negotiating leverage here since the company would likely lose many customers if it banned the Netflix application from its platform. People would end up switching to alternative CTV platforms from Amazon and Alphabet

Roku is trying to mitigate these risks by building out its own advertising-supported video streaming application called the Roku Channel. The Roku Channel was a top-five application by hours streamed on the Roku platform last quarter. Management doesn't disclose how much revenue the application is bringing in, but it is likely driving a lot of growth for Roku's business at the moment. 

Due to the pandemic tailwinds and smart moves with the Roku Channel, the company's gross profit has been up 228% over the past three years to $1.46 billion. The company is not yet generating consistent free cash flow, so gross profit is the best metric to value the business on. While gross profit growth has flatlined in recent quarters, driving down the stock, over the long term it should keep moving higher if Roku can continue to gain active accounts and grow the number of hours streamed on the Roku Channel. 

Can Shopify beat Amazon?

Well-known to many investors, Shopify sells software subscriptions and other tools for individuals and businesses looking to build e-commerce websites. The company makes money in two ways: software subscriptions and payment revenue. Last quarter, subscription revenue was up 10% year over year to $366 million, and merchant revenue (the majority of which is payments) was up 18% year over year to $929 million.

Both growth rates are down substantially from a year-ago period when the two segments were growing at 50%+ year over year. This is due to tough comparisons and a slowdown in the e-commerce industry as we come out of the COVID-19 pandemic. 

Looking at the size of each segment, it is clear that merchant payments are the most important part of Shopify's business. This is a potential problem because of a recent announcement from e-commerce competitor Amazon. The everything store will now allow e-commerce sellers to offer "Buy With Prime" buttons on their own websites. The benefits of Amazon Prime have typically been siloed to Amazon's website, so this development was huge news. If merchants use Amazon's payment option instead of Shopify's, this could severely hurt Shopify's payment revenue, especially in places where Amazon has a large presence. 

Can Shopify defend its business from the coming Amazon onslaught? Maybe. The company has been quite innovative in the past. But it will be tough to beat the technology giant's logistical infrastructure and two-day delivery, which Shopify cannot offer its merchants. This is a big reason the stock is down 80% over the past year, even though gross profit continues to march higher, hitting $2.6 billion in the last 12 months.  

So what stock will 5x first?

Roku and Shopify are in very similar positions. They each have innovative business models but have suffered recently from pandemic hangovers and looming competitive threats. So what is left to compare the two stocks? Valuation. As with Roku, Shopify is still investing heavily for growth and is not generating much in bottom-line profits or cash flow, so we should try to value the business on a multiple of its gross profit (P/GP). P/GP is a better metric to measure the potential of a growth business than the price-to-sales ratio (P/S) because it eliminates variable costs that will grow in tandem with revenue.

With all of that said, Roku has a market cap of $8.1 billion, and Shopify has a market cap of $35.4 billion (as of this writing). That means Roku trades at a price-to-gross profit (P/GP) of 5.5, while Shopify trades at a P/GP of 13.6. Based on this valuation discrepancy, I think Roku has the best chance to 5x first for investors. Shopify's stock -- even though it is down 80% -- is still trading at an expensive valuation.