Nvidia has become one of the most valuable stocks in the world, with its market cap now north of $3 trillion. In the past 12 months, it has risen by more than 200% as investors remain bullish on the company's long-term prospects.

But investing in stocks at smaller market caps can sometimes yield better gains for investors. Three stocks with much smaller valuations than Nvidia and have outperformed the chipmaker in the past 12 months: Vertiv Holdings (VRT -0.36%), Coinbase Global (COIN -0.79%), and Carvana (CVNA -3.13%).

Here's a closer look at why these stocks have been rallying and whether they can continue to be good buys moving forward.

1. Vertiv Holdings

Vertiv has a valuation of $34 billion and is nowhere near Nvidia's market cap, even with its superior 297% gains over the past 12 months. The tech company is involved in data centers and providing critical IT infrastructure, which is a key reason it has been doing so well and why investors have been bullish on Vertiv. It benefited from interest in artificial intelligence and its liquid cooling services, which help ensure computing operations are smooth even under high loads.

In the company's most recent earnings report (which ended on March 31), Vertiv reported 60% organic order growth. Actual net sales of $1.6 billion grew by a rate of 8% year over year, and its operating profit of $203 million soared by 55% from the same period last year. For 2024, the company projects that its top line will total at least $7.5 billion, which would result in an organic growth rate of more than 11%.

At a price/earnings-to-growth (PEG) ratio of less than 1, the stock looks cheap, and investors are optimistic that there could be much more growth ahead for Vertiv. Given the need for greater care and maintenance for data centers in the future, this could be a good stock for growth-oriented investors to add to their portfolios for the long run.

2. Coinbase Global

Coinbase has a higher valuation at $60 billion, and its shares are up 340% in the past year. The driving force has been the excitement around Bitcoin and digital currencies in general. A big catalyst earlier this year was the approval of spot bitcoin exchange-traded funds (ETFs), which made investors bullish on the prospects for even greater interest in crypto.

The more activity there is for crypto, the better the growth prospects look for Coinbase, which runs a top cryptocurrency exchange platform. Through the first three months of the year, the company's sales totaled $1.6 billion -- more than double the $773 million it reported during the same period a year ago. Coinbase also posted a strong profit of nearly $1.2 billion (compared with a loss of $79 million last year) as it enjoyed strong crypto-related gains.

Coinbase is likely to remain volatile, as it will depend on not just interest in crypto, but also on the valuation of Bitcoin and other assets it has exposure to. As a result, this is a type of investment that may be more suitable for crypto enthusiasts and investors with a high risk tolerance. It's not an investment I would expect to consistently outperform Nvidia.

3. Carvana

Carvana's stock has given back some gains recently, but even with a dip, its 12-month return remains an impressive 330%. The company makes it easy for people to buy used cars online. But concerns about the economy and rising interest rates soured investors on the stock in 2022, when its share price plummeted by 98%.

Although interest rates remain high, the stock's significantly reduced valuation likely played a role in investors being more willing to take a chance on the business. The company also gave investors some hope by posting a surprise profit in the first quarter of 2024, with net income totaling $49 million for the period ending March 31. Many investors were fearing much worse results given the current economic conditions.

Carvana's market cap is $12 billion, making it the least valuable stock on this list. While it is much more valuable than it was a year ago, the uncertainty ahead for the business is what makes it a risky and highly speculative stock to own right now. Interest rates are likely to come down in the future, but it's still debatable when that will happen. Meanwhile, the stock trades at more than 40 times its earnings and book value.

This is an example of another investment which likely won't be suitable for risk-averse investors. Although Carvana stock outperformed Nvidia in the past year, that's not a trend I would expect to be sustainable in the long run.