On Feb. 15, advertising-technology (adtech) company The Trade Desk (TTD 3.85%) released financial results for the fourth quarter of 2022, and the market loved it. With strong results, it's not surprising that management took a victory lap during its conference call with analysts.

Founder and CEO Jeff Green said: "According to estimates by Dentsu, total global ad spend increased 8% last year. Spend on our platform grew more than three times that." That's a big statement, and it shows why The Trade Desk stock may be a buy. 

How is The Trade Desk growing so much?

In 2019, The Trade Desk generated revenue of $661 million. In 2022, the company generated revenue of almost $1.6 billion -- up 139% in just three years. With growth like this, I assumed it was largely growing via acquiring new customers. However, I assumed wrong.

The Trade Desk's clients are primarily advertising agencies. These agencies may allocate portions of their budgets to the programmatic digital advertising services that The Trade Desk provides -- but just a portion.

At the end of 2019, filings with the Securities and Exchange Commission (SEC) show that The Trade Desk had 820 clients at the time. By comparison, the company had around 1,000 clients at the end of 2022. In other words, it's only increased its client base by 22% over this three-year span.

The takeaway is obvious: The Trade Desk's clients spent a lot more on average in 2022 than they did in 2019. Their budgets shifted.

One-year results tell an even more compelling budget-shift story. At the end of 2021, The Trade Desk already had around 980 clients. Therefore, its client base only increased about 2% year over year in 2022. However, full-year revenue was up 32%, continuing its history of impressive gains since the company went public.

Chart showing rise in The Trade Desk's revenue since 2017.

TTD Revenue (TTM) data by YCharts

Is The Trade Desk stock a buy?

I believe it's easy to overlook how strong a foundation The Trade Desk has for future growth. In Q4, Green also had this to say: "With uncertain macro conditions, where most marketers are under pressure to do more with less, we continue to outperform and gain share."

Green later said: "With The Trade Desk and the open Internet, marketers can measure [return on investment] and value with more objectivity." In other words, the company already has an impressive clientele list and strong platform. And as it proves its merits among its existing clients, dollars shift to its platform. That's why revenue is soaring.

It's reasonable to assume the shift will continue in coming years, and connected TV (CTV) should be a powerful driver. According to The Trade Desk's management, its product already reaches 120 million CTV devices. Again, this is a strong foundation ready to support robust growth as existing customers choose to direct their budgets to this advertising medium. 

All of this points to The Trade Desk being a very investable company. And I believe financial results in 2022 confirm that it's a stock worth buying for the long haul.

However, there is one caveat worth mentioning. Many investors agree that The Trade Desk is a great company, and there's a lot of demand for the stock, as evidenced by its pricey valuation. 

Chart showing The Trade Desk's PS ratio falling since 2021.

TTD PS Ratio data by YCharts

With a price-to-sales (P/S) valuation of 18, The Trade Desk's valuation has fallen by more than 70% from its peak, which is good. But a P/S of 18 is still pricey in absolute terms and means a lot of the company's future growth is already priced in.

Therefore, The Trade Desk will need to keep growing at a strong pace for a long time to justify today's price tag. To me, this emphasizes the need to take the extremely long view when investing in this company right now.

However, given its strengths, I'm not sure how much The Trade Desk stock will ever look like a bargain -- it may only look like a bargain in hindsight.