The stock market hasn't been kind to most investors in 2022 with the S&P 500 down more than 17% year to date. As the uncertainties from inflation and rising interest rates look to persist through the end of the year at the least, it might be worth adding some stocks to your portfolio that could help protect it against further risk.

Here are two stocks that have not only gone up in 2022 but are well-positioned in the event of a market crash.

1. Rollins: Exterminating pests in good times and bad

Most homeowners and renters are aware of Rollins (ROL 1.31%), a leading pest control services provider, because, at some point or another, pests are likely to make it into a residence. Here are some statistics that might make your skin crawl: Each year in the United States, termites infest approximately 600,000 homes, 14 million housing units report seeing roaches, and almost 15 million people find rodents.

As a result of those unwanted visitors, the pest industry is now worth $20 billion per year globally, and $10 billion in the U.S. And Rollins estimates those figures will grow by 4% to 5% annually for the foreseeable future. For reference, Rollins generated roughly $2.5 billion in revenue in 2021, meaning it has about 12.5% of the market. Rollins' biggest competitor Terminix (NYSE: TMX), produced about $2 billion in 2021, or a market share of about 10%.

Beyond the persistence of unwanted pests, 80% of Rollins' revenue is from recurring contracts -- an attractive statistic for investors. If a residential or commercial customer needs an exterminator, Rollins will likely sign them into a contract for one to three years instead of charging for a one-time visit.

Rollins' revenue in the first half of 2022 was $1.305 billion, up 11.2% from the $1.174 billion it brought in during the prior-year period. The company is feeling inflationary pressure on its fuel and vehicle repairs, though, and its net income decreased by almost 10%, from $191.5 million in the first half of 2021 to $172.7 million in the first half of 2022. To combat higher gas prices, management is committed to a "sizable uptick" in the size of its hybrid truck fleet by 2024, both to increase efficiency and reduce carbon emissions.

Unlike most of the stocks on the market, Rollins is up for the year. Beyond its 8% return in 2022 and its 85% rise over the past five years, the company pays a quarterly dividend of $0.10 per share, which at the current share price yields 1.1%. And Rollins has paid a quarterly dividend consistently since 1987, regardless of every market crash since then.  

2. WWE: Fake wrestling, real money

Believe it or not, World Wrestling Entertainment (WWE) stock is up by about 38% in 2022, outperforming the S&P 500 by more than 50%.

The largest professional wrestling company in the world has faced turmoil this year as its longtime CEO, Vince McMahon, resigned following alleged misconduct. WWE discovered $19.6 million in unrecorded payments related to Mr. McMahon. McMahon still holds a substantial majority of WWE's Class B common stock.

Still, the stock is up about 200% over the past five years, primarily due to rising revenue from television licensing deals. Between its tentpole TV properties, NXTRaw, Smackdown, and the WWE Network, the company generated about $413 million -- roughly 80% of its total revenue -- through licensing contracts during the first half of 2022.

While many public companies may worry about their revenue streams during economic downturns, WWE is not one of them. It has television licensing contracts with media giants Comcast, Walt Disney, and Fox. Additionally, television licensing deals have a history of increasing in value over time as the owners of networks jockey for the right to broadcast advertiser-friendly live events.

Most of WWE's lucrative television licensing deals will expire in 2024, meaning there likely won't be a significant jump in its stock price until mid-2023. That's when the company is likely to announce its next deals. However, WWE's current deals have ​ yearly contractual escalations of rights fees built in, creating a growing revenue base each year.

Investors may not think of WWE as a dividend stock, but the company has been paying a quarterly dividend of $0.12 per share since 2011, which at recent share prices gives it a roughly 0.7% yield.

Between the steady revenue stream and consistency in returning capital to shareholders, WWE is an attractive stock for investors looking to protect or even grow their portfolios in a market crash. 

The bottom line

After several years of a booming stock market, investors must now navigate a recession. Neither of these stocks is likely to "shoot to the moon" as some tech stocks might. However, their built-in contracts as the market leaders in their industries create relatively safe floors that should reward shareholders along the way. That's why Rollins and WWE are worthy of consideration when investors are seeing red across their portfolios.