(Bloomberg) -- Tesla Inc. has more money in the bank than ever, which could be just the assurance credit raters have been waiting for to upgrade the company’s bonds.

The electric-car maker ended the fourth quarter with a record $6.3 billion of cash, up nearly $1 billion from the third quarter. It’s also strung together three straight quarters of positive cash flow. That figure topped $1 billion in the latest quarter, helping to send its shares to record highs, which in turn could make more than $4 billion of its bonds eligible to convert to equity.

S&P Global Ratings rates Tesla B-, six steps below investment-grade, with a positive outlook. It said in November it could upgrade the company if -- among other factors -- free cash flow is at least around breakeven and cash is at a minimum $2.5 billion. Moody’s Investors Service has outlined similar upgrade criteria.

“It’s possible raters may act,” Bloomberg Intelligence analyst Joel Levington said in a Jan. 29 report. Tesla could end 2020 with debt between 3.5 times and 4 times a measure of earnings, which would potentially be enough for S&P to upgrade, he said earlier this year.

Tesla is coming off of its second consecutive quarter of blowout earnings, extending an unprecedented surge for its heavily shorted stock and bonds. It’s now turned a profit in four of the last six quarters, and Chief Executive Officer Elon Musk again accelerated the expected introduction of the new Model Y crossover vehicle, which he predicts will outsell all other Teslas combined.

Prices on Tesla’s unsecured bonds, which are rated Caa1 by Moody’s, have been rising as the company’s prospects in China are looking up and its battery business with Panasonic Corp. turned profitable last quarter. The 5.3% notes are trading at a record high, while the cost to protect its debt against default has dropped to all-time lows.

See also: A Hedge Fund With a 29% Return Record Is Shorting Tesla’s Bond

The bonds now yield around 4.2%, between the averages of bonds rated B and BB, according to Bloomberg Barclays indexes. That’s in the range of fair value, according to CreditSights analyst Hitin Anand, so it’s possible an upgrade may not boost the debt much more.

Since the Palo Alto, California-based company reported earnings after the stock market close on Jan. 29, its shares have already doubled this year and broken through $900. That’s put $4.3 billion of its convertible bonds maturing over the next four years “in the money,” meaning they could be converted to equity upon maturity.

Taking that much debt off Tesla’s balance sheet could improve a credit measure known as leverage, a metric both S&P and Moody’s watch closely, possibly spurring upgrades. However, the next convertible bond doesn’t come due until December, still a ways away.

If Tesla sold 500,000 cars at an average $55,000 each, leverage would decrease to 3.6 times in 2020 from 4.3 times in 2019, Anand wrote in a Jan. 30 report. If its convertible bonds were no longer in the picture, that metric would look even better, he said.

“It would change their leverage dramatically -- that’s why Tesla issues something like this, for that option,” said Chris Hartman, a senior portfolio manager who specializes in convertible arbitrage at Aegon Asset Management. “It would get their ratings moving very quickly in the right direction.”

For Tesla’s bonds to be converted to equity, the stock would need to sustain a high enough level in the days leading up to maturity, which is still months, if not years away for some of the debt. Tesla’s stock has been extremely volatile, and in the past too low to make some of its debt eligible for conversion. But it’s had enough cash on hand to settle those maturities anyway.

--With assistance from Dana Hull.

To contact the reporter on this story: Molly Smith in New York at msmith604@bloomberg.net

To contact the editors responsible for this story: Nikolaj Gammeltoft at ngammeltoft@bloomberg.net, Christopher DeReza, Dan Wilchins

©2020 Bloomberg L.P.