The market has discounted plenty of stocks over the past year. But while investors have felt the impact of 2022's volatility on their portfolios, down periods like this one have generally proven to be some of the best times to snatch up wonderful stocks. 

If you have $1,000 that you're able to invest right now -- money that you don't need for covering immediate expenses, paying down debt, or building an emergency fund -- here are two fantastic stocks to consider adding to your portfolio before the year is out. 

1. Vertex Pharmaceuticals

Vertex Pharmaceuticals (VRTX 0.73%) has a long and consistent history of growing its revenue and earnings from its impressive portfolio of blockbuster drugs. The company's portfolio and pipeline are focused entirely on the rare disease drug market, a space that analysts estimate will be worth $340 billion by 2030.  

Its current portfolio of approved therapies consists entirely of drugs that treat the genetic disease cystic fibrosis. These drugs are part of a class of therapies called CFTR modulators, which are designed to help target the underlying mutation that causes someone to develop cystic fibrosis. While certain portions of the cystic fibrosis patient population are unable to take CFTR modulators -- either because they wouldn't benefit from them or because they would suffer from harmful drug interactions -- these treatments can significantly improve outcomes and even mortality for the vast majority of individuals with the disease. 

Vertex controls the lion's share of the cystic fibrosis treatment market. When its top-selling product, the triple-drug therapy Trikafta, was approved a few years ago, the approval covered more than 90% of cystic fibrosis patients. Not only does Vertex continue to garner expanded approvals for each of its existing therapies, including for pediatric patients, but it's also working on a drug with Moderna that leverages mRNA technology and is specifically designed for cystic fibrosis patients who are unable to take CFTR modulators. 

Meanwhile, its impressive product portfolio could soon see the addition of another drug with a multibillion-dollar market opportunity. Vertex Pharmaceuticals is currently seeking regulatory approval for exa-cel, a therapy that could be a one-time functional cure for transfusion-dependent beta-thalassemia and severe sickle cell disease, both of which are rare blood disorders. 

In the third quarter alone, Vertex's revenue rose 18% from the year-ago period while its net income and operating income jumped by 9% and 7% year over year, respectively. Meanwhile, the stock is up about 36% year to date. Vertex's existing portfolio and pipeline, coupled with its ability to rapidly expand its footprint in under-served disease markets, make this profitable company a compelling buy in any market environment.

Considering this healthcare stock's incredible long-term potential, it looks like a steal at its current price-to-sales (P/S) ratio of 9.  

2. Etsy 

Etsy's (ETSY -3.06%) share price is down by 40% over the last 12 months, and the stock currently trades at a P/S ratio of about 7. However, that share price plunge doesn't negate the underlying strength and long-term growth potential of Etsy's business. 

Its revenue and profits soared in the early phases of the pandemic. With so many people staying at home for prolonged periods, online shopping volumes were magnified, and Etsy was one of many beneficiaries.

However, e-commerce was growing at a rapid clip before the pandemic, and despite the curtailed spending habits of consumers in the current macroeconomic environment, a study by consulting firm SkyQuest still forecasts that the global e-commerce market will grow to a value of almost $59 trillion by 2028.

As for Etsy, its growth didn't start with the pandemic either. While its growth has decelerated relative to the earlier stages of the pandemic, it's still seeing rapid business growth compared to pre-pandemic levels.  

In its most recently reported quarter, Etsy had 100% more buyers on its platform than it did in the same quarter of 2019. And over the 12-month period that ended Sept. 30, Etsy generated 33% more gross merchandise sales per active buyer than it did in the same time frame from 2019. While Etsy reported a net loss in Q3 2022, largely due to a one-time impairment charge of $1 billion to write down the value of its 2021 acquisition of Depop, its revenue was up 12% year over year to $600 million while gross merchandise sales rose nearly 1% on a currency-neutral basis to $3 billion.

It's also worth noting that Etsy boasts a rare competitive advantage compared to most e-commerce stocks due to the segment of the market in which it operates. The company has built its entire platform around selling handmade, specialty, and unique goods that consumers would be hard-pressed to find online elsewhere. That strategy has served Etsy well, and can continue to do so over the next decade and beyond.