Nearly $40 million was spent on recreational pot in Illinois in the first 31 days of legalization, marking the second largest rollout in the country’s history.

Despite facing a pervasive supply shortage, 41 Illinois dispensaries sold 972,045 individual pot products totaling $39.2 million in sales, according to figures provided by the Illinois Department of Financial and Professional Regulation. Of that, $30.6 million was spent by Illinois residents, while the rest was spent by visitors from out of state.

Andy Seeger, an analyst at the Brightfield Group, a Loop-based cannabis industry research firm, noted that January’s sales totals were only trumped by California’s roughly $70 million in first month sales in 2018. Illinois is trailed by Nevada, which unloaded over $27 million worth of recreational pot when sales kicked off in 2017.

Still the pace of sales slowed substantially from the first week of legalization in Illinois. On Jan. 1, $3.2 million worth of pot products sold. By the end of the first five days of sales, total sales hit $10.8 million, or more than $2 million per day.

Since that first week, pot shops have had ongoing problems getting enough pot products from the state’s 21 cultivators, forcing many pot shops to limit recreational sales. NuMed in West Town, for example, is only opening to recreational customers on Tuesdays and Saturdays.

“We are hoping to expand that to more days very soon,” said spokesman Jonah Rapino. “We’ve been doing a lot of work behind the scenes to make sure we have the right relationships with the cultivators in Illinois to make sure we have more supply for all of our locations, including Chicago.”

NuMed, which also operates dispensaries in East Peoria and Urbana, was able to stockpile product ahead of Jan. 1. However, Rapino said the company simply didn’t have enough weed to consistently serve the “hordes” of new customers.

Though analysts predict the shortage could persist for months, Rapino is already seeing more product come available.

“It’s not like a leap forward,” he said. “It’s definitely inching along towards better.”

Meanwhile, Mission in South Chicago hasn’t once had to close its doors to recreational shoppers.

Kris Krane, president of the dispensary’s parent company 4Front Ventures, said the store first ran out of dried cannabis flower about a week ago, adding that the shop has set strict purchasing limits. For example, recreational customers can only buy an eighth of an ounce of flower — or 3.5 grams — which is far lower than the 30 grams allowed by state law.

Krane said supply has been “consistent” but inadequate, adding that it’s been a day-to-day struggle to stay stocked.

“Things are running as smoothly as we can get them,” he said.

Seeger said the sales totals ultimately highlight “how much demand exists even in the face of low supply and high taxes.”

“We expect Illinois to become a healthy, nationally leading market once mature and these figures bolster that view,” he added.

Toi Hutchinson, Gov. J.B. Pritzker’s senior adviser for cannabis control, touted the state’s “successful launch,” adding that Illinois’ pot industry will create “new opportunities for entrepreneurs and the very communities that have historically been harmed by the failed war on drugs.” In addition to reinvesting a portion of recreational weed sales into those communities, so-called social equity applicants will also earn extra points on applications for upcoming cannabis licenses.

Total medical sales in January, meanwhile, weren’t released. But patients in Illinois bought more than $27 million of pot products in December.