The stock market just finished its worst first half in 50 years. Year-to-date, the widely followed S&P 500 index is down 16.7%, while the growth-heavy Nasdaq Composite is down 24.5%. But that also means that investors have a once-in-a-decade opportunity to buy quality stocks at deep discounts.

Two companies that are great buys right now are chip maker Advanced Micro Devices (AMD -0.35%) and gaming platform Roblox (RBLX -3.66%). Here's why these two companies are positioned to make shareholders phenomenal returns over the next 10 years.

1. Advanced Micro Devices

Advanced Micro Devices is a leading maker of central processing units (CPUs) and graphics processing units (GPUs) for data centers, video game consoles, automotive, and PCs. AMD has played second fiddle to Intel and Nvidia for many years, but it has started to prove itself as a viable alternative to Intel in CPUs. The stock has returned 477% over the last five years as it's gained market share against Intel

While Intel still holds a big lead in laptop CPUs, AMD has just about closed the gap in desktops with 45% market share, based on data from PassMark Software. This would suggest that many professionals and gamers who work and play with demanding applications on PCs are choosing AMD, which is a big vote of confidence in the value and performance AMD provides.

AMD still had momentum at the start of the year. In the first quarter, AMD's enterprise, embedded, and semi-custom revenue, which includes chips for video game consoles, nearly doubled year over year, primarily driven by high demand for AMD's EPYC server processors.

The company just completed the acquisition of Xilinx, a leading supplier of adaptive and programmable chips used in a variety of industrial applications. The combination of additional revenue from Xilinx and growth from AMD's core business should grow revenue by 60% in 2022, according to the consensus analyst estimate.

AMD is not short of growth opportunities in high-performance computing. Management estimates its long-term addressable market opportunity at $135 billion, or multiples above the $16 billion of revenue in 2021. The prospects for growth make the stock an absolute bargain trading at just 19.6 times this year's consensus earnings estimate. 

2. Roblox

Roblox operates a social gaming platform for users to play games and communicate with others using their unique digital identity in the form a virtual avatar. The company was already a popular platform before the pandemic with 23 million daily active users in 2019, but the surge in activity as people stayed at home in 2020 gives the company more than twice the base of users to monetize. 

It's free to join the platform, which should keep users growing even during a slowdown in the economy. And Roblox is not just games. It also offers live music events and educational activities to keep users engaged and spending money on content with virtual currency called Robux.

This is a highly profitable business model. Roblox generated $520 million in free cash flow on just over $2 billion of revenue over the last four quarters. The stock has fallen 61% during the market sell-off, and could be a great addition to a well-diversified portfolio as management invests to grow the platform. 

It could also help other brands reach younger audiences. Nike, Alo Yoga, American Eagle Outfitters, and Chipotle Mexican Grill have launched experiences on Roblox. Brands clearly view Roblox as an important channel for them to monetize their own brands, and that could spell lucrative opportunities for the host company as its base of users continues to grow.

As tech companies continue to invest in building the metaverse, investors shouldn't overlook Roblox. But investors should be aware of near-term headwinds. Daily active users recently dipped about 10% from the end of the first quarter through May as the post-pandemic recovery drives people to spend time doing other things besides play games. This should only be a temporary dip, but keep in mind that a prolonged decline in daily active users could weigh on the stock's performance.

That said, the business generates a lot of cash to reinvest in technology and growth initiatives, so the long-term upside is quite substantial. This is the ideal time to buy shares while they are down.