Bankrupt crypto exchange FTX and affiliate Alameda Research were ordered by a court to pay $12.7 billion to customers and victims of their fraud, the Commodity Futures Trading Commission said in a news release.

US District Judge Peter Castel of the Southern District of New York approved a consent order that ended a CFTC lawsuit filed in December 2022.

The amount includes $8.7 billion in restitution and $4 billion in disgorgement, which will be used to further compensate victims for losses suffered as a result of the massive FTX fraud.

“FTX used age-old tactics to create an illusion that it was a safe and secure place to access crypto markets,” said CFTC Chairman Rostin Behnam. “But the basic regulatory tools, like governance, customer protections, and surveillance that exist to identify misconduct and ultimately prevent collapse, were simply not there.”

In a related settlement approved by the Bankruptcy Court for the District of Delaware, the CFTC agreed not to seek a civil monetary penalty against FTX and to subordinate its monetary claims to those of victims of the FTX fraud scheme.

FTX had a run on customer deposits in late 2022 that led to revelations of its fraud that took customer funds, mingled them with its own, and spent on political influence, celebrity endorsements, and real estate.

A federal judge for the Southern District of New York sentenced FTX founder Sam Bankman-Fried to 25 years in prison in March, citing the “brazenness” of his fraud, DL News reported.