The race to legalize daily fantasy-sports wagering in New York is in the home stretch. It appears likely a deal will come together before the end of the legislative session this month, but there are still details to be worked out. That needs to happen, because the current ban serves little purpose.

The one big remaining question being debated in Albany is licensing fees, which were $500,000 per company in an early Senate bill, a level that would kill the smallest of the 28 companies in the New York market. A bill just introduced in the Assembly seems to answer the problem by offering three licensing fees, from $5,000 to $100,000, depending on company size. Licensees would pay a 15 percent tax on revenue.

Also key to passage are safeguards against cheating, preventing play by minors and truth in advertising; the industry can’t really argue that it’s a game of skill and then advertise that casual players can easily score big money by beating the pros.

State Attorney General Eric Schneiderman and representatives of the industry he shut down, such as giants DraftKings and FanDuel, agreed to a truce in March. The sites stopped taking plays in the state.

If the State Legislature and Gov. Andrew Cuomo declare the contests legal, Schneiderman will drop his attempts to stop the games in court. If the games are not legalized, his case, which hinges on whether daily fantasy sports are games of chance and thus constitutionally banned gambling, will be heard in September in state appellate court. The first congressional hearing on the subject, in Washington in May, only muddied the waters, though it seems unlikely that regulation of these games will end up in federal hands.

Leaders of committees in Albany that oversee wagering say they are close to agreeing on legislation to approve the games, which is wise. Players want them and nonplayers mostly don’t care. And the pretense that the state constitution prohibits gambling has gone from silly to simply exhausting.