Former crypto boss Sam Bankman-Fried has been testifying to a judge at his trial after the jury was sent home.
The former entrepreneur was asked to speak to Judge Lewis Kaplan to determine which parts of his testimony can be put to the jury.
The 31-year-old is accused of lying to investors and lenders and stealing money from customers of his now-bankrupt cryptocurrency exchange, FTX.
He put forward arguments that he was acting on legal advice in good faith.
The judge sent the jury home so he could decide which portions of Mr Bankman-Fried's testimony, if any, would be admissible as evidence.
The move gave Mr Bankman-Fried and the lawyers a practice run before he potentially speaks in front of the jury.
Mr Bankman-Fried defended decisions that had been questioned by prosecutors, including setting some group chats to delete automatically. He said this complied with record keeping policies set up by his legal team.
He said he had discussed many other arrangements with his lawyers, including personal loans he received from Alameda, and its role as a "payments processor" for FTX.
"Did you take comfort from the fact that lawyers had structured the loans?" Mr Bankman Fried's attorney Mark Cohen asked. "Yeah, of course," Mr Bankman-Fried responded.
He added he had trusted his legal team to prepare applications for bank accounts for his companies. "I trusted that they were proper forms," he said.
Prosecutors have objected to Mr Bankman-Fried's arguments that he acted on legal advice, arguing that it is irrelevant if the attorneys were not fully informed.
The judge did not immediately rule on what testimony Mr Bankman-Fried could give, but warned that he was pretty "dubious" about some of the arguments.
Mr Bankman-Fried spoke clearly and confidently at the start, but wavered under a barrage of questions from prosecutor Danielle Sassoon, quizzing about when he had consulted lawyers and what he had told them when he did.
"Listen to the question and answer directly," Judge Kaplan instructed Mr Bankman-Fried at one point.
Asked if it was his understanding of Alameda was permitted to spend FTX customer funds, Mr Bankman Fried responded: "I wouldn't phrase it that way but … yes."
More than a minute passed after Ms Sassoon asked him to point to language in a policy between the two firms that gave him that impression. He eventually pointed to a line that said the funds could "be held and or transferred".
Judge Lewis Kaplan will rule on Friday on what Mr Bankman-Fried can put before the jury.
Mr Bankman-Fried's expected court appearance drew dozens of curious members of the public to the court, including screenwriters, retirees and others sucked in by the former billionaire's dramatic rise and fall.
His appearance at the New York court follows 12 days of prosecution testimony in which close former colleagues gave evidence.
If he is found guilty he could face a life sentence in prison.
Defendants in the US are not obliged to testify during trials - and are often advised against doing so, since it opens them up to questioning by prosecutors.
It also gives members of the jury that will decide the case a chance to form their own impressions, which might not be favourable.
"If the jury does not believe him, it's a guaranteed conviction," Jacob Frenkel, a former federal prosecutor who has been following the trial told the BBC earlier this month.
Despite the risks, many analysts following the trial predicted Mr Bankman-Fried would take the stand to offer his own version of events and try to undermine the story presented by prosecutors.
"The prosecutors have put on a pretty strong case," said Carl Tobias, law professor at the University of Richmond. "I don't know that there's much downside in this case for him to testify given what we've seen so far."
Prosecutors have built their case on statements from three of his closest former friends and colleagues, who have already pleaded guilty.
They have tied Mr Bankman-Fried to decisions to take money deposited at FTX and use it to repay lenders at his crypto trading firm, Alameda Research, buy property, and make investments and political donations.
They say he tried to hide the transfers between the two firms and their close relationship - and lawyers have buttressed their allegations with text messages, spreadsheets and tweets.
During the trial, these witnesses, who include his ex-girlfriend and former Alameda chief executive Caroline Ellison, have emerged from hours of questioning with their credibility seemingly largely unscathed.
Mr Bankman-Fried's defence team has argued he was following "reasonable" business practices, as his companies grew rapidly.
After the collapse of his companies last year, he admitted in media interviews, including to the BBC, to managerial mistakes but said he never intended fraud.
Elizabeth Holmes is among other high-profile examples of defendants who have opted to testify in their own defence.
The founder of blood-testing start-up Theranos, who argued that she did not intend to defraud investors, was ultimately convicted of four out of 11 counts and sentenced to more than 11 years in prison.
But testifying can also pay off. Tom Barrack, a former private equity executive and fundraiser for former President Donald Trump, and Lebanese businessman Jean Boustani, both took to the stand in separate, unrelated criminal cases and were acquitted.