Are you the kind of investor who's leery of buying stocks immediately following their initial public offerings (IPOs)? If so, you might like Moderna's (MRNA 1.58%) story.

In December 2018, Moderna conducted the biggest biotech IPO ever. If you had bought shares at the close on the company's first day of trading and held on, your return as of the end of 2019 would have been a piddling 5%. But there's more to the story.

How much would you have today if you'd invested $5,000 in Moderna in January of this year? Your return would be a lot higher than just 5%.

Test tubes with increasingly higher levels of green fluid and a green arrow trending upward behind them

Image source: Getty Images.

Counting the money

Moderna's shares opened on Jan. 2, 2020, the first day of trading this year, at $19.57. An investment of $5,000 would have bought 255 shares. (We'll assume no partial shares were purchased.) 

By the end of the third week of February, your investment would be in the red. But then the biotech stock took off. What happened? Moderna announced on Feb. 24 that it had shipped the first batch of coronavirus vaccine candidate mRNA-1273 to the National Institute of Allergy and Infectious Diseases (NIAID) to be used in a planned phase 1 clinical study. 

Moderna kept on reporting progress with mRNA-1273. And its shares kept on moving higher.

MRNA Chart

MRNA data by YCharts

Fast forward to today. Your initial investment of $5,000 would be worth close to $17,820. That's a gain of more than 250% in less than nine months. Moderna has been a much bigger winner than it was immediately after its IPO.

Why it's not even higher

You probably noticed in the stock chart above that Moderna's year-to-date gains were a lot higher in July than they are now. Had you invested $5,000 in January and sold at the peak on July 17, you'd now have nearly $24,190. 

Why has Moderna given up some of its impressive gains? One factor was that in July the U.S. Patent Trial and Appeal Board (PTAB) ruled against the company and in favor of Arbutus Biopharma in a patent case involving technology used to deliver messenger RNA (mRNA) to cells. Moderna shrugged off the ruling, stating that its approach and manufacturing processes "have advanced well beyond the technology" in the Arbutus patents. But the PTAB decision rattled investors. 

Perhaps the biggest issue, though, was that investors realized they might have gotten the cart before the horse a bit too much. Yes, Moderna's mRNA-1273 is very promising. However, the company still has no approved product on the market yet. It also faces other rivals in the coronavirus vaccine race, including several much larger drugmakers.

Moderna's valuation at its peak likely seemed exceptionally frothy to some. A $37 billion market cap for a clinical-stage biotech did (and still does) sound absurdly high.

Up, up, and away?

You might think that it's too late to buy Moderna shares even after the pullback in recent weeks. My view, though, is that investing $5,000 right now could still pay off in a huge way over time.

To be sure, Moderna isn't the kind of stock that will appeal to some investors. It's very risky. If mRNA-1273 flops, the biotech's shares will crater.

However, I think the chances of success for mRNA-1273 are pretty good. Moderna expects to know in November how well the investigational vaccine works. Positive interim results would almost certainly spark a big gain for the stock.

More importantly, in my view, is that good news for mRNA-1273 would bode well for the rest of Moderna's pipeline. The company has over a dozen other mRNA candidates in clinical testing. It also recently announced plans to develop a seasonal flu vaccine. Success for mRNA-1273 would go a long way toward validating the potential for Moderna's mRNA approach. 

Maybe this rosy scenario won't unfold for Moderna. But if it does, an investment of $5,000 is going to turn into a lot more than $17,820 over the next few years.