As of this writing, the Treasury yield curve is inverted, meaning that two-year bonds offer a higher return than 10-year bonds. This usually indicates that a recession is in the not-too-distant future. But based on two consecutive quarters of declining gross domestic product, we could already be in one. 

The Federal Reserve's ongoing moves to hike interest rates in order to curb soaring inflation has the potential to seriously slow down the economy. And in this situation, investors need to find ways to position their portfolios for a sustained negative macroeconomic environment. 

Here's a top retail stock that the smartest investors are going to buy and hold should a full-on recession come along. 

Taking care of the customer 

In a down economy, consumers are going to do everything in their power to stretch their budgets and seek out value above all else. With this in mind, it's no surprise that a business like Costco Wholesale (COST 0.07%) becomes attractive to investors. 

The company is known for selling high-quality merchandise at some of the lowest prices around. The typical mark-up at a Costco location is 11%, compared to 24% at competitor Walmart. Costco's sheer scale, coupled with its no-frills warehouses and membership-based model, allows for incredibly low operating margins. The end result is an extremely satisfied customer.  

Revenue in the month of July rose 16.4% year-over-year, a sign of strong momentum for the company. "There's a lot of discussion and talk about a recession coming, but if you look in our buildings and if you've been on an airplane lately, you'd never notice it," Bob Nelson, Costco's Senior Vice President of Finance and Investor Relations, said on the Q3 2022 earnings call. 

This relentless focus of always doing right by the customer and keeping prices as low as possible is ingrained in Costco's organizational culture. In fact, the company's co-founder and former CEO Jim Sinegal had a famous reply when asked by then-president and current CEO, Craig Jelinek, to raise the $1.50 price of Costco's popular hot dog and soda combo. "If you raise the price of the effing hot dog, I will kill you," Sinegal said.

Needless to say, the price hasn't changed.

Thriving in good and bad times

But let's be clear -- Costco isn't just a business that investors should own in a recession. This company has proven that it can thrive no matter what the economic climate is. Besides revenue falling 1.5% in fiscal 2009 during the Great Recession, this metric has increased each and every year since. And margins have steadily expanded over time. 

What makes Costco special is that it is a top shopping destination for customers in both good and bad economic times. Leadership has done a phenomenal job over the years to establish trust with shoppers and to make sure it's a brand that will take care of customers with a broad assortment of high-quality products sold at the lowest prices. This kind of offering will always be desirable. 

Even throughout the past couple of years, a time mainly characterized by the coronavirus pandemic, Costco's value proposition was on full display. Trying to save time while staying safe, customers frequented Costco warehouses for all of their shopping needs. U.S. same-store sales, or comps, have consistently increased more than 10% year-over-year every single month since June 2020. The pandemic supercharged Costco's growth. 

And despite its gargantuan size, with a market cap of $244 billion today, the future looks bright for Costco. Wall Street analysts' consensus estimates call for revenue and earnings per share to increase at a compound annual growth rate of 7.5% and 15.2%, respectively, between fiscal 2021 and fiscal 2026. That's slightly less than the gains registered over the prior five years, but it's still impressive. 

Putting the customer first has worked wonders for the business throughout its history, and it will likely continue to do so, especially if the economy enters a recession. This means it might be a smart move to pay up for Costco's stock, whose current price-to-earnings ratio is roughly 33% higher than its 10-year average.