Sam Bankman-Fried asked FTX’s top in-house lawyer for “legal justifications” that would explain how billions in customer funds from his cryptocurrency exchange ended up at his private trading firm Alameda Research in the middle of a last-ditch bid to be rescued by private equity group Apollo, according to testimony in his criminal trial. Can Sun, who was general counsel of FTX’s international business, took the witness stand on Thursday at the New York federal trial against Bankman-Fried on charges of defrauding customers, lenders and investors at FTX. The exchange FTX collapsed last November when it did not have enough money to cover a rush of customer withdrawals. To fill the multibillion- dollar hole, Bankman-Fried began a fundraising drive that included contacting Apollo about an emergency investment. Prosecutors walked Sun through FTX’s terms of service and other policy documents. He repeatedly testified that FTX had no right to spend or lend out its customers’ funds, and that he himself had no idea about the flow of funds to Alameda until days before the exchange failure. “There were no legal justifications for the money being taken,” Sun said. Bankman-Fried has pleaded not guilty and maintains his innocence. Sun, who has been granted immunity from prosecution, recalled that on November 7 last year he was pulled into a call with Apollo, which asked for financial information from FTX. Sun then met senior FTX executives and Bankman-Fried’s father, Joe Bankman, at an apartment in the luxurious Bahamas complex where many FTX staff lived. He reviewed a financial spreadsheet that had been prepared for Apollo. It showed a $7bn customer fund shortfall and a list of assets that Alameda might be able to return to FTX. Bankman-Fried said that after viewing the spreadsheet, Apollo had asked him for the legal basis for the customer funds being at Alameda, Sun testified. Bankman-Fried asked Sun to come up with “legal justifications”. “It basically confirmed my suspicions that had been rising all day,” Sun said. That evening, Sun and Bankman-Fried took a walk around the Bahamian compound. Sun said he ran Bankman-Fried through possible legal justifications for loans to Alameda, including the exchange’s margin lending programme. Sun said he told Bankman-Fried that none of those explanations fit the facts of FTX’s position. Alameda borrowed more from FTX than had ever been offered by its margin lending system. “He said: ‘yup, yup’,” Sun recalled. Sun quit the following morning after Nishad Singh, another FTX executive, explained to him how Alameda siphoned off customer money. FTX filed for bankruptcy days later after its fundraising efforts fizzled. Prosecutors tried to show the jury that Bankman-Fried had used the justifications he discussed with Sun as he tried to defend himself in the media, despite being told they were not valid. They showed the jury a clip from Bankman-Fried’s interview on the Good Morning America news show shortly after the bankruptcy, in which he alluded to margin lending as a possible reason that customer funds were missing. Judge Lewis Kaplan on Thursday called an “intermission” in the trial. The prosecution is expected to rest its case late next week, after which Bankman-Fried may take the stand in his own defence.