A programmer who developed high-frequency trading code for financial powerhouse Goldman Sachs has won his appeal against an eight-year prison sentence, and been released from jail.

The 2nd US Circuit Court of Appeals ruled that Sergey Aleynikov, a naturalized US citizen from Russia, was not guilty of stealing computer code under the Economic Espionage Act (EEA). In an unusual step, the court ruled that he should be released from jail immediately.

“What’s unusual is that they ordered the immediate release,” Aleynikov’s lawyer Kevin Marino told The Register. “Usually this process takes weeks or months.”

He explained that the court appeared to have accepted the defense’s argument that Aleynikov was incorrectly charged. The EEA covers the theft of products for interstate and international commerce, but since Goldman Sachs was not selling its high-frequency trading system and, as such, it was not a good, ware, or merchandise that are covered in the legislation.

Marino said that it was possible that his client had violated a confidentiality agreement with Goldman Sachs, but that the government had resorted to the EEA law and was now left with little legal options other than appealing up the legal ladder. A Goldman Sachs spokesman told El Reg it had no comment on the matter.

Aleynikov worked for Goldman Sachs between 2007 and 2009, developing high-frequency trading software for the company – code that seeks to take advantage of small arbitrage opportunities in stock prices by placing millions of trades and then cancelling most of them as unprofitable. By piling in huge amounts of money into trades identified by the software as profitable, Goldman realized over $550m in profits, the case revealed.

But Aleynikov was approached by rival Teza Technologies, who wanted him to develop a similar platform for them. He uploaded code to a remote server in Germany shortly before leaving Goldman Sachs, encrypting the data and attempting to hide the transmission, but was arrested when Goldman alerted the authorities.

Aleynikov claimed that he thought he was only sending open source code from his employers, and that didn’t realize that any proprietary code was included. The court initially rejected his lawyer’s arguments and sent him to the Big House for eight years, as well as imposing a fine of $12,500 and ordering him to serve three years of supervised release. He has served nearly a year of his sentence, but is now a free man. ®