Shares of have given up the entire rally that followed the Volkswagen announcement, suggesting that the markets are missing the forest for the trees, Deutsche Bank said.

Shares of Xpeng (NYSE: XPEV) have slipped significantly this month, giving back all of the gains made since the Volkswagen deal was announced. In Deutsche Bank's view, the markets may have been short-sighted.

"Xpeng stock has given up its entire post-VW announcement rally, suggesting to us that markets are missing the forest for the trees," analyst Edison Yu's team said in a research note sent to investors today.

On July 26, Volkswagen announced that it would invest about $700 million in Xpeng, acquiring about 4.99 percent of the latter. In the initial phase of the partnership, the two companies plan to co-develop two Volkswagen-branded EV models for China's mid-size car market.

Xpeng saw a 52 percent gain in three days after the deal was announced. However, as the company has continued to fall so far this month, its shares have fallen back to levels seen before the deal was announced.

While Xpeng's margins for the second half of the year were significantly lower than expected, the G6 product cycle still looks strong, Yu's team said in the note.

Xpeng's deal with Volkswagen provides validation of its technology stack and should start generating recurring high-margin revenue as early as next year, the team said.

Volkswagen will co-develop two B-class battery electric vehicles (BEVs) to be marketed in China under the Volkswagen brand, based on the Xpeng G9 platform and connectivity and ADAS software.

The two new vehicles will complement Volkswagen's MEB platform-based portfolio and are scheduled to go to market in 2026.

The deal is expected to contribute more than 1 billion yuan in revenue to Xpeng in 2026, growing to nearly 3 billion by 2028, according to estimates from Yu's team.

In addition, Xpeng's second-quarter earnings report, released on Friday, showed a gross margin of -3.9 percent in the second quarter, missing analysts' expectations of 4.79 percent and a new low since the first quarter of 2020.

Yu's team believes that sacrificing margins for volume is the correct move right now to maintain relevance given the current industry backdrop.

And, over time, this will ease as BoM (bill of materials) costs are reduced through structural savings, according to the team.

Xpeng's US-traded ADRs have rallied today, up nearly 6 percent in pre-market trading as of press time.

BREAKING: VW to invest $700 million in Xpeng and co-develop EVs