Bankrupt cryptocurrency exchange FTX and its affiliate trading firm Alameda Research have been ordered to pay $12.7 billion in relief to its customers, ending a 20-month lawsuit from the US agency Commodity Futures Trading Commission (CFTC).