FTX.COM

IN MID-2020, FTX鈥檚 chief engineer made a secret change to the cryptocurrency exchange鈥檚 software.

He tweaked the code to exempt Alameda Research, a hedge fund owned by FTX founder Sam Bankman-Fried, from a feature on the trading platform that would have automatically sold off Alameda鈥檚 assets if it was losing too much borrowed money.

In a note explaining the change, the engineer, Nishad Singh, emphasized that FTX should never sell Alameda鈥檚 positions. 鈥淏e extra careful not to liquidate,鈥 Mr. Singh wrote in the comment in the platform鈥檚 code, which it showed he helped author. Reuters reviewed the code base, which has not been previously reported.

The exemption allowed Alameda to keep borrowing funds from FTX irrespective of the value of the collateral securing those loans. That tweak in the code got the attention of the US Securities and Exchange Commission (SEC), which charged Mr. Bankman-Fried with fraud on Tuesday. The SEC said the tweak meant Alameda had a 鈥渧irtually unlimited line of credit.鈥 Furthermore, the billions of dollars that FTX secretly lent to Alameda over the next two years didn鈥檛 come from its own reserves, but rather were other FTX customers鈥 deposits, the SEC said.

The SEC and a spokesperson for Mr. Bankman-Fried declined to comment for this story. Mr. Singh did not respond to several requests for comment.

The regulator, which called the exchange 鈥渁 house of cards,鈥 alleged Mr. Bankman-Fried concealed that FTX diverted customer funds to Alameda in order to make undisclosed venture investments, luxury real estate purchases, and political donations. US prosecutors and the Commodity Futures Trading Commission also filed separate criminal and civil charges, respectively.

The complaints 鈥 along with previously unreported FTX documents seen by Reuters and three people familiar with the crypto exchange 鈥 provide new insights into how Mr. Bankman-Fried dipped into customer funds and spent billions more than FTX was making without the knowledge of investors, its customers and most employees.

Police in the Bahamas, where FTX was based, arrested Mr. Bankman-Fried on Monday evening, capping a stunning fall from grace for the 30-year-old former billionaire. His company collapsed in November after users rushed to withdraw deposits and investors shunned his requests for more financing. FTX declared bankruptcy on Nov. 11 and Mr. Bankman-Fried resigned as chief executive.

Mr. Bankman-Fried has apologized to customers, but said he didn鈥檛 personally think he had any criminal liability.

The auto-liquidation exemption written into FTX code allowed Alameda to continually increase its line of credit until it 鈥済rew to tens of billions of dollars and effectively became limitless,鈥 the SEC complaint said. It was one of two ways that Mr. Bankman-Fried diverted customer funds to Alameda.

The other was a mechanism whereby FTX customers deposited over $8 billion in traditional currency into bank accounts secretly controlled by Alameda. These deposits were reflected in an internal account on FTX that was not tied to Alameda, which concealed its liability, the complaint said.

鈥楽AFE, TESTED AND CONSERVATIVE鈥
As Mr. Bankman-Fried grew FTX into one of the world鈥檚 largest crypto exchanges, consumer protection was a central tenet of his pitch for crypto regulation in the United States. Mr. Bankman-Fried stressed this theme in countless statements to customers, investors, regulators and lawmakers. FTX鈥檚 auto-liquidation software would protect everyone, he explained.

In congressional testimony on May 12, he called FTX鈥檚 software 鈥渟afe, tested and conservative.鈥

鈥淏y quickly unwinding the riskiest, most undercollateralized positions, the risk engine prevents build-up of credit risk that could otherwise cascade beyond the platform, resulting in contagion,鈥 Mr. Bankman-Fried testified.

He did not tell lawmakers about the software change to exempt Alameda. Indeed, he told investors that Alameda received no preferential treatment from FTX, the SEC complaint said.

Mr. Bankman-Fried had directed subordinates to update the software in mid-2020 to enable Alameda to maintain a negative balance on its account, the SEC complaint said. No other customer account at Alameda was allowed to do so, the complaint added. This would allow Alameda to keep borrowing more FTX funds without the need to provide more collateral.

In software tweaks made in August 2020, Alameda was designated as the 鈥淧rimary Market Maker鈥 or 鈥淧MM,鈥 according to a Reuters review of its codebase. Market makers are dealers who enable trading in an asset by standing ready to buy and sell it.聽

To explain the change, Mr. Singh, the chief engineer, inserted a comment into the code: 鈥淎lameda would be liquidating, prevented.鈥 He included a warning 鈥渘ot to liquidate the PMM.鈥

Only Mr. Singh, Mr. Bankman-Fried and a few other top FTX and Alameda executives knew about the exemption in the code, according to three former executives briefed on the matter. A digital dashboard used by staff to track FTX customer assets and liabilities was programmed so it would not take into account that Alameda had withdrawn the client funds, according to two of the people and a screenshot of the portal that Reuters has previously reported.

Mr. Bankman-Fried鈥檚 house of cards 鈥渂egan to crumble鈥 in May 2022, the SEC complaint said.

As the value of crypto tokens plummeted that month, several of Alameda鈥檚 lenders demanded repayment. Since Alameda didn鈥檛 have the funds to meet these requests, Mr. Bankman-Fried directed Alameda to tap its 鈥渓ine of credit鈥 with FTX to obtain billions of dollars in financing, the complaint said.

Ultimately, when FTX customers dashed to withdraw their money this November, spooked by media reports about the company鈥檚 financial health, many discovered that their funds were no longer there. 鈥 Reuters