With the market off to a positive start to 2023, investors are probably looking for new stocks to add to their portfolios in hopes of riding the momentum. And it's always a good idea to search the investable landscape for new ideas. You never know when a high-quality compounder might be selling at an attractive valuation. 

Speaking of a compounder stock, there's one on sale that investors should be eyeing closely. Amazon's (AMZN -2.33%) market cap is down 45% from its all-time high to $1.05 trillion. Here's why the tech giant is a magnificent stock to buy now. 

Trading at a sizable discount 

In the wake of that deep price slide, Amazon shares are trading hands at a price-to-sales ratio of just over 2. This is substantially cheaper than its five-year average ratio of 3.6, and near the cheapest the stock has been during that time.

Its pressured valuation makes sense, given that Amazon, like every other business, is dealing with a troubled macroeconomic environment. Last year's rapidly rising interest rates were a huge headwind for valuations, especially for popular tech-related stocks.

Moreover, the economic picture has fundamentally hurt Amazon's operations. In 2022, net sales rose by just 9% to $514 billion. This was a dramatic slowdown from its 38% growth in 2020 and its 22% growth in 2021. Amazon also posted a net loss of $2.7 billion last year -- its first net loss since 2014. 

Inflation is hurting consumers, which negatively impacts Amazon's retail operations. And enterprises are trying to find ways to optimize costs when it comes to their cloud spending, which is hurting Amazon Prime Services (AWS). In fact, AWS's year-over-year sales gains decelerated in each quarter of 2022. 

In response to the tough environment, management decided to lay off more than 27,000 people over the past several months, and the company has paused construction of its second headquarters. While layoffs are always difficult, investors can rest assured knowing that CEO Andy Jassy and his team are rightsizing the business to better match the economic climate. 

Major growth engines 

Despite these challenges, which I expect will prove to be temporary, Amazon is benefiting from major secular growth trends that will continue bolstering its business in the years ahead. Economic cycles can affect even the most promising industries, but over the long term, it's hard to argue against the sustainability of the technological shifts that are happening. In Amazon's case, the shifts that apply include e-commerce, cloud computing, and digital advertising, all of which should reaccelerate once the macro picture improves.  

As the leading online shopping destination in the U.S., Amazon will continue to spearhead the shift in consumer behavior from in-person shopping to e-commerce. Because consumer spending is such a massive part of the U.S. economy, it is most impacted in recessionary or inflationary scenarios. But Amazon will benefit when the economy eventually improves. 

When it comes to cloud computing infrastructure, Amazon is the market leader with AWS. In 2022, this segment generated $80.1 billion in revenue with an operating margin of more than 28%. There are estimates the cloud computing market will be worth more than $1.5 trillion by 2030. It's hard to envision a world in which Amazon doesn't continue to capitalize on this trend.

Lastly, Amazon's burgeoning under-the-radar segment is digital advertising, which brought in $38 billion in revenue last year. With so much internet traffic going to the company's website, it's not a surprise that ads became a booming part of the business. It's a good sign to see management capitalizing on this opportunity. 

A decade from now, as a result of these major growth drivers, it's likely that Amazon will be a much bigger company than it is today. Consequently, investors would be smart to seriously consider adding the stock to their portfolios.