After Mr. Shkreli lost millions of dollars in a trade, draining the remaining money from MSMB Capital, a few days later he founded MSMB Healthcare, in early 2011, the prosecutor said. About the same time, he formed the pharmaceutical company Retrophin, and had MSMB Healthcare invest in Retrophin. “The defendant was on both sides of the deal,” Mr. Srinivasan said.

When his debt for the trading loss came due, “he stole money from MSMB Healthcare” to pay the debt, which the health care fund did not owe, Mr. Srinivasan said. Mr. Shkreli then told investors that he was shutting down the two funds, and told them they could have stock in Retrophin or cash for their shares.

Those who wanted cash could not get it and threatened to sue, he said, and that is when Mr. Shkreli arranged for Retrophin to “pay off” the MSMB investors.

“Retrophin owed these investors nothing — the defendant owed these debts,” Mr. Srinivasan said. When accountants told him to stop, Mr. Shkreli arranged to hire the investors as consultants, a sham, the prosecutor said.

Investors may have made their money back, Mr. Srinivasan said, but Mr. Shkreli still committed fraud.

In his opening, Mr. Brafman flipped the setup that Mr. Srinivasan had constructed in trying to portray the investors and Retrophin board as victims and Mr. Shkreli as a villain.

Actually, Mr. Brafman said, Mr. Shkreli was pushed out of Retrophin because its board thought he did “not conform to their idea of what a public company C.E.O. should look like or walk like or talk like,” he said.