BOSTON — The Massachusetts state treasurer says she’s exploring whether the state’s lottery should enter the lucrative online world of fantasy sports leagues.

Democratic Treasurer Deb Goldberg said Wednesday she is trying to understand how online fantasy sports websites operate but is concerned their rocketing popularity could threaten the lottery.

“It’s really my responsibility as head of the lottery commission to be thinking about what is the competitive environment that we’re operating in,” Goldberg said in her Statehouse office.

Goldberg said she was largely unaware of online fantasy sports games until she attended a recent Boston Red Sox game and saw ads for the fantasy sports website DraftKings, which is based in Boston.

Daily fantasy sports participants put together virtual teams based on real players and compete for points based on the players’ statistics. Paid contests cost as little as $1 to enter, but some players wager tens of thousands of dollars on each matchup.

Democratic state Attorney General Maura Healey is reviewing DraftKings. She said daily fantasy sports is a new and rapidly growing industry and her office has been looking into the practices of the companies to better understand how they operate.

“Neither federal law nor Massachusetts state statutes prohibit fantasy gaming,” Healey said in a statement. “My focus is on ensuring that there are proper consumer protections in place.”

Healey said she’s concerned about recent reports about insider activity that would have put average players at a competitive disadvantage.

DraftKings has said its executives are happy to work with Healey to answer her questions.

At an evening event sponsored by the Boston Globe and Suffolk University, Healey was again asked about DraftKings.

Healey said there’s “no criminal inquiry” into the company and “we’re not looking to shut them down.”

Goldberg said the lottery commission’s fundamental role will continue to be running a healthy lottery. She said any expansion into online fantasy sports would require legislative approval.