Tesla Inc.

(NASDAQ:TSLA) reported stronger second-quarter earnings on Wednesday, but one of the biggest contributors to its profit wasn't higher vehicle sales, energy storage or services.

It was Space Exploration Technologies Corp.

(NASDAQ:SPCX).

Buried in Tesla's earnings report's cash flow statement is a $1.005 billion pretax unrealized gain on its SpaceX investment, equal to $763 million after tax.