The silver lining to an otherwise dark-cloud-filled bear market we have been experiencing over the past two months has been the opportunity for investors to buy quality stocks for much lower prices than they could get just weeks before. While some shareholders gave in to the fear and ran for the exits, others saw the significant stock market declines as a chance to buy great companies on the cheap.

One of the most tantalizing prospects was clearly e-commerce platform Shopify (SHOP -2.37%), which has skyrocketed 70% over the past 10 trading sessions. Even after the bear market rout, the stock is up more than 48% year-to-date.

Let's take a look at what drove those remarkable gains, what has investors so bullish on the stock, and whether or not it's still a buy.

Woman's hand hovers over keyboard while other holds credit card.

Image source: Getty Images.

A port in the storm

Shopify provides a platform that allows merchants to quickly and easily set up and maintain an online store, while also integrating many of the tools necessary to succeed, like payments, inventory control, and shipping.

Early this month, Shopify's management provided an update on the impact of the COVID-19 pandemic on the company's business operations. Given the uncertainty caused by efforts to control the spread of the disease and the duration and magnitude of the stay-at-home orders, Shopify pulled its full-year financial guidance.

The company also announced a number of steps it was taking to support the merchants on its platform, including extended 90-day free trials, creating gift card availability on all plans for all merchants, and supporting local in-store and curbside pickup and delivery for its point-of-sale merchants. 

The news wasn't all bad, however, as Shopify reported early indications that brick-and-mortar businesses were pivoting to online sales channels, owing to the decline in foot traffic from stay-at-home policies, and playing to Shopify's greatest strength.

The biggest recent driver, however, came last week when Jean-Michel Lemieux, the company's chief technology officer, announced on Twitter that Shopify was "handling Black Friday level traffic every day!"

This illustrates that Shopify is providing merchants with a viable alternative to physical retail. In the current environment, the opportunity to sell goods online can mean the difference between making ends meet and financial ruin -- for even the most established merchants.

A stunning fall from grace

It's important to acknowledge that the overall decline of the stock market between February and March -- and of Shopify stock in particular -- were big factors in the company's recent run.

Looking back to just before the bear market began, Shopify had already gained nearly 37% year-to-date, with the stock driven higher by the company's stellar fourth-quarter earnings report.

Total revenue grew by 47% year over year, accelerating from 45% in the third quarter, and easily topping expectations. Subscription revenue, which is a good barometer of future results, grew 37%. The merchant solutions segment provided a big boost for the quarter, up 53%, the result of soaring amounts of merchandise sold on Shopify's platform. Those results send the bulls running, with the stock gaining 20% on the day following the earnings release.

However, as the market began its bear market slump on Feb. 19, and investors ran for cover, Shopify stock fell a massive 41% in the 26 days that followed, giving up all the years' gains and more.

What drove the significant decline? At the time, Shopify had a frothy price-to-sales (P/S) ratio of 40 times sales, with an only slightly more reasonable forward valuation of 27. To put that into context, the S&P 500 typically sports a P/S ratio of between one and two, making Shopify extremely susceptible to volatility. It's also worth noting that its PS has returned to its previous heady levels, at 42 times sales and a forward valuation of 34.

The bottom line

After such spectacular gains -- particularly over such a short time -- the question remains "Should you buy Shopify stock right now?"

Much of the answer is personal and depends on you as an investor. While I find the growth story and the long-term opportunity for this software-as-a-service (SaaS) company capitalizing on the growing e-commerce trend equally compelling, there are those investors who tend to avoid stocks with high valuations and don't have the stomach for excessive volatility, even it if means the potential for extraordinary gains.

If, however, you have the willingness and temperament to endure a high valuation, the associated risk, and a roller coaster ride of volatility for the chance at stellar gains (and assuming you have the appropriate long-term investing time horizon), then Shopify probably deserves a place in your portfolio.