Investors have become increasingly pessimistic over the past year, worried that runaway inflation would cause the economy to sink into a recession. That concern has been amplified by a series of aggressive rate hikes from the Federal Reserve, and the stock market has fallen sharply as a result. The S&P 500 is now down 23% from its high, and the Nasdaq Composite is down 34%, putting both indexes in a bear market.

Fortunately, there is a silver lining to that carnage. E-commerce leaders Amazon (AMZN 0.01%) and MercadoLibre (MELI 0.19%) have seen their share prices fall sharply. Both stocks have lost more value during the current downturn than at any other point in the past 10 years. That means investors have a once-in-a-decade buying opportunity.

Here's why the future looks bright for both companies.

1. Amazon: The most innovative cloud computing company

High inflation has caused Amazon to stumble this year. Consumer demand has dropped in response to rising prices, but costs related to fulfillment, logistics, and data centers have soared (e.g., fuel, labor, and electricity). Collectively, those inflationary headwinds led to a disappointing financial performance over the past year. Revenue rose just 10%, and earnings plunged 61%.

Some investors have interpreted those results as a crack in Amazon's armor, but the underlying businesses are still rock-solid. Amazon still operates the most popular e-commerce marketplace in the world, and eMarketer says the company will account for 40% of online retail sales in the U.S. this year -- more than the next 14 retailers combined. Moreover, costs related to its logistics operations may have been a headwind in the past year, but that infrastructure is still a key advantage. It allows Amazon to simplify fulfillment for sellers and provide reliable delivery for buyers.

Additionally, Amazon Web Services (AWS) dominates the cloud computing market, an industry with much higher margins than retail. AWS currently holds a 34% market share in cloud infrastructure -- more than Microsoft Azure and Alphabet's Google Cloud put together -- and it was recently named the cloud innovation leader by research company Gartner. That advantage should keep it ahead of the pack for years to come. With that in mind, the cloud computing market is expected to grow at nearly 16% annually to reach $1.5 trillion by 2030, according to Grand View Research.

That said, Amazon's opportunity in cloud computing runs deeper than revenue growth. Over the past year, AWS achieved an operating margin of 31.1% -- severalfold higher than the typical operating margin in Amazon's retail segments -- meaning Amazon as a whole should become more profitable as AWS represents more of total revenue. And that trend is indeed playing out: AWS delivered 37% sales growth over the past year, easily outpacing Amazon's retail segments.

Currently, shares trade at 2.4 times sales, a sizable discount to the five-year average of 3.8 times sales. That's why investors should take advantage of this once-in-a-decade buying opportunity.

2. MercadoLibre: The e-commerce trailblazer in Latin America

Two decades have passed since e-commerce pioneer MercadoLibre launched its online marketplace in Latin America. Since then, it has parlayed its first-mover status into a more durable competitive advantage, becoming the most-visited online shopping destination in the region.

MercadoLibre now operates an expansive logistics network through Mercado Envios. The company handled 91% of total shipping volume in the second quarter, and nearly 80% of those items were delivered within 48 hours. Similar to Amazon, fulfillment services provided by Mercado Envios make the MercadoLibre marketplace stickier for merchants, while fast and reliable deliveries keep consumers coming back for more.

MercadoLibre has also capitalized on low bank account and debit card penetration among Latin American consumers. Its fintech business, Mercado Pago, operates the third-most-popular digital wallet in Latin America, and the company has seen tremendous success with adjacent services like merchant loans, consumer loans, and credit cards. Mercado Pago's credit portfolio jumped 230% over the past year.

Financially, MercadoLibre is firing on all cylinders. Revenue climbed 60% to $8.8 billion over the past year, and the company generated nearly $1.1 billion in free cash flow, up more than fivefold from $181 million in the prior year. But investors have good reason to believe that momentum can continue, as MercadoLibre has only scratched the surface of its potential.

The MercadoLibre marketplace facilitated $28 billion in sales in 2021, but e-commerce sales across the countries in which it operates will reach $259 billion by 2025, according to Statista. Similarly, Mercado Pago handled $77 billion in payments in 2021, but digital payment volume will reach $511 billion by 2027, according to Statista.

Currently, shares trade at 4.8 times sales, an absolute bargain compared to the five-year average of 13.1 times. That's why this growth stock is worth buying in the current bear market.