Three Charles Schwab investment adviser subsidiaries have agreed to pay $187 million to settle charges laid by the Securities and Exchange Commission (SEC) the units were allocating investors’ cash holdings in a way that was less profitable under most market conditions and misled investors about the strategies involved.

From 2015-18, the subsidiaries—Charles Schwab & Co., Charles Schwab Investment Advisory, and Schwab Wealth Investment Advisory—allegedly told investors the amount of cash in their portfolios was determined through a “‘disciplined portfolio construction methodology,’” and that the firm’s robo-adviser product, Schwab Intelligent Portfolios, would seek “‘optimal return[s],’” the SEC said Monday in a press release.

“In reality, Schwab’s own data showed that under most market conditions, the cash in the portfolios would cause clients to make less money even while taking on the same amount of risk,” the agency said. “Schwab advertised the robo-adviser as having neither advisory nor hidden fees but didn’t tell clients about this cash drag on their investment.”

According to the SEC, “Schwab made money from the cash allocations in the robo-adviser portfolios by sweeping the cash to its affiliate bank, loaning it out, and then keeping the difference between the interest it earned on the loans and what it paid in interest to the robo-adviser clients.”

The practice earned Schwab nearly $46 million in profits over the three-year period, the SEC said in its order.

Without admitting or denying the SEC’s charges, Schwab’s three subsidiaries agreed to be censured, to a cease-and-desist order that prevents future violations of the antifraud provision in securities law, to pay $52 million in disgorgement and prejudgment interest, and pay a $135 million civil fine. The money will be returned to harmed investors through a fair fund account, Schwab said in a press release.

The SEC said in its order that unlike most robo-adviser products, Schwab Intelligent Portfolios did not charge an advisory fee. The robo-adviser would set aside a specified percentage of cash in portfolios, but that cash would be outperformed by other assets like equities. The subsidiaries allegedly made misleading statements about the robo-adviser’s cash allocation strategies and failed to disclose to investors the resulting conflicts of interest.

One of the subsidiaries, Charles Schwab & Co., also published advertisements with misleading statements regarding the robo-adviser’s investment strategies, the SEC said. Some of those advertisements said there were no hidden or advisory fees but failed to disclose the company’s internal models showed when other assets such as equities outperform cash it would reduce investor’s returns by “approximately as much as advisory fees would have,” according to the agency.

As part of the settlement, the Schwab subsidiaries agreed to retain an independent consultant within 60 days of the date of the order to review their policies and procedures relating to their robo-adviser’s disclosures, advertising, and marketing and to ensure they are effectively following those policies and procedures. Schwab will agree to hire the consultant for two years and will not be able to replace the consultant without the SEC’s consent, the order said.

Schwab must fully cooperate with the consultant by providing access to files, data, and employees. Following the submission of a report to the SEC, Schwab must implement the consultant’s recommendations and then follow up with a certification the recommendations were implemented.

Schwab said in a statement it was “pleased to put this behind us.”

“We believe resolving the matter in this way is in the best interests of our clients, company, and stockholders as it allows us to remain focused on helping our clients invest for the future. As always, we are committed to earning our clients’ trust every day and work diligently to maintain the highest standards for professional conduct throughout our organization,” the statement said.

The company also noted its robo-adviser product “allows investors to elect not to pay an advisory fee in return for allowing us to hold a portion of the proceeds in cash, and we do not hide the fact that our firm generates revenue for the services we provide. We believe that cash is a key component of any sound investment strategy through different market cycles.”