NEW YORK - Cryptocurrency exchange FTX's former top lawyer testified on Thursday at its founder Sam Bankman-Fried's fraud trial that the defendant told him that the now-bankrupt company had kept its customer funds safe and separate from its own assets.

Can Sun, FTX's former general counsel, also said he never approved the lending of FTX customer funds to Alameda Research, Bankman-Fried's crypto-focused hedge fund.

"Absolutely not," Sun said, when asked by prosecutor Danielle Sassoon if he had ever approved such loans.

The testimony during the third week of Bankman-Fried's trial in Manhattan federal court could undercut the defendant's argument that he had a good-faith belief that FTX's treatment of customer funds was appropriate and that the company's lawyers were involved in many of his key decisions.

Prosecutors have said Bankman-Fried looted billions of dollars in FTX customer funds to prop up Alameda, make speculative venture investments, and donate more than $100 million to U.S. political campaigns. The former billionaire has pleaded not guilty to two counts of fraud and five counts of conspiracy. Bankman-Fried, 31, could face decades in prison if convicted.

Bankman-Fried has acknowledged making mistakes in running FTX, but said he never intended to defraud customers. The defense is set to begin presenting its case on Oct. 26. His lawyers have said Bankman-Fried is considering testifying in his own defense.

(Reporting by Luc Cohen in New York; Editing by Will Dunham)