When examined over extended periods, Wall Street is a veritable money machine. Even accounting for inevitable down years, the stock market has handily outpaced bonds, gold, oil, and housing in the return department on an annualized basis.

The not-so-subtle secret to this outperformance is time. Patience is an incredible ally for investors that can compound their gains. The biggest challenge is simply finding game-changing businesses that have the ability to create life-altering wealth.

The good news is that these game changers do exist. What follows are four magnificent growth stocks that can build generational wealth by 2040.

A grandparent giving their grandchild a piggyback ride while walking through a park.

Image source: Getty Images.

Etsy

The first amazing growth stock that can be the gift that keeps on giving to patient investors' portfolios is e-commerce platform Etsy (ETSY 0.34%). Even though e-commerce is a highly competitive space, Etsy has well-defined operating advantages that should afford it a sustained double-digit growth rate throughout the remainder of this decade, if not well beyond.

When most people think of online retail sales, Amazon comes to mind. While it's true that Amazon is the dominant force in e-commerce, it's entire focus is on volume and retaining customers within its ecosystem of ancillary products and services. By comparison, Etsy's online marketplace is built atop the success of self-proprietors and small businesses that are focused on personalizing products and services for consumers. There simply isn't a company at scale that can deliver the level of personalization that Etsy's merchants can bring to the table.

In addition to standing out in a highly competitive industry, Etsy has been incredibly successful at empowering its merchants and encouraging consumers to open their wallets more frequently.

With regard to the former, Etsy hasn't been shy about reinvesting in its platform. It's constantly looking for ways to enhance data-tracking tools for the merchants that support its marketplace, and is utilizing artificial intelligence (AI) to improve search functionality for motivated shoppers.

These investments are clearly paying off. Over the trailing four years, ended Sept. 30, 2023, the number of habitual buyers has surged exactly 200%! Habitual buyers are defined as shoppers who make six (or more) purchases over the trailing-12-month period, with the aggregate of these buys totaling at least $200. Habitual buyers are what help fuel Etsy's pricing power with merchants.

Etsy is expected to deliver a 16% annualized earnings growth rate over the next five years, and may see this growth rate accelerate further if its investments in AI-driven search pay off.

Lovesac

A second magnificent growth stock that can help you generate life-altering wealth by 2040 is furniture retailer Lovesac (LOVE -0.05%). Though furniture companies are traditionally slow-growing and highly dependent on foot traffic into physical stores, Lovesac is completely changing the perception of this stodgy industry.

The biggest differentiating factor for Lovesac is its furniture. While it was originally known for its beanbag-styled chairs called "sacs," nearly 90% of the company's net sales now come from "sactionals" -- modular couches that can be rearranged a variety of ways to fit most living spaces.

On top of superior functionality, sactionals have over 200 different cover choices, come with an assortment of upgrade options (e.g., built-in wireless charging stations and/or surround sound), and the yarn used in their production is made from recycled plastic water bottles. It's a unique product that has no comparison.

As you may have guessed, uniqueness comes with a price. Sactionals are typically going to be pricier than a traditional sectional couch. But this is perfectly fine with Lovesac's management team. In fact, Lovesac is specifically targeting a middle-to-upper-income consumer with its products. Well-to-do consumers are less likely to change their buying habits if the inflation rate picks up or the U.S. economy "hiccups." This should help the company navigate economic downturns far better than its peers.

Another key difference for Lovesac is its omnichannel sales platform. During the height of the COVID-19 pandemic, Lovesac was able to shift a significant percentage of its sales to online channels. When coupled with its popup showrooms and handful of brand-name partnerships, Lovesac has the means to go beyond brick-and-mortar stores to generate sales and increase brand awareness. It also sports less in the way of overhead expenses than its peers.

Lovesac is a small-cap company with big-cap aspirations by 2040.

PubMatic

The third unparalleled growth stock capable of producing game-changing wealth for patient investors by 2040 is adtech company PubMatic (PUBM 1.75%).

Advertising companies are cyclical, and PubMatic is no exception. When economic downturns occur, the expectation is for ad spending to slow. The thing is, recessions are short-lived. Three-quarters of U.S. recessions following World War II haven't lasted 12 months. By comparison, most economic expansions have endured multiple years, with two lasting a decade. PubMatic finds itself in an industry that disproportionately benefits from long-winded expansions.

Additionally, PubMatic is at the center of the fastest-growing niche of the ad industry: digital advertising. It's a sell-side platform (SSP) that helps publishers sell their digital display space to advertisers. With a core focus on mobile, video, and connected TV, PubMatic has multiple channels capable of double-digit annualized sales growth for a long time to come.

Something else worth adding is that there's been quite a bit of consolidation in the SSP arena in recent years. With few reputable SSPs still around, PubMatic has been able to roughly double its market share to a range of 4% to 4.5%. The company's management team believes PubMatic has a path to an eventual 20% share of the sell-side market.

Another advantage for PubMatic is its prescient choice to design and develop its own cloud-based infrastructure. Not having to rely on a third-party platform will come in especially handy as the company's sales ramp up. Specifically, it'll be keeping more of its revenue, which should result in a superior operating margin, relative to its peers.

The icing on the cake for PubMatic is its pristine balance sheet. The company closed out September with $171.4 million in cash, cash equivalents, and marketable securities, with no debt. This gives PubMatic exceptional financial flexibility to grow its platform.

An engineer checking the wires and switches of a data center server tower.

Image source: Getty Images.

Fastly

A fourth magnificent growth stock that can build generational wealth by 2040 is none other than edge computing company Fastly (FSLY 4.43%). Fastly is best-known for its content delivery network (CDN), which moves data from the edge of the cloud to end users as quickly and securely as possible.

The single biggest catalyst for Fastly is the steady shift of data online and into the cloud by businesses. The rise of the data-center economy and AI in the wake of the COVID-19 pandemic suggests that CDNs are only getting busier as time passes. That's excellent news for Fastly, whose platform is usage driven (i.e., more data consumed by end users should equate to higher gross profit for the company).

Though Fastly's stock came under pressure in 2022 due to widening losses, many of the company's key performance indicators are steadily improving. Since the end of 2021, Fastly has added 172 customers (80 of which are enterprise clients), expanded the capacity of its global network by 58%, and seen average spend per enterprise customer jump from $704,000 to $832,000.

Most importantly, the company's dollar-based net expansion rate (DBNER) has been steady between 118% and 123% for eight consecutive quarters, with an annual revenue retention rate of 99.2%. What DBNER tells investors is that existing clients are spending between 18% and 23% more on a year-over-year basis. Meanwhile, enterprise customers are broadly sticking with the platform.

Long-term investors should also be excited about the hiring of Todd Nightingale as CEO (effective as of September 2022). Nightingale came over from Cisco Systems, where he was the executive vice president and general manager of Enterprise Networking and Cloud. Though he has keen knowledge of opportunities that lie ahead for Fastly, it's his cost-cutting ability that's proved invaluable, thus far.

Fastly looks to be nearing recurring profitability, and Wall Street analysts have pegged the company for an annualized earnings growth rate of 30% over the next five years. It has all the tools necessary to be a portfolio game-changer by 2040.