Palantir reported unrealized gains from its SpaceX stake that lifted second-quarter earnings after the company's blockbuster IPO.

Palantir stock has dropped substantially this year, with several valuation metrics showing that it is highly undervalued as earnings loom.

Palantir (PLTR) expected to report Q2 earnings of 35 cents per share and $1.81 billion in revenue. Analysts have mixed opinions on stock.