Bankrupt cryptocurrency exchange FTX and the United States commodities regulator have agreed to a $12.7 billion settlement, resolving a 19-month long lawsuit.

The agreement comes after months of back-and-forth negotiations and is now only subject to court approval, a recently released July 12 filing shows.

"The Proposed Settlement is an integral and valuable component of the Debtors’ proposed chapter 11 reorganization plan," said Commodity Futures Trading Commission senior trial attorney Carlin R. Metzger and FTX’s CEO John. J Ray III.

"It resolves ongoing litigation and disputes with one of the largest creditors of the Debtors, avoids the cost and delay of further litigation, and mitigates a significant risk of diminution of the assets available for distribution to creditors.”

The CFTC sued FTX, its former CEO Sam Bankman-Fried and FTX’s sister trading firm Alameda Research in December, 2022 — claiming the firm committed fraud and made misrepresentations by marketing FTX.com as a digital commodity asset platform.

The settlement agreement comprises $8.7 billion in restitution and $4 billion in disgorgement.

The CFTC didn’t seek a civil monetary penalty, with FTX stating:

"Given the conduct, guilty pleas and convictions of the FTX Insiders, the Debtors face very substantial potential liability to the CFTC.”

The commodities regulator is the “most significant single creditor" in Chapter 11 bankruptcy cases, FTX added.

A hearing on the settlement is set for Aug. 6 in the Bankruptcy Court for the District of Delaware.

Related: Small creditors put at risk by latest FTX bankruptcy development

FTX’s proposed reorganization plan would see a 118% return for 98% of the creditors — those with claims under $50,000 — based on the US dollar value of asset prices at the time of FTX’s bankruptcy filing in November 2022.

However, many FTX creditors expressed a preference to receive a cryptocurrency payout in-kind, which would factor in the market’s 166% increase in market cap since FTX made the bankruptcy filing.

Creditors are currently voting on how they would prefer to be paid out. They have until Aug. 16 before US Bankruptcy Court Judge John Dorsey will make a final decision on Oct. 7.

Magazine: Deposit risk: What do crypto exchanges really do with your money?