You don't have to look far to find tech stocks that have been beaten severely. The tech-laden Nasdaq Composite index has tumbled around 25% this year, and many of its components have been hit even harder.

It might feel like a lousy time to buy stocks, but sinking stock markets are great places to look for bargain opportunities. Shares of Paypal (PYPL -0.40%) and PubMatic (PUBM -0.28%) are down 44% and 61%, respectively, since the beginning of 2022. This is a little surprising because both have the means to produce tremendous gains over the long run.

Pensive investor looking at a stock chart on a laptop in a home office.

Image source: Getty Images.

PubMatic

PubMatic is an up-and-coming player in the digital advertising revolution, and it's rapidly gaining market share in a space dominated by sprawling industry titans Facebook and Alphabet. Unlike the giants it competes with, Pubmatic's business is entirely focused on connecting buyers of advertising inventory with a growing list of partnered publishers.

Pubmatic's independence is a big draw for publishers who don't want their ad dollars to fuel the gigantic businesses that they have to compete with to get our attention. Connected television (CTV) operators that compete with Alphabet's YouTube are stampeding through Pubmatic's doors. The company currently monetizes inventory from 176 CTV publishers.

At the moment, CTV is Pubmatic's most important growth driver, with first-quarter revenue that rose more than 400% year over year.

With a growing network of content creators, Pubmatic is increasingly attractive to big-brand advertisers that keep diverting their budgets away from traditional media. First-quarter revenue soared 25% year over year to $54.6 million, and the company's asset-light operation is highly profitable. Cash from operations came in at $19.3 million -- 35% of top-line revenue.

Pubmatic is hardly even scratching the surface of its total addressable market. Global spending on CTV ads in 2022 is expected to reach $20 billion and climb to $32 billion by 2026.

At the moment, the market appears too preoccupied with war, inflation, and Elon Musk to notice how far this promising stock has fallen. At recent prices, you can buy Pubmatic stock for just 19.8 times trailing free cash flow. That's an unimaginably low price for a profitable company with a growing competitive advantage in the enormous market for programmatic advertising.

PayPal

This payment processor has lost a lot more ground than Pubmatic this year because user growth hasn't been as strong as investors are used to. At the end of the first quarter, the number of active PayPal accounts was just 9% higher than it was a year earlier.

PayPal also upset markets by lowering the expectations it laid out three months earlier for total payment volume (TPV). Now the company expects TPV to rise between 11% and 13% in 2022.

Looking at PayPal's valuation, you might think the company was losing customers, when it's actually growing at an impressive pace. If we exclude fluctuating foreign exchange rates and the recent loss of eBay's business, PayPal has grown TPV at a compound annual growth rate of 29% over the past three years.

With 429 million active accounts, 35 million of which are merchants, the ubiquitous payment processor isn't exactly losing ground in the payment processing space, as its stock price suggests. At recent prices, you can buy PayPal for just 18.6 times trailing free cash flow.

PayPal generated a whopping $5.4 billion in free cash flow last year, and it's on pace to record more. This gives the company heaps of financial flexibility to make strategic acquisitions and remain competitive. It also gives it a chance to return cash to investors in the form of share buybacks.