The new book by bestselling author Michael Lewis, “Flash Boys: A Wall Street Revolt,” has provoked a debate over high-frequency stock traders that seems to have missed his more fundamental observation about Wall Street.

It’s not just that the high-frequency traders are probably bad guys. What’s really striking in Lewis’ newest book is once again the almost complete absence on Wall Street of any good guys.

Lewis did find one, Brad Katsu­yama, to help tell his story. Katsuyama was a stock trader at the Royal Bank of Canada in New York when he figured out that he was being cheated.

Somebody out there in the stock market somehow knew Katsuyama’s intention to buy shares before he could even finish placing his order. He just couldn’t figure out who or what was doing it to him, or how.

As told by Lewis, the author who gave us the Wall Street books “Liar’s Poker” and “The Big Short,” Katsu­yama was unwilling to simply put up with the problem. He assembled a small team including an Irish telecom expert and dug into it.

The guys making money off the Royal Bank of Canada trader’s intentions turned out to be high-frequency traders. It’s a form of stock trading that seeks to capture trading profits from small discrepancies in share prices that have happened so quickly that time even in microseconds turns out to be important.

The problems Katsuyama found included front-running, an age-old problem in financial markets in which a broker trades for his own account on the knowledge of pending orders. Katsuyama’s buy order within milliseconds got to other exchanges and the offer of shares at a given price had by then already evaporated, with the share price now higher.

The high-frequency traders had managed to jump between Katsuyama and the stock he wanted to buy. They were perfectly willing to sell him the stock that they had owned for less time than a tick of the clock, but at the new, higher price.

Team Katsuyama then turned to coming up with a solution, and ultimately settled on a new, much fairer, electronic stock exchange. It was a remarkably simple fix to eliminate the HFT shops’ speed edge, simply by putting the exchange 38 miles away from the point where any brokers connected to it. To do that, they coiled miles of fiber-optic cable in a drawer and ran the orders through that cable.

In telling this story, Lewis had reached the conclusion that the stock market itself was “rigged.”

That kicked up a furor upon publication of the book last week. The high-frequency traders shot back that they provide much-needed liquidity to the markets through their buying and selling.

One of the firms had actually named itself Virtu Financial and yes, it’s apparently pronounced “Virtue.”

Another criticism of Lewis is that even if the high-frequency traders are picking off a fraction of a penny, they are getting those pennies from big hedge funds and not 100-share traders clicking the mouse on E-Trade.

So why the whining? There have always been intermediaries standing between people who want to buy and people who want to sell, taking their cut. There was a time when traders at the most respected firms took 50 cents per share out of a Nasdaq stock trade, and it was both legal and accepted by investors.

To suggest that the corruption going on now is really pretty minor, however, isn’t that persuasive. The pennies do add up.

Where are the regulators? Asleep again, according to Lewis.

The big Wall Street firms? Most are in on it, sending their own clients’ orders into their private exchanges — called “dark pools” — where high-frequency traders are also welcome. The big firms also routinely ignored client instructions to fill orders on the new exchange Katsuyama had cofounded.

In “Flash Boys,” even the stock exchanges are in on the action, from the New York Stock Exchange on down. They created a dizzying array of order types that were really not securities orders at all and let high-frequency trading firms set up computers right next to their own to provide them a slight time edge.

The exchanges also have turned themselves into electronic systems of such fragile complexity that “glitches” are common and a flash crash like the one in 2010 that took the Dow down 600 points in five minutes could happen tomorrow.

Aside from the small band that put together a new exchange, the only people in “Flash Boys” wearing white hats are investors who funded development of the new exchange — mostly hedge fund managers.

Their virtue is also questionable. They seem perfectly willing to capitalize on an edge in the market by, for instance, lobbying government officials to investigate a company they had bet against in the stock market.

The best explanation for their role here is that they knew they weren’t ever going to catch the HFT shops in trading speed so they were willing to help someone like Katsuyama try to stop them.

That’s it. Nobody else comes off looking like anything other than part of the problem.

And if the good guys can all ride to work in one New York subway car, then the investor needs to be reminded of this simple truth: Buy or sell a security, and understand that the computer or person or institution on the other side of the trade will know more than you and will be making a riskless profit on that knowledge.

That’s the larger point Lewis is once again making.

It must be said, though, that as good as Lewis is at chronicling the New York financial industry, he clearly doesn’t always get it right.

A Princeton art history major, he once worked as a bond salesman for a big Wall Street house called Salomon Brothers. He took a look around at the trading of mortgage derivatives and figured the whole industry would soon have a day of reckoning.

Any system that allowed unqualified young people like him to get rich working in finance, all the while being encouraged to put their own interests ahead of clients, was obviously unsustainable. He was, he once wrote, getting out while the getting was good.

That was in 1988.