Inflation has cooled dramatically over the past year, and consumers are spending money more freely. U.S. economic growth accelerated in the second quarter due in part to a modest uptick in consumer purchases, and that momentum seems to be intensifying in the current quarter. Retail sales rose for the fourth consecutive month in July, and consumer sentiment clocked in close to a two-year high in August, according to the University of Michigan.

That optimism bodes well for the entire economy, though it has especially positive implications for commerce companies like Shopify (SHOP 1.11%) and Etsy (ETSY 0.34%). But there is another dynamic at play. Given the momentum behind the economy, it should come as no surprise that the S&P 500 (^GSPC 1.02%) is just 9% from a record high, the point at which even the most conservative analysts would call a new bull market.

Why does that matter? The S&P 500 returned an average of 186% during the last nine bull markets, so many stocks will undoubtedly soar during the next one. Here's why Shopify and Etsy could be part of that number.

1. Shopify

Shopify impressed Wall Street with its second-quarter report, beating estimates on the top and bottom lines. Revenue soared 31% to $1.7 billion, a material improvement from 16% growth in the prior year, and non-GAAP net income improved to $0.14 per diluted share, up from a loss of $0.03 per diluted share. Investors have good reason to believe that momentum will persist, especially as the economy continues to regain its momentum.

The investment thesis for Shopify centers on scale and a hard-to-replicate product ecosystem. Specifically, Shopify is the market leader in e-commerce software and omnichannel-commerce software, and its platform powered 10% of retail e-commerce sales in the U.S. last year, second only to Amazon. That success points to an uncommon (if not unique) ability to empower merchants.

Shopify offers a turnkey solution for commerce. Its software helps merchants manage their businesses across physical and digital sales channels, including online marketplaces like Amazon and Etsy, social media like TikTok, and direct-to-consumer websites. The company also provides adjacent solutions for marketing, payments, and logistics, as well as more advanced tools for enterprise customers, such as wholesale-commerce functionality.

Shopify is well positioned to create value for shareholders. Global e-commerce software sales are projected to increase 16% annually through 2030. That hints at strong growth in subscription revenue. Meanwhile, retail e-commerce sales are forecasted to increase at 8% annually through 2030, and wholesale e-commerce sales are expected to increase at 20% annually during the same period. That hints at strong growth in services revenue.

Indeed, Morgan Stanley analyst Keith Weiss believes Shopify could earn $25 billion in annual revenue by 2030, which implies annualized growth of 20% through the end of the decade. That makes its current valuation of 10.8 time sales look quite reasonable, and it's certainly a discount to the three-year average of 28.8 times sales. Investors should feel confident in buying a small position in this growth stock today.

2. Etsy

Etsy reported lackluster results in Q2. Gross merchandise sales (GMS) fell 1%, and GMS per active buyer dipped 5% amid lingering consumer softness. In turn, revenue rose just 7% to $629 million, and net income according to generally accepted accounting principles (GAAP) fell 12% to $0.45 per diluted share. But management also provided some upbeat commentary. Spend per active buyer stabilized sequentially, and GMS growth turned positive toward the end of the quarter, and both trends could intensify as the broader economy regains its momentum.

The investment thesis for Etsy centers on brand differentiation. The e-commerce market is highly competitive, but Etsy has distinguished itself as a purveyor of non-commoditized goods by catering to millions of small sellers. Its marketplace features artisanal, vintage, and often customizable items, creating a shopping experience that buyers are unlikely to find elsewhere.

That strategy has certainly paid off. Etsy is the sixth most visited online marketplace in the world. But its full potential is as yet untapped. Management currently values its addressable market at $466 billion but says that figure could reach $2 trillion in the future as more products are sold online. In any case, Etsy is taking sensible steps to reaccelerate growth and capitalize on its sizable market opportunity.

One focus area is improving search and discovery. Etsy is using artificial intelligence (AI) to personalize search results and prioritize quality products, and management is confident those efforts will improve the buyer experience, which itself could boost engagement. But Etsy still has an ambitious product road map. CEO Josh Silverman recently discussed plans to make search more conversational with generative AI. That could radically change the nature of the marketplace and greatly improve the buyer experience. For instance, rather than scouring the platform for red dresses, a buyer could ask the AI to recommend trendy red dresses suited to a cocktail bar.

Currently, shares trade at 3.8 times sales, a bargain compared to the three-year average of 10 times sales. Investors would do well to buy a small position in this undervalued growth stock.