If you are more than 10 years away from retirement, finding companies that have the potential to provide life-changing returns is a key strategy to having a good retirement. However, stocks that have this potential are risky and should make up only a small portion of your portfolio.

If you have the ability to buy small amounts of Latch (NASDAQ:LTCH) and PubMatic (NASDAQ:PUBM) and hold them for decades in a diversified portfolio, you might end up with two stocks that change your life in retirement. Here's why.

Smiling couple sitting on a porch.

Image source: Getty Images.

Spreading like wildfire

Latch is seeing rapid adoption of its smart locks for large apartment complexes across the United States. Today, more than 30% of new apartment buildings are being built with Latch locks installed. The sleek, keyless locks make it easier for large-scale apartment managers and tenants to ensure safety in their buildings. However, it's not Latch's hardware that has 100x opportunity -- it's the software.

Latch provides software that can give apartment managers a birds-eye view of all of their apartment buildings. With LatchOS, apartment managers can use their mobile devices to monitor their properties for suspicious activity (like a tenant's access code being used at midnight when that tenant is on vacation) or let in service workers like dog walkers and delivery people.

Latch hasn't lost a single customer since 2017, likely because the locks are incredibly difficult to remove once they are installed, both in terms of time, money, and labor, especially in an apartment complex with 50 apartments. What's more, Latch offers additional services -- like Delivery Management, which allows deliverers to safely and securely drop off packages for tenants -- that deepen customer relationships and have resulted in customers' willingness to spend 54% more today than they did last year.

Latch's bookings reached $96 million in the third quarter of 2021, representing 181% year-over-year growth. Bookings represent the amount of money that apartment builders promise to pay in hardware and software when the building is built, so it can take up to 24 months to turn bookings into revenue. This is why the company had almost $100 million in bookings in Q3 but just $11 million in actual revenue.

The main risk with the company is that it's losing three times its revenue, but Latch's path to profitability is quite clear. Today, 80% of Latch's revenue comes from hardware, its locks, which the company sells at a loss.

The real kicker for the company is the revenue from its software subscriptions, which currently last up to 10 years. Because the company is so young, its software revenue has yet to compound. However, as more buildings finish construction and pay software revenue, which has a gross margin of 91%, its net loss should improve.

What makes Latch stand out is that it is the only company offering this particular software and hardware mix. Many smart-home companies are focused on standalone offerings, but no competitor has the mix that Latch does. This wide offering is what brings in customers, and the immense switching costs are what get them to stay.

Latch is partnered with some of the biggest names in real estate, like Brookfield (NYSE:BAM) and Avalon Bay (NYSE:AVB), and I believe these relationships will propel the company forward. At just a $1 billion market capitalization, I think this stock could skyrocket.

The Trade Desk of sell-side adtech

While The Trade Desk (NASDAQ:TTD) helps advertisers find ad space online, PubMatic is on the other side of the transaction. It helps publishers find companies looking to advertise, often working with The Trade Desk to do so.

Magnite (NASDAQ:MGNI) is the market leader on the sell side, but PubMatic has plenty of competitive advantages that could allow it to jump over Magnite. First, PubMatic operates its own tech stack, meaning instead of relying on third parties to manage the data they receive from customers and consumers, the company handles it in-house. This has led to PubMatic having incredibly low operating expenses, resulting in a positive bottom line despite being just a $2 billion company.

The second advantage that PubMatic has is its Identity Hub. The Identity Hub allows PubMatic's publishers to input consumer information given to them -- for instance, an email address -- into the Identity Hub. Then, publishers get access to a dozen of the leading cookie-less identifier solutions, including The Trade Desk's UID2, which is quickly becoming the cookie-less industry standard.

Since large enterprises have begun setting regulations banning cookies from their sites, cookieless solutions and identifiers are looking like the new way adtech companies can obtain data on consumers. Unlike cookies, this maintains consumers' privacy. Companies like PubMatic and The Trade Desk saw this and were early adopters, leaving competitors that didn't innovate -- like Magnite -- to play catch up.

PubMatic's Identity Hub has allowed the company to find plenty of success in the market. Of its revenue, 66% had alternative identifiers, and considering PubMatic is the only company offering this on a wide scale, it's getting all the customers. PubMatic's partnerships with solutions like UID2 incentivize publishers to use and stick with PubMatic rather than jump ship whenever Magnite fully scales its cookie-less solution.

Its Identity Hub is why I think PubMatic could overtake Magnite -- and then soar even farther. Its self-made infrastructure may also allow PubMatic to capitalize on the rapid growth it could experience and continue innovating. Because of this, if PubMatic can see continued growth from its Identity Hub, I think the company has multi-bagger potential.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.