The stock market may have turned in a disappointing performance in 2022 amid multiple headwinds that have dented investor confidence, but there are some stocks that are defying the downturn of late and look set to end the year on a high.

Shares of Shopify (SHOP -2.37%) and Chewy (CHWY -3.27%) have been in fine form since the beginning of October. Shopify stock has shot up 31% since the beginning of the third quarter of 2022, while Chewy has also delivered impressive gains of 32%. Both stocks have easily beaten the S&P 500's returns of 6.5% over the same period.

It wouldn't be surprising to see these e-commerce stocks sustain their momentum in 2023 and continue to beat the broader market. Let's look at the reasons why.

1. Shopify retains strong growth prospects

Shopify stock may have gained some momentum of late, but the e-commerce software provider has had a woeful time on the market in 2022, losing roughly 74% of its valuation. But a closer look at Shopify's results in recent quarters suggests that the market may have been too harsh on the company.

SHOP Revenue (TTM) Chart

SHOP Revenue (TTM) data by YCharts

Shopify has generated $3.86 billion in revenue in the first nine months of 2022, an increase of 19% over the same period in 2021. For the full year, Shopify is expected to report a 20% increase in revenue over 2021 to $5.5 billion. Wall Street expects Shopify to report similar growth in 2023 as well, with estimated revenue of $6.7 billion, followed by an acceleration in 2024 to $8.4 billion.

This indicates that analysts are upbeat about Shopify's growth in 2023 and beyond, which isn't surprising as the growing adoption of e-commerce across the globe should ideally lead to stronger demand for the company's offerings. Shopify offers various services to e-commerce merchants, such as payment solutions, finding new customers through digital advertisements, fulfillment of orders, and cross-border sales into international markets.

The demand for these services has been growing at a healthy pace. The company's merchant solutions revenue jumped 26% in Q3 to $990 million, driven by the increasing adoption of its various offerings. Looking ahead, the growing proliferation of e-commerce in markets where Shopify operates should create more demand for its offerings.

The Canadian e-commerce market, for instance, is expected to clock annual growth of 15% through 2027. The Middle Eastern and African e-commerce markets, meanwhile, are expected to grow at a faster pace of nearly 20% through 2028. All this explains why the demand for e-commerce software that Shopify sells is expected to increase at an annual pace of over 16% through 2027.

So investors looking to buy a beaten-down growth stock that could explode in 2023 and beyond should take a closer look at Shopify, since it is trading at a relatively cheap 8.7 times sales now, compared to 41 times sales in 2021.

2. Chewy has momentum at its side

Chewy stock has been in explosive form of late, and the company's fiscal 2022 third-quarter results for the three months ending Oct. 30, 2022, which were released on Dec. 8, suggest that it could deliver more upside in the new year and beyond.

Chewy reported 14.5% year-over-year revenue growth last quarter to $2.5 billion. The company's gross margin also grew 200 basis points over the prior-year period to 28.4%. Chewy's adjusted EBITDA (earnings before interest, taxes, depreciation, and amortization) margin also increased 250 basis points year over year to 2.8% last quarter.

Wall Street cheered Chewy's performance and the stock jumped following the report, which is not surprising if you take a closer look at the factors that drove its growth last quarter. Chewy's net sales per active customer increased nearly 14% year over year to $477. The impressive jump in customer spending allowed the company to overcome the lack of customer additions during the quarter.

It is worth noting that Chewy now has 20.5 million active customers. Although that number was flat compared to the prior-year period, investors should note that Chewy's customers spend more on its platform the longer they are associated with the company. Specifically, Chewy points out that its "customers historically spend over $400 with ... Chewy in their second year, compared to approximately $700 in their fifth year and almost $900 in their ninth year."

So Chewy could gain a bigger share of customers' wallets in the future, especially considering that a large chunk of its revenue comes from the subscription channel. The company's subscription revenue increased nearly 19% year over year last quarter to $1.86 billion, accounting for 73% of the top line.

Moreover, Chewy is sitting on a secular growth opportunity, as 55% of pet food sales in the U.S. could come from the e-commerce channel in 2025, compared to 37% last year. So it is not surprising to see that analysts expect solid double-digit top-line growth from Chewy over the next couple of fiscal years.

With shares of Chewy trading at less than 2 times sales, compared to the S&P 500's price-to-sales ratio of 2.45, investors are getting a great deal on the stock right now. They may not want to miss such an opportunity given that Chewy is in red-hot form on the stock market and this e-commerce play could sustain its terrific momentum in 2023.