In the world of high finance, simple customer deposits are supposed to be safe, sound and boring. But according to a settlement with federal regulators Thursday, Merrill Lynch misused clients’ assets over a span of four years, diverting cash toward its own risky trading activities in contravention of customer protection laws.

The $415 million settlement with the Securities and Exchange Commission — the largest payout to the agency since 2013 — comes as regulators push banks toward less-complex structures, intended to safeguard consumer assets from the sort of market risks investment banks regularly weather.

“The rules concerning the safety of customer cash and securities are fundamental protections for investors and impose lines that simply can never be crossed,” Andrew Ceresney, director of the SEC’s enforcement division, said in a statement. “Merrill Lynch violated these rules, including during the heart of the financial crisis, and the significant relief imposed today reflects the severity of its failures.”

The SEC accused Merrill Lynch of two sets of compliance lapses. First, instead of keeping customers’ investments in a safe reserve account, from 2009 through 2012 Merrill Lynch engaged in “complex options trades that lacked economic substance,” allowing the bank to free up billions of dollars a week to engage in trading activities, the statement read.

baml A diagram of the complex maneuver used between 2009 and 2012 to free up billions of dollars for trading activities. Photo: Securities and Exchange Commission

Second, from 2009 until this year, the bank improperly held customer assets in accounts subject to liens from creditors. By borrowing against supposedly safe customer deposits, the settlement stated, Merrill Lynch put its clients on the hook in the event of a crisis: “Had Merrill Lynch failed in the midst of these trades, the firm’s customers would have been exposed to a massive shortfall.”

The firm, a subsidiary of Bank of America, admitted to the wrongdoing. The bank was also required to amend its severance agreements to remove language that the SEC said discouraged employees from speaking to regulators over compliance concerns.

In an unrelated settlement, Merrill Lynch agreed to pay $10 million to the SEC and $5 million to Wall Street’s self-regulatory organization, Finra, over allegations that brokers marketed complex offerings to customers without disclosing hefty fees hidden within.