While it might not seem like it, now is the best time to be buying high-quality companies. Some stocks that have been hammered are still executing on a fundamental level, which could allow their stock prices to shoot higher once the overwhelming fear of investing has dissipated. Both MercadoLibre (MELI 1.00%) and PubMatic (PUBM 9.18%) are continuing to execute, and their futures look bright, despite macroeconomic uncertainty. Investors are scared about owning stocks right now, which could create a great buying opportunity for these two companies. 

Person shopping online looking at his phone.

Image source: Getty Images.

1. MercadoLibre

The Latin American e-commerce and payments giant has been crushed recently, falling nearly 64% off its all-time highs set in early 2021. This has brought its valuation down to just 4.5 times sales, the company's lowest valuation since 2009. However, the company's fundamental performance is looking stronger than ever. In Q1 2022 -- which it reported on May 5, 2022 -- the company's total revenue soared 67% year over year on a foreign currency-neutral basis to $2.2 billion. The company also saw increasing adoption from Latin American citizens: The company's unique active users jumped 16% year over year to 81 million.

The company's MercadoEnvios logistics service saw improvements in delivery speeds, with 54% of MercadoLibre products being delivered on the same day or the next day. Nearly 80% of volumes were delivered by Envios within 48 hours, which increased five percentage points year over year.

Meanwhile, its MercadoPago payment service made impressive strides, too, as more customers used Pago to buy things at places other than MercadoLibre's own sites. Off-platform total payment volume soared 139% year over year and represented 68% of total payment volume in Q1.  This shows that Pago is becoming engrained into Latin American society, a great achievement for the long-term future of the company.

Because of this dominance around the region, MercadoLibre has started to become profitable. In Q1, the company reported a net income of $65 million, which soared from a loss of $34 million in the year-ago period. The company is still free cash flow-negative, but this is because the company is seeing a significant ramp-up in its credit business. Mercado Credito saw its credit portfolio jump 319% year over year to $2.4 billion in Q1. But critically, its non-performing loans as a percentage of its total loan portfolio only increased 1.6 percentage points year over year to 27.6% in Q1 -- meaning its bad loans are growing much more slowly than its total loan portfolio.

While those loans add some risk to the business, the company seems to be managing it well. Otherwise, it seems to be firing on all cylinders, and given its rock-bottom price, MercadoLibre looks severely undervalued.

2. PubMatic

PubMatic operates on the sell-side of the advertising technology (adtech) industry, helping those with ad inventory find the best bid from advertisers. PubMatic offers the ad space to thousands of potential advertisers, which boosts the chances of finding the highest bid for that ad space. 

The digital ad market is ramping up fast because of the benefits it provides to advertisers compared to traditional advertising. Advertisers can target specific consumer demographics with digital ads, which cannot be done with billboards, for example. As a result, the global spend on digital ads is expected to soar from $514 billion in 2022 to $627 billion in 2024.

While not the industry leader, PubMatic is one of the top dogs in the space with Q1 revenue growing 25% year over year to $55 million. Comparatively, the largest player on the sell-side, Magnite (MGNI 14.80%), reported Q1 revenue of $118 million. However, this only expanded 15% year over year on a pro forma basis. Magnite is a serial acquirer, meaning that the majority of its revenue expansion comes from the companies that it buys out. With that, the most comparable way to monitor core revenue increases between the companies is with Magnite's pro forma figure. While PubMatic is roughly half the size of Magnite in terms of revenue, it is starting to catch up.

PubMatic expects this success to continue, with revenue guidance projecting 25% year over year growth for the full year. Additionally, the company expects its profitability to improve. In Q1, the company's adjusted EBITDA margin was 31%, but PubMatic expects this to shoot higher to 36% for the full year. This shows that PubMatic is taking advantage of this rapid digital ad expansion on both the top and bottom lines. While a slowdown in the adoption of digital advertising -- perhaps due to a potential recession -- in the short term could cause the company to miss this outlook, the long-term story for advertising seems to suggest digital ads have a bright future.

At 22 times earnings, PubMatic is looking like a steal today compared to Magnite, which trades at a staggering 897 times earnings. The company is riding the tailwinds of a major industry, and it is predicted to gain market share; it sees 25% top-line growth this year, though total digital ad spending marketwide is only expected to grow 17% in 2022. All of this combines for a potentially lucrative long-term investment, which is why I think PubMatic is a company worth owning today.