While many growth stocks have fallen significantly in 2022, there's still a lot of speculation priced into many of them -- particularly those that have multi-billion-dollar market caps (some are in the tens of billions) yet are still consistently unprofitable. But this isn't the story for all the growth stocks that have taken severe beatings this year.

A prime example of a highly profitable company that has been lumped into the market's sell-off of fast-growing tech companies is The Trade Desk (TTD 0.85%). The debt-free cash cow's shares are down more than 45% year to date and more than 50% over the past 12 months.

Given the company's impressive profitability and the pullback in its stock price, is now a good time for investors to buy shares of The Trade Desk?

A lucrative tech platform

A glance at The Trade Desk's recent quarterly earnings report might mislead an investor who is only performing surface-level due diligence on the company's profitability. Net income for the period was just $16 million on $395 million of revenue. Even more, that net income was down from $59 million in the year-ago quarter.

The picture is even bleaker for the trailing-nine-month period ended Sept. 30. During this period, The Trade Desk reported a net loss of $18 million, down from a profit of $130 million in the same period last year. What gives? The company has been working through a payout of a well-deserved long-term performance grant to the company's founder and CEO. The Trade Desk's net income was reduced by $66 million and $197 million in the third-quarter and trailing-nine-month periods, respectively, due to CEO Jeff Green's stock-based compensation award.

Adding back The Trade Desk's $66 million to Q3 for a more normalized view of the company's profitability during a holiday quarter, the tech company achieved an adjusted net profit margin of more than 20%. The company, which operates the world's largest independent and objective digital ad-buying platform for the open internet, simply has an extremely lucrative business model.

A long runway

A profitable business model with no debt on its balance sheet is great. But what makes The Trade Desk so special is its ability to achieve this while investing as aggressively as it can in its growth opportunities. Consider how The Trade Desk doesn't have to take its foot off the gas when it comes to its growth plans to achieve its impressive profits. The company's recent investments have led to significant market share gains for the company. Trailing-nine-month revenue has increased 36% year over year.

"I believe that through the first nine months of the year, we have gained more market share, grabbed more land than at any point in our history," said Green during the company's third-quarter earnings call.

Adding fuel to the fire, The Trade Desk has a lot of room for growth. Global marketing spend today is about $700 billion to $750 billion annually, depending on what estimates you reference. The Trade Desk's $6 billion in gross spend on its platform in 2021 is a drop in the bucket relative to this addressable market. Considering how much momentum The Trade Desk has, the company will likely capture a much larger share of this massive market over time.

So should investors take advantage of this highly profitable company's shares selling off so sharply this year? While the stock hasn't necessarily reached bargain territory (shares trade at about 49 times trailing-12-month free cash flow), it is arguably trading low enough to make the growth stock an investment worth betting on. After all, if the digital advertising company can keep up its recent momentum for the foreseeable future, the stock may prove to be significantly undervalued in hindsight. Further, high-quality market leaders like The Trade Desk rarely trade at cheap valuations; waiting around for this to happen, therefore, could prove to be a mistake.