Some days, it's a joy to open your brokerage account and see a stock skyrocketing. That's exactly what The Trade Desk (TTD 1.67%) investors (including myself) experienced after the company reported its second-quarter results.

The stock spiked over 35% in one day due to fantastic results, but investors may wonder if they've missed the boat. Let's find out if The Trade Desk's great quarter was a one-time occurrence or if this is just the first of many positive quarters.

Investors thought advertisement-related revenue was in trouble

While investors and economists can argue all day if the economy is truly in a recession, the fact is that we see many signs around us. One of the most obvious signs is a decrease in advertising spending, which is an easy expense for businesses to control. Investors have already seen many ad-focused companies report disappointing quarters, so they didn't expect much from The Trade Desk.

But they were wrong.

The Trade Desk isn't a pure advertisement company; it's an ad-tech company. What's the difference?

An advertisement has two sides: a buyer (demand side) and a seller (supply side). The seller has ad space (whether it's a billboard, TV commercial, or space in the margins of a website), and the buyer is looking to place their product ad in the location that will garner the most attention. Most buyers don't have the expertise necessary to know where to place their ads; that's where The Trade Desk comes in.

The Trade Desk's demand-side platform instantaneously analyzes all the places a buyer could put an ad and then bids on the ideal location on behalf of the company. These targeted ads generate much better returns than generic ones and are why The Trade Desk had a great quarter.

Fantastic results

In the second quarter, The Trade Desk saw its revenue increase 35% year over year to $377 million. Management also guided for at least $385 million in third-quarter revenue, which would be a 28% increase.

Unlike many growth-oriented tech companies, The Trade Desk usually is profitable, but it posted a net income loss of $19 million due to a $66 million performance grant to CEO and founder Jeff Green. Still, its adjusted earnings before interest, taxes, depreciation, and amortization (EBITDA) was $139 million for the quarter -- an impressive 37% margin.

Despite a challenging advertising environment, customers didn't abandon The Trade Desk, as their customer retention remained above 95% for the eighth straight year. Instead, they used it more. That staying power displays its product's usefulness even when expenses are controlled.

This quarter was great, but is it worth buying now after a 35% jump?

Is The Trade Desk a Buy?

Before its massive earnings-day jump, The Trade Desk was trading at a price-to-sales ratio of about 18, basically its multiyear pre-pandemic average. Now, it's hopped up to 26, well above its average.

This jump is concerning, as the Federal Reserve is still raising interest rates to cool the economy despite its softening in some areas. With higher interest rates come lower valuations, and The Trade Desk is way above where it was when interest rates last rose. So while this quarter was a reason to be optimistic about the future, the stock has run up too quickly.

At this price, I'm not a buyer of The Trade Desk's stock, although I continue to be a long-term bull on the stock since the long-term tailwinds toward digital advertising are strong. Still, if investing over the past two years has taught me anything, it's this: You can't buy stocks at ultra-premium valuations and expect outsized returns to last. This experience is why I will pass on The Trade Desk's stock at today's valuation.