What happened

Shares of online used car dealer Carvana (CVNA 8.79%) rallied this week, surging by 23.4%, according to data from S&P Global Market Intelligence.

This controversial stock, which has an unusually high short interest, can move around a lot based on positive or negative news. This week, however, was a relatively positive one, as the company completed its debt exchange, the state of Illinois passed a law favorable to online used car sellers, and the company's founder and CEO bought a large amount of stock in the open market.

So what

The week started off positively for Carvana, as it was disclosed that a family trust controlled by CEO Ernest Garcia and his father, who is also a large shareholder, bought $116 million worth of the stock on Aug. 18 at an average price of $37.05 per share. That sizable purchase no doubt fueled both optimism and a bit of a short squeeze to start the week.

The Garcias are displaying confidence in themselves following a recovery for Carvana's stock over the summer. Recently, Carvana was able to exchange some of its outstanding debt for new notes, which will lower the company's interest expenses and push out bond maturities, in exchange for greater asset security for the company's bondholders.

While it was announced earlier this summer, the debt exchange actually just closed on Thursday, with 96% of its noteholders participating. That may have added further optimism to Carvana's recovery story.

Finally, both houses of the Illinois legislature unanimously passed a bill that updated the state's previously outdated laws regulating used car dealers, finally allowing the state's residents to accept home delivery of used cars. While it was inevitable that something like this would eventually pass, it was still an incremental positive for Carvana, the business model of which relies heavily on home delivery.

Now what

It may seem like Carvana is out of the woods, and that the possibility of it landing in bankruptcy is off the table. However, while the company has certainly bought itself time, investors may want to be cautious after this run in the stock. 

After all, ratings agency S&P Global actually lowered its credit rating on Carvana to CCC in July when the debt exchange was announced, as the exchange was tantamount to a default in the view of S&P Global since bondholders had essentially agreed to take less than originally promised.

That may be parsing things a bit too much. Still, while Carvana has pivoted to greater profitability, increasing its gross margin per car sold and cutting expenses, units sold were still down by a huge amount year over year in the second quarter.

So while the CEO's purchase of shares is no doubt an incremental positive, Carvana remains quite a risky story. The company will still have to return to growth while holding expenses down and fending off competition, which has increased in recent years as rival car dealers have gotten much more digitally savvy than they were in the past.