For SpaceX, the turnaround was especially welcome after a difficult period following its blockbuster June IPO. After an initial burst of enthusiasm, the shares spent much of the following weeks heading downhill as concerns about valuation, heavy spending, and upcoming lockup expirations weighed on sentiment.

The biggest test was expected to arrive last Thursday, when the company’s first post-IPO lockup expired and about 911 million restricted shares became eligible for trading. With so much potential supply becoming available at once, another selloff seemed entirely possible. Yet, SpaceX flipped the script and actually gained ground when the lockup expiration finally arrived. The buying intensified on Friday, when the stock surged nearly 16% and capped an impressive two-day run. All told, SpaceX finished the week up about 23%.

Palantir investors had been waiting for their own change of fortunes around earnings reports. In recent quarters, strong results haven’t always translated into higher share prices, largely due to expectations that seemed almost impossible to satisfy. This time around, however, Palantir produced results that proved difficult for the market to dismiss. Its August 3 report showed revenue jumping 93% year-over-year to about $1.94 billion, while U.S. commercial revenue surged 149%. Management raised its full-year outlook as well, providing further evidence that businesses are spending heavily to bring Palantir’s AI technology into their operations.