Tesla Inc. is set up well in both the short term and the long run, according to an RBC Capital Markets analyst, who just turned bullish on the stock amid its “favorable” positioning.

RBC’s Joseph Spak upgraded electric vehicle maker’s stock TSLA, -3.12% to outperform from sector perform late Sunday, writing of the company’s “more favorable near-term setup” as well as his expectation that “Tesla’s focus on supply chain and vertical integration will be a mid-term competitive advantage.”

See also: Tesla files for 3-for-1 stock split

Spak wrote that consensus expectations call for 279,000 Tesla deliveries in the second quarter, though he said that he pegs buy-side estimates at 250,000, and his own forecast is for 249,000 deliveries. Still, he acknowledged that there could be room for upside “if reports that Tesla’s Shanghai facility is back to full speed are correct,” depending on Tesla’s ability to get additional produced vehicles delivered.

Further, he pointed to the possibility of margin upside in the second quarter, as well as later in the year. Though Tesla is expected to deliver fewer units than it did in the first quarter, Spak wrote that the company could see a roughly 3% boost in average selling prices “given the pricing actions Tesla has taken a while back but not been able to realize as they have been working through their backlog.”

As he looks to the second half of the year, Spak wrote that Tesla could deliver auto gross margins north of 30%, while the consensus view is for about 28%, “as Shanghai gets back to pace, Berlin and Texas ramp and pricing gains continue sequentially.”

Don’t miss: U.S. car sales at ‘recessionary levels,’ as inflation, rising interest rate concerns increase, RBC says

In terms of Tesla’s long-run narrative, Spak finds himself “increasingly favorable on Tesla’s industry positioning.” The company has benefited from an “oligopoly-like positioning” thus far and likely will lose share in electric vehicles once competitors step up their offerings, but he isn’t too worried given Tesla’s demand momentum and its opportunity to benefit from pricing moves.

More critically, however, Spak believes Tesla has a key advantage over rivals when it comes to supply-chain matters.

“While TSLA is fairly secretive about the deals they have cut for supply of raw materials, in talking to contacts we believe they have done more than other OEMs [original equipment manufacturers],” he wrote. “The company’s early focus on vertical integration (not just batteries/raw materials but also motors, semis, software) is likely to pay off.”

Read: These airlines will benefit the most from U.S. lifting COVID-19 test requirements for international travel

“TSLA earnings and cash generation over the coming years, in addition to their ability to use their stock as currency, can help them build out and secure materials giving them a strong competitive advantage,” Spak noted.

Spak cut his price target on Tesla’s stock to $1,100 from $1,175 in his note to clients.

The stock is off about 4% in premarket trading Monday. It has tumbled 34.1% year to date through Friday, while the S&P 500 index SPX, -2.91% has dropped 18.2%.