A US bankruptcy judge ruled on Wednesday that Celsius Network owns most of the cryptocurrency that customers deposited into its online platform, meaning most Celsius customers will be last in line for repayment in the crypto lender’s bankruptcy.

The ruling by US Bankruptcy Judge Martin Glenn in New York affects approximately 600,000 accounts that held assets valued at $4.2 billion when Celsius filed for bankruptcy in July. The company does not have enough funds to fully repay those deposits, Glenn wrote.

The ruling means that most Celsius customers will be lower priority than customers who held non-interest bearing accounts and other secured creditors. It was unclear whether Celsius has significant secured debt.

The ruling also prevents in-fighting for higher priority among customers with interest-bearing accounts, avoiding a situation in which some of those customers are repaid 100 per cent of their deposits while similarly-situated customers are able to recover “only a small percentage” of their deposits, according to Glenn. Celsius’ terms of service made clear that the crypto lender took ownership of customer deposits into its interest-bearing Earn accounts, according to Glenn. That means that Earn customers will be treated as unsecured creditors in Celsius’ bankruptcy, and they will be last in line for repayment after Celsius repays higher-priority debts.

Twelve US states and the District of Columbia had objected to Celsius’ bid to claim the digital assets. They argued among other things that it was unclear if customers understood the terms of service and that Celsius was under investigation in several states for violating regulations, which could arguably prevent the company from relying on the terms of use.

The ruling does not mean that Earn customers will get “nothing” in the bankruptcy case, and it does not stop further challenges to Celsius’s ownership of the crypto deposits, Glenn wrote.

Celsius customers may be able to bring fraud or breach of contract claims against the crypto lender, and state regulators may be able to make the case that the accountholders’ contracts cannot be enforced because they violated state securities laws, according to the ruling.

“The Court does not take lightly the consequences of this decision on ordinary individuals, many of whom deposited significant savings into the Celsius platform,” Glenn wrote. “Creditors will have every opportunity to have a full hearing on the merits of these arguments during the claims resolution process.”

The ruling authorizes Celsius to sell approximately $18 million stablecoins that had been held in customers’ Earn accounts.

In December, Glenn ruled that a relatively small group of customers with different kinds of Celsius accounts were entitled to their deposits back during Celsius’s bankruptcy. That ruling was limited to customers who had non-interest-bearing custody accounts, whose funds were not commingled with other Celsius assets, and whose accounts were too small for Celsius to seek to claw them back to repay other customers.

The broader question of who owns crypto assets is a critical one in other crypto bankruptcies as well, including the cases of crypto lenders Voyager Digital and BlockFi.