Like this book’s other heroes, Mr. Katsuyama has an inquisitive, scientific mind; the more clearly he saw that the markets were rigged, the better he wanted to understand what was wrong with them. He began experimenting on his own and developed a better understanding of how the hoodwinking worked. Federal investigators and New York State’s attorney general have begun looking into whether such trading practices ought to be monitored and regulated.

One of his first colleagues, in what would eventually become a gutsy, game-changing new venture, was Rob Park, an algorithm guy. “All Brad needs is a translator from computer language to human language,” Mr. Park told Mr. Lewis. “Once he has a translator, he completely understands it.” With the funding of the Royal Bank of Canada, the two conducted a series of experiments that provided invaluable information about how high-frequency traders could predict imminent stock movements and exploit them. They even created a weapon, called Thor, that was meant to level the playing field for the ordinary investor. “It would have been very easy to make money off this,” Mr. Park says of Mr. Katsuyama. “He just chose not to.”

The rest of the book tells the riveting story of how this detective work exposed more and more dangerous flaws in the present market system. Mr. Katsuyama consistently sounds like a force for decency and good, even if Mr. Lewis gives him a “Batman” moment or two. To his future wife he declared (really?): “It feels like I’m an expert in something that badly needs to be changed. I think there’s only a few people in the world who can do anything about this. If I don’t do something right now — me, Brad Katsuyama — there’s no one to call.”

So he did something, in this book’s one true movie moment. “Let’s just create our own stock exchange,” he proposed to Mr. Park. That was in 2011, and it occurs less than halfway through the book, because Mr. Lewis needs room to talk about why changing the world wasn’t as easy they expected it to be. Many a dirty trick awaits anyone trying to push back against common Wall Street practice with a firm dedicated to fairness and transparency. But the firm, which was called the Investors Exchange until someone realized that the Internet address could be read as Investor Sex Change, and then became IEX, opened in October 2013. It has had support from Goldman Sachs, because, according to Mr. Lewis, events like the “Flash Crash” of May 6, 2010, are ever more apt to occur in a fast, computerized system and scare American investors out of the market. One of the book’s most controversial points is that affiliation with a fair and square IEX will be good for larger firms’ reputations.

But Mr. Lewis hardly means to suggest we’re out of the woods. He ends this book with a trip through the forest, up a mountain and right to the base of a sinister microwave tower with an F.C.C. license number that he provides. Got a computer and a free day? He claims you can track down that license to find another Wall Street nightmare in the making.