The Nasdaq Composite hasn't had a great year. Down almost 29% so far in 2022, it's been the hardest hit of the three major indexes. Long-term investors have likely seen their portfolios take a hit along with everyone else, but they know that a decline this sharp is likely to create some buying opportunities for those with the right investing mindset.

Let's look at two of the worst-performing stocks in the Nasdaq Composite in 2022 and see if there's justification for buying the dip.

1. Peloton Interactive

The story behind the connected-fitness company's struggles is a fairly straightforward one of supply and demand. During the pandemic when gyms were closed, exercise enthusiasts were looking for alternatives that accommodated social distancing, and stimulus checks were inflating spending power, demand was so high for Peloton Interactive (PTON -0.97%) products that the company couldn't keep up with it.

A person exercises on a Peloton cycle in a large room with furniture and a large window as a person walks behind him into another part of the home

Image source: Peloton.

This excess demand led to the company spending heavily to increase production capacity. As the pandemic eased and vaccines allowed for people to again gather in fitness centers, the demand for Peloton products fell hard, along with the need for the ramped-up production. Layoffs and changed plans and outlooks soon followed. The stock price fell right along with it, down 94.5% from peaks hit in February 2021.

The question now is whether Peloton is done as a worthy investment, or is there an opportunity here for recovery?

Peloton's balance sheet at the moment suggests some potential trouble. In its latest report, Peloton management said the company had $879 million in available cash balanced against more than $1 billion in current liabilities. This led to Peloton to add another $750 million in long-term debt to its books to fund the recovery efforts. While this is good news in the short term (the company will be able to pay its immediate obligations), it will need to work hard to improve its balance sheet over the coming quarters.

The income statement also suggests trouble. The biggest red flag is a massive increase in operating expenses. Through nine months in fiscal year 2022 (as of March 31), Peloton had $2.25 billion in operating costs compared to around $1 billion the prior year. That's a 107% jump year over year. During that same nine-month period, revenue dropped 6% year over year.

Due to lower demand and rising costs, the company is now cash flow negative so far in 2022 after reporting positive cash flow at the same point in 2021. On an income basis, it reported a loss of $1.5 billion in the most recent quarter.

So the financials are not in great shape at the moment. It's hard to find a silver lining with Peloton, but if there is one, it's in the company's new CEO, Barry McCarthy. In a recent shareholder letter, McCarthy said that the No. 1 goal for the business is to be cash-flow positive as soon as possible by cutting costs and ramping up higher-margin revenue through its subscriptions.

McCarthy also detailed a very lofty long-term goal of achieving 100 million subscribers. It currently has about 3 million subscribers. If the company accomplishes even half of that goal, the company should be fine and the stock should produce excellent returns. But that's a big "if" right now and there are too many red flags that need to be addressed before investors again take a chance on this company, even those with a long-term mindset.

2. Upstart Holdings

Another stock that has been punished recently is Upstart Holdings (UPST -0.58%), which is down 91.6% from all-time highs set in November 2021. Similar to Peloton, a changing macroeconomic environment contributed heavily to the stock cratering. But the specific reasons were different.

While Peloton saw its demand evaporate almost overnight, Upstart has plenty of demand for its artificial-intelligence-based loan origination platform. But with interest rates rising and the market moving to lower-risk investments, Upstart might just be a quality business caught in a macroeconomic crossfire.

For starters, the company's balance sheet looks much healthier than Peloton's. It has about $1 billion in available cash, which is much more than its current liabilities. Upstart also grew its revenue by 156% and its profits by 224% in the most recent quarter. These are not the results of a struggling business.

So why has the stock price been cratering? For one, the company's valuation last fall had entered absurdist territory, at one point trading at a price-to-earnings ratio of nearly 500:

UPST PE Ratio Chart

UPST PE Ratio data by YCharts

But the bigger issues for the stock are likely related to rising interest rates and the temporary introduction of loans on the company's balance sheet. Rising interest rates could be bad news for the company as it will undoubtedly result in lower personal-loan applications as well as increase the potential for defaults among loan recipients. But the addition of loans on the company's balance sheet is the primary concern.

Until recently, Upstart has been purely a marketplace for banks to more effectively underwrite loans that Upstart said should be approved. Upstart collected a fee from the banks for facilitating the transaction. This made Upstart essentially a software-as-a-service business. But recently, Upstart expanded its loan approval system to include car loans and underwrote a small portion of those loans itself to help it develop the needed AI algorithms to better predict which loan applicants should qualify. It was a short-term R&D investment. With the company now underwriting a small number of loans directly, it adds a banking element to the business model.

The bears on the stock say it's hard to justify a premium valuation if Upstart is essentially just another bank, but CEO Dave Girouard said in a recent interview with Motley Fool co-founder and CEO Tom Gardner that this was a short-term strategy that was more reflective of Upstart's struggles in price discovery -- assessing how to rank a loan applicant's cost -- than in a shifting business model.

As Girouard explained it: "[W]hat happened is suddenly the markets did turn, and our price discovery process isn't fast enough to get prices where supply meets demand, and when we had that disequilibrium, if you will, we took some [loans] onto our balance sheet, and we do not intend to do that. It's not our business, and we're going to get better at the tools to have price discovery happen faster."

While the macro picture paints lots of uncertainty in the near term, the strong demand from its banking partners shows Upstart's alternative to Fair Isaac's FICO underwriting is working. If the company can firm up its price-discovery algorithms for the new segment, the current valuation looks quite attractive for investors with a long-term time horizon.