DraftKings has long argued that its business, a daily fantasy sports game where users can win cash prizes in exchange for cash entry fees, is a game of skill (legal), not a game of chance (illegal).

Now, DraftKings is preparing to cross over to the other side. The company is building a sports betting product, says CEO Jason Robins, who hopes that his startup will be ready if and when sports gambling is legalized in the United States.

"For me it was always, 'this is going to happen, it's just [a matter of] when," Robins said of the legalization of sports gambling. "We'll be prepared."

More from Recode:

Shervin Pishevar plans to dismiss lawsuit he filed against a Republican opposition firm

HQ Trivia is raising $15 million at a valuation of more than $100 million from Founders Fund

Amazon should buy CBS. Here's why it would be a smart deal.

Sports gambling is not legal in the United States outside of a few markets, like Nevada. People are betting billions on the Super Bowl this year, as they do every year, and estimates are that a very small fraction of that is done legally.

Robins is optimistic that might change as the gambling world awaits the decision of a Supreme Court case in which New Jersey is fighting to legalize sports gambling. The NBA is also preparing for legalization.

The irony is that Robins has spent the last few years trying to distance himself and his business from the world of sports gambling, spending big on lawyers to fight legal battles in multiple states that tried to block his daily fantasy business.

Robins is aware of the optics.

"I guess there's always some worry there, but they're two different products," he said. "Any company that is going to become big generally has to expand into multiple products and we'll be no different."

Robins won't say what his new gambling product will look like, but it's coming.