Electric carmaker Tesla marginally beat Wall Street expectations for first-quarter revenue last night, boosted by a jump in environmental credit sales to other automakers and liquidating some bitcoins.

Tesla posted record deliveries in the first quarter despite a global chip shortage that has slammed auto sector rivals, but its profit was not driven by car sales.

Tesla, which had invested $1.5 billion in bitcoin, trimmed its position by 10% during the quarter, said Chief Financial Officer Zachary Kirkhorn.

Tesla said proceeds from sales of digital assets amounted to $272m with a $101m "positive impact".

"We do believe long term in the value of bitcoin," he said. "It is our intent to hold what we have long term and continue to accumulate bitcoin from transactions from our customers as they purchase vehicles."

Musk tweeted that he has not sold any of his personal bitcoins.

Tesla has posted profits for seven quarters in a row, most quarters driven by environmental credits.

Tesla earned $518m from sales of those credits, up 46% from a year earlier. Tesla earns credits for exceeding emissions and fuel economy standards and sells them to other automakers that fall short.

The company's net profit was dented by a $299m award to chief executive Elon Musk. Tesla's quarterly performance hit targets qualifying the billionaire entrepreneur for two options payouts worth a combined $11 billion.

Tesla posted record deliveries in the first quarter despite a global chip shortage that has slammed auto sector rivals.

But the world's most valuable automaker, whose shares jumped more than eight-fold last year, faces challenges of living up to its valuation and managing expectations.

The company said it was able to navigate through global chip supply shortage issues in part by pivoting quickly to new chips, while simultaneously developing software for chips made by new suppliers.

Musk said it had "some of the most difficult supply chain challenges," citing a chip shortage. "We're mostly out of that particular problem," he said.

Tesla CEO Elon Musk

Its vehicle average selling price fell by 13% as production of pricier Model S and Model X vehicles ground to a halt ahead of major updates.

Tesla said its costs decreased, with its average cost per vehicle below $38,000 in the first quarter, compared with $84,000 in 2017.

Tesla will start deliveries of the new Model S next month and high-volume production in the third quarter. The Model Y production rate in Shanghai continued to improve, spurring demand in China.

Tesla said it expects this year's volume growth to exceed 50%, while saying that it is on track to start production and deliveries at its planned factories in Texas and Berlin this year.

Revenue rose to $10.39 billion from $5.99 billion a year earlier. Analysts had expected revenue of $10.29 billion, according to IBES data from Refinitiv.

Adjusted profit of 93 cents per share topped Wall Street's consensus of 79 cents.

In the US, Tesla's full self-driving software is facing new federal investigations following 28 crashes of Tesla vehicles, including a recent one in Texas that killed two people.

On a call with investors, Tesla said it inspected the car with investigators and found that the steering wheel was deformed, raising the likelihood that someone was likely in the driver's seat at the time of the crash.

"Seatbelts post-crash were found to be unbuckled," a Tesla official said during a call.

"We're unable to recover the data from the SD card at the time of impact, but the local authorities are working on doing that and we await their report," it added.