The U.S. Commodities Futures Trading Commission announced Wednesday the result of joint enforcement action with the New York Attorney General’s Office in which two brokerage firms have agreed to pay a total of $25 million to state and federal regulators to avoid potential criminal charges and civil litigation over allegations that their employees used illegal methods to solicit consumer trading of foreign currencies.

The New York Attorney General’s Office said BGC Financial LP and GFI Securities LLC, had violated the state’s Martin Act, which is used to police fraudulent activity on Wall Street.