Two years ago, renewable energy darling SunEdison filed for bankruptcy, the end of a $10 billion fall for the company and billions more in lost value for its yieldcos and outstanding debt. The company was once the darling of the industry, and hedge funds eager to back its growth piled into the stock and -- for a moment -- made a lot of money for themselves. 

But SunEdison turned out to be a house of cards, never able to stand on its own financially. When Wall Street's cash register closed, the company's days were numbered. SunEdison's fall isn't perfectly analogous to the struggles Tesla (TSLA -0.17%) currently faces, but there are some striking similarities.

Tesla Model S on a coastal road.

Image source: Tesla.

The first warning sign comes from debt markets

Debt markets often recognize a company's risks before the stock market does and can close up to companies quickly when they see problems ahead. For example, at the end of the third quarter of 2015, SunEdison's weighted average annual interest rate on debt was 4.13%, but the company needed a continuous flow of capital to stay afloat, fueling its endless appetite for acquisitions. The straw that broke the camel's back was the proposed acquisition of Vivint Solar, which investors saw as higher risk than previous acquisitions of projects and companies with assets backed by utility customers. Funding residential solar was a bridge too far, and debt investors suddenly had very little interest in financing the company.

By early 2016, the writing was on the wall for SunEdison, and on Jan. 7, 2016, the company needed funds to stay afloat and offered $725 million in second lien secured-term loans that carried an astronomically high interest rate of LIBOR plus 10% with an 11% minimum interest rate. In a matter of months, borrowing costs had risen around 700 basis points. 

Today, Tesla's interest rate is fairly low, just like SunEdison's was in the summer of 2015, at just over 4%, based on interest expenses and debt outstanding. But keep in mind the interest rate expense below includes below-market rates for convertible debt. 

TSLA Total Interest Expense (TTM) Chart

TSLA Total Interest Expense (TTM) data by YCharts.

This is where the first warning signs begin. Moody's recently downgraded Tesla's corporate rating from B2 to B3 (six levels into junk status) and its $1.8 billion of 5.3% senior notes due August 2025 from B3 to Caa1. This is a quick downgrade on debt that was issued in August 2017, and the ratings agency's concern is that the Model 3 isn't ramping production as quickly as expected. 

We may already be seeing investors shun Tesla's debt, which isn't good news for future cash needs. The 5.3% senior notes now trade at a nearly 15% discount to par value, implying a 7.8% yield to maturity as I'm writing. That's an implied 2.5 percentage point increase in Tesla's borrowing costs in just seven months. And it's not the only evidence that in the long term, debt costs are rising. 

In March 2014, Tesla issued $800 million of 0.25% convertible senior notes due March 2019 and $1.2 billion of 1.25% convertible senior notes due March 2021. By March 2017, a $977.5 million offering of convertible senior notes due March 2022 required a 2.375% interest rate. That's a similar duration offering as the 0.25% debt issued three years earlier and rates were 213 basis points higher. 

The Moody's downgrade will only exacerbate Tesla's debt issues, and Wall Street will eventually require interest rates so high they'll be unfeasible for the company. That'll leave only new share offerings as capital is needed, and that's not something stock investors want to be forced into by any business. 

When the house of cards began to collapse

A company like SunEdison was built on a house of cards that assumed each acquisition or project would eventually get financing through another entity like a yieldco, which acted similarly to an energy MLP. SunEdison would put early phase projects in the hopper, finance them through construction, and when they were completed flip them to TerraForm Power, TerraForm Global, or another investor for a profit. As a bonus, if the TerraForm yieldcos bought the projects, SunEdison itself would benefit as the entity controlling both companies. 

Notice that the entire thesis was built on yieldcos being able to buy renewable energy projects and SunEdison being able to finance the projects it was developing. When financing dried up for both sides of the business, the house of cards collapsed quickly. 

Tesla isn't trying to financially engineer its business like SunEdison was, but it's in an equally precarious position. The hope is that debt and stock investors will give the company billions in cash to build out manufacturing at the Gigafactory and for the Model 3. The payoff will be if Tesla quickly ramps production of the Model 3 in 2018, as promised, allowing the company to generate positive cash flow and fund new projects like Tesla Semi, Model Y, solar roof, and more. 

Right now, the entire thesis is riding on the idea that the Model 3 will begin generating positive cash flow soon because Tesla can't afford to sustain its current cash burn levels without getting cash from either car sales or accessing capital markets again. 

TSLA Cash and Equivalents (Quarterly) Chart

TSLA Cash and Equivalents (Quarterly) data by YCharts.

You can see above that Tesla is currently burning through about $4.1 billion annually and recently has been funding most of that through the issuance of debt. There's also only enough cash to fund the current cash burn for two to three quarters (some cash is needed on the balance sheet to keep the doors open). If the Model 3 is delayed further and the cash burn doesn't turn into a cash machine, the company will have to turn to debt or equity markets. Then you run into the challenges with closed debt markets that I outlined above, leaving a shrinking number of financing options. 

Customers balk at relying on failing companies

When it became clear SunEdison was in serious trouble, even customers began to jump ship. Hawaiian Electric canceled $350 million worth of projects the company was supposed to build, and Vivint Solar saw its own installation volume tumble even before the acquisition was completed. Once customers start to bail, a company with a large debt load has few options.  

Here's what I worry about at Tesla: Let's say Tesla delays production of the Model 3 again and delivers far fewer cars than the 500,000 originally planned for 2018. At the same time, Tesla is struggling to raise cash to fund necessary capital equipment upgrades needed to get its production lines running at capacity and making cars that meet industry quality standards. Reports of poor quality begin to surface, warranty costs skyrocket, and investors get even more skittish about Tesla's ability to make a profit anytime soon. 

As this hypothetical situation plays out, the downward spiral has begun, and if your number is called for your Model 3 reservation, are you going to write a $40,000 check to a company teetering on the brink of insolvency or elect to get your $1,000 deposit back? You have a tough decision. Walking away and looking for another electric vehicle option may be appealing to some car buyers. 

This may be a hypothetical, but it's not at all out of the realm of possibility for Tesla. The company relies on an open flow of funds from Wall Street to stay afloat, and if that flow is turned off, there will be a cascading impact on the company and its customers. In March 2015, there weren't many investors who could fathom that SunEdison would go bankrupt, but six months later the writing was on the wall, and three months after that the company was bankrupt. Tesla investors shouldn't think it can't happen to them. 

What Tesla and investors must learn from SunEdison

When companies that need a continuous flow of funding fall, they fall hard. SunEdison showed us that. Warning signs like rising debt costs should be a huge red flag, and they're already starting to show up in Tesla's debt. 

We also know that the downward spiral can be fast. If Wall Street's cash machine turns off, we could see customers delay purchases, suppliers demand better payment terms, and Tesla's cash crunch could get worse. After watching SunEdison's collapse, Tesla's current situation has some frightening similarities.