While 2022 was a tough year for investors across a wide variety of sectors, history has shown that those who remain in the market through its ups and downs can reap the rewards of the best days it delivers. The thing is, investors can't predict when those days will be. Rather than jumping in and out of the market to try to capture the best or worst market moments, building your strategy on the basis of consistent investments in wonderful companies can help you generate and build upon portfolio returns through the years. 

If you have $2,000 to invest in the stock market right now -- money that you don't need for bills or other near-term expenses -- here are two top stocks to consider that could go parabolic in the years ahead. 

1. Palantir 

Despite being launched nearly two decades ago, Palantir (PLTR -2.13%) has remained a mystery to many until recently. The company cut its teeth on lucrative contracts for highly secretive government agencies, and counts the Department of Defense, the Central Intelligence Agency, the National Security Agency, the Pentagon, the U.K. Ministry of Defense, and the Federal Bureau of Investigation among its clients.

Palantir is a big data analytics company, whose software is used by everyone from the world's largest intelligence agencies to corporate clients to comb through data sets and promote effective decision outcomes. The company describes its mission in this way "Our products serve as the connective tissue between an organization's data, its analytics capabilities, and operational execution."   

Palantir still derives the bulk of its revenue from government agencies, which rely on its Gotham operating system that was designed specifically for the types of secretive projects these clients require. However, the company is increasingly expanding its stable of commercial clients with its second major offering, its Foundry platform. Some of its well-known commercial clients include names like Merck and Kinder Morgan

So, why is Palantir trading down by nearly 70% over the last year? There are a few reasons. For one, the company has not been immune to the impact of factors like inflation and weak foreign currency. Palantir is also not currently profitable on a generally accepted accounting principles (GAAP) basis, and stock-based compensation remains high.

Investors are also concerned about Palantir's stream of unprofitable special purpose acquisition company (SPAC) investments. While Palantir scaled back this program earlier this year, it had previously invested in a sea of SPACs for multiyear software contracts. However, as start-ups have broadly struggled over the past year in a low-liquidity environment, the value of many of these investments has notably waned. It also didn't help that one well-known SPAC, Fast Radius, in which Palantir invested $20 million, filed for bankruptcy in November.

Even still, Palantir continues to grow its base of powerhouse clients while margins expand and revenue grows. The most recent quarter represented its eighth in a row of positive adjusted free cash flow. Gross profits have risen 140% over the trailing three-year period. The company is also growing increasingly less reliant on government contracts alone. Plus, its opportunity in a vast, total addressable market, which management estimates at $119 billion and increasing, remains unmatched.

Most of Palantir's clients are locked into lengthy, multiyear contracts as well. Considering that a single month's subscription to its software platform Foundry carries a roughly $1 million price tag, it's safe to say that when its clients make a commitment, they're usually in it for the long haul.

In the most recent quarter, Palantir reported total revenue of $478 million, a 22% increase from the year-ago period. Its total customer count rose 66% year over year, driven by a 124% increase in its slate of U.S.-based commercial clients. Meanwhile, U.S. commercial revenue represented a 53% increase from the same period in 2021, while revenue from U.S. government clients rose 23% year over year.  

Wall Street currently estimates that the stock could realize a potential upside as high as 130% over the next 12 months alone. For investors with a healthy appetite for risk, the long-term potential of Palantir's innovative and sticky business model could pose an opportunity that's too good to pass up. A $2,000 investment in Palantir would add about 333 shares to your portfolio right now. 

2. DexCom 

DexCom (DXCM -3.78%) is a medical device stock with a huge competitive advantage as an undefeated leader in the global continuous glucose monitoring (CGM) device market. 

CGM devices are used by both type one and type two diabetics. These devices keep track of patients' glucose levels in order to reduce the risk of adverse blood sugar events and promote effective health decisions.

The total addressable market for these devices is not only massive but growing as the prevalence of diabetes and broader adoption of these devices rise worldwide. In fact, it's estimated that the global CGM market could hit a valuation of $10 billion by the year 2028. To give you an idea of the company's vast footprint, the CGM market hit a worldwide valuation of about $5 billion in 2020, $2 billion of which represented revenues produced by DexCom.

DexCom is not only growing revenue at a rapid clip, but it is profitable as well. The most recent quarter saw its revenues increase by 20% from a year ago to $770 million, while the company generated net income in the amount of $112 million. DexCom also generated free cash flow to the tune of $180 million in the three-month period.

The essential nature of CGM devices gives DexCom's business notable resilience even in a challenging macro environment. The company also just reported another major win with the approval of its latest CGM device, the G7, in the United States.

The rollout of this device, which is already occurring in key markets across Europe, the U.K., and Asia, will further fuel Dexcom's growth in the quarters and years ahead.

Given the company's impressive foothold on the CGM device market, coupled with the fast-growing total addressable market it operates in, it's definitely no stretch of the imagination that DexCom could soar significantly higher from here. Bear in mind, the stock has delivered a total return of about 3,300% over the trailing decade.

Currently, Wall Street estimates place the stock with a potential upside as high as 3% over the next 12 months. A $2,000 investment in the healthcare stock would add 18 shares to your portfolio right now.