Technology stocks have been down in the dumps in 2022 -- evident from the 31.7% decline in the Nasdaq-100 Technology Sector index so far -- which means that there is a terrific opportunity for investors to buy some top companies on the cheap right now.

Micron Technology (MU -0.60%) and Roblox (RBLX -3.66%) are two tech stocks that are available at attractive valuations right now following their horrid performance on the market this year.

^NDXT Chart

^NDXT data by YCharts

Let's look at the reasons why investing $50,000 in these stocks could turn out to be a smart move in the long run.

Person in glasses holding a smartphone.

Image source: Getty Images.

1. Micron Technology

Micron Technology stock has shot up roughly 1,100% over the past decade, driven by healthy growth in the company's revenue, margins, and earnings.

MU Chart

MU data by YCharts

The memory specialist's earnings have clocked a compound annual growth rate of 31% over the last five years, and analysts are expecting a similar performance in the next five years as well. However, it won't be surprising to see Micron growing at a faster pace than analysts' expectations, as the size of the market it serves has been growing rapidly.

Micron gets most of its revenue by selling dynamic random access memory (DRAM) chips used in smartphones, personal computers (PCs), data centers, gaming consoles, and graphics cards, among others. In the second quarter of fiscal 2022 (ended March 3), the DRAM business produced 73% of Micron's total revenue, playing a key role in boosting the company's quarterly revenue to $7.79 billion, a 25% year-over-year jump.

The good part is that Micron could keep growing at an impressive pace in the long run. That's because the DRAM market is expected to generate $221 billion in revenue by 2030, according to a third-party estimate. For comparison, the DRAM market was worth an estimated $92.5 billion last year.

Micron is pulling the right strings to take advantage of this secular growth opportunity. The company is focused on increasing its DRAM market share, and the good part is that it is indeed stealing market share over its key rivals. According to TrendForce, Micron's share of the DRAM market increased to 23.8% in the first quarter of 2022 (ended Dec. 2, 2021) from 22.3% in the fourth quarter of 2021 (Ended Sept. 2, 2021). Meanwhile, Samsung and SK Hynix, Micron's key rivals, lost market share on a quarter-over-quarter basis.

Micron could capture a bigger share of the DRAM market as it plans to invest $150 billion in manufacturing and research and development through 2030. So it won't be surprising to see Micron clocking impressive growth in the long run, giving investors' portfolios a nice boost thanks to the growing memory demand and its improving market share.

All this makes Micron a top semiconductor stock to buy right now, especially considering that it is trading at just 8.7 times trailing earnings as compared to the S&P 500's earnings multiple of 20.

2. Roblox

Roblox stock has cratered 72.6% so far in 2022, giving investors an opportunity to buy a potential metaverse winner at an attractive valuation. The company, whose platform can be used for building, operating, and interacting in three-dimensional (3D) virtual worlds, is now trading at 8.4 times sales as compared to last year's sales multiple of 36.

Roblox released its results for the first quarter of 2022 on May 10, posting a 39% year-over-year increase in revenue to $537 million. However, there were signs of a slowdown in the company's business as its bookings fell year over year. The drop in Roblox's bookings, which is the amount of virtual currency that users purchase to spend inside the company's 3D worlds on items such as clothing, accessories, and pets, among others, means that its top-line growth is likely to lose momentum.

But investors should focus on the bigger picture, as Roblox is lapping a period of robust growth. The company's revenue has increased rapidly over the past couple of years thanks to pandemic-driven spending, which means it is facing tough year-over-year comparisons now. Analysts expect Roblox's revenue to increase just 6% this year, but its growth is expected to accelerate in 2023.

That's not surprising, as Roblox is operating in a fast-growing space and has a solid user base that should help it take advantage of the growth of the metaverse. The company reported 53 million daily active users for April, an increase of 23% over the prior year. This impressive user base is the reason why companies have been flocking to Roblox's platform to build their presence in the metaverse.

Additionally, investors shouldn't forget that metaverse users will interact with each other in 3D virtual worlds. This explains why the virtual reality content market is expected to clock an annual growth rate of 47% through 2029 as per a third-party estimate. As Roblox provides a platform for creating and publishing such content through its 29 million developers, the company's addressable market looks set to expand rapidly in the future.

All this indicates that Roblox could turn out to be a top metaverse stock in the long run, which is why investors should consider buying its shares. given its relatively attractive valuation.