A New York Judge has approved a consent order that effectively ends a 20-month lawsuit from the U.S. Commodities and Futures Trading Commission (CFTC) against FTX and its sister company Alameda Research.

In a filing on Aug. 7, District Judge Peter Castel approved the order that would see FTX and Alameda pay $8.7 billion in restitution and a further $4 billion in disgorgement. 

Notably, the CFTC, described by CEO John Ray III as FTX’s biggest creditor, did not seek civil monetary penalties. As a result, the entire $12.7 billion sum will be paid out to creditors of the FTX bankruptcy estate, which largely consists of retail investors.

The order also permanently bans FTX and Alameda from trading digital assets and acting as a market maker or custodian.

Earlier this year, FTX settled a dispute with the Internal Revenue Service (IRS), with the bankrupt exchange agreeing to pay a $200 million priority claim to the tax agency. FTX also agreed to pay the IRS a further $685 million as a junior priority claim to the extent that funds are available after its distribution plan. 

Under the terms of FTX’s reorganization plan, 98% of creditors are set to receive 118% of their claims within 60 days of the plan coming into effect. The remaining creditors are to be paid out 100% of their claims and billions in compensation for “the time value of their investments.”

FTX creditors are in the process of deciding their preferred payment method, with some opting for a crypto payout over fiat. They have until August 16 to submit their preferences, and U.S. Bankruptcy Court Judge John Dorsey will issue a final ruling on the subject on Oct. 7.