The battle of the bankrupt crypto entities looks to be coming to an end as crypto lender BlockFi reached an “in principle” agreement with the estates of FTX and Alameda Research.

A Wednesday court filing details the terms of a settlement, under which BlockFi will receive a total of $874.5 million in claims against FTX and Alameda Research. Of this, $185.2 million is a claim on the value of BlockFi’s assets on the FTX exchange and $689.3 million is a claim against BlockFi’s loans to Alameda.

$250 million will be treated as a secured claim and will prioritize payment to BlockFi after FTX’s plan to end bankruptcy is approved by creditors. BlockFi expects that it will be able to make a second interim distribution to its creditors in the near term as a result of this. 

Under the terms of the settlement, FTX has also agreed to drop its claim against BlockFi. A judge is  yet to sign off on the agreement, but BlockFi is optimistic that it will bring them one step closer to full recoveries for creditors.

“This negotiated agreement represents an excellent outcome for BlockFi and its customers – one better than could have been anticipated even on the effective date of the Plan,” wrote BlockFi’s bankruptcy administrators in the filing.

“[This Plan] ensures that money reserved for litigation with FTX is directed instead to customer distributions,” they added.

BlockFi filed for bankruptcy shortly after FTX, citing the latter’s collapse as a big part of the reason behind its insolvency. At the time, BlockFi had around $355 million worth of assets on FTX’s platform and $671 million in loans to Alameda.

An automatic stay that took effect when FTX filed for bankruptcy meant that creditors were prevented from pursuing claims against it. In November, a US Judge ended the stay on the proceedings between FTX and BlockFi, allowing the two to resume claim negotiations and ordered the two to file for mediation no later than December.