Even as traders see their friends fired, banks are bringing in battalions of compliance lawyers, accountants and even spies from the CIA and British intelligence to watchdog them. Like something out of “The Matrix,” new reg-tech startups are releasing algorithms into the datastream of banks to hunt for behavorial patterns that anticipate rogue trades before they happen.

While star performers still pull down high-seven-figure or eight-figure pay packages, quiet trading desks mean smaller rewards for the rank and file. The average compensation for senior equity and fixed-income traders has fallen by more than half since 2007, according to Options Group, a New York executive search firm specializing in the financial industry.

“The days when you could get a 30 percent to 50 percent jump in salary guaranteed for two years and a 20 percent to 100 percent signing bonus are gone,” says Options Group CEO Mike Karp. “And they are never coming back.”

The pain for some has created opportunities for others. The bond market’s next chapter is taking shape in a 106-year-old brick building in lower Manhattan that used to store fountain pens. These days it houses startups. Amar Kuchinad, founder and CEO of one of them, Electronifie Inc., is building a digital trading platform for corporate debt.

Sitting in a conference room in the firm’s loft-style office, complete with Ping-Pong table, Kuchinad describes how he became intrigued by the changes wrought by Dodd-Frank and the Basel Committee on Banking Supervision. So he quit his job as a managing director in Goldman Sachs’s credit-trading unit in 2011 and joined the Securities and Exchange Commission as a senior policy adviser. Suddenly, he found himself on the other side of the table from his former industry as it dealt with new capital ratios.

“I saw market participants come to Washington and tell the agency, ‘This is going to crush liquidity in the corporate bond market,’” Kuchinad says.

He drew another conclusion: The time had come to provide a digital alternative that could match buyers and sellers without the need for dealers. In 2013, he formed Electronifie, and since then it has executed about $2 billion of transactions with a network of more than 450 traders. It’s not alone. Dozens of platforms, including industry leader MarketAxess Inc. and one owned by Bloomberg LP, the parent of Bloomberg News, are making inroads with the model.

“That means a lot more of this business is going to be data-driven instead of relationship-driven,” says Kuchinad, 42.

Investors, too, are seeing their models shaken by the stark realities of a post-crash world. Pension plans and the super-rich plowed cash into hedge funds, whose combination of mystique and exclusivity promised market-beating performance. As assets in these vehicles almost doubled to $2.7 trillion from 2008 to 2015, they’ve delivered anything but. The S&P 500 Index returned 80 percent including reinvested dividends in the five years through July 20 compared with a decline of 1.3 percent for the HFRX Global Hedge Fund Index.

Adding insult to injury, investors typically pay hedge funds a 2 percent management fee and 20 percent of their profits. You can buy shares in an S&P 500 ETF for 0.09 percent. More than 970 hedge funds closed last year, the most since 2009, according to Chicago-based Hedge Fund Research. Tudor Investment Corp., the $11.6 billion hedge fund run by Paul Tudor Jones, said in May that it would reduce its fees. Mutual funds are getting hit, too. On June 16, Grantham Mayo Van Otterloo & Co., the Boston firm founded by Jeremy Grantham, cut 10 percent of its 650-person staff following a 20 percent drop in assets.