He applied to switch his major from mathematics to computer science, but the authorities forbade it. “That is what tipped me to accept the idea that perhaps Russia is not the best place for me,” he says. “When they wouldn’t allow me to study computer science.”
He arrived in New York City in 1990 and moved into a dorm room at the 92nd Street Young Men’s and Young Women’s Hebrew Association, a sort of Jewish YMCA. Two things shocked him about his new home: the diversity of the people on the streets and the fantastic range of foods in the grocery stores. He took photographs of the rows and rows of sausages in Manhattan and mailed them to his mother in Moscow. “I’d never seen so many sausages,” he says. But once he’d marveled at the American cornucopia, he stepped back from it all and wondered just how necessary all of this food was. He read books about fasting and the effects of various highly restrictive diets. “I decided to look at it a little bit further and ask what is beneficial and what is not,” he said. In the end he became a finicky vegetarian. “I don’t think all the energy you gain comes from food,” he says. “I think it comes from your environment.”
He’d come to America with no money at all, and no real idea how to get it. He took a course on how to apply for a job. “It was quite frightening,” he says. “I didn’t speak English, really, and a résumé was a totally alien concept.” His first interviewer asked Serge to tell him about himself. “To a Russian mentality,” said Serge, “that question means ‘Where are you born?’ ‘Who are your siblings?’ ” Serge described for the man at great length how he had come from a long line of Jewish scholars and academics—and nothing else. “He tells me I will hear from him again. I never do.” But he had an obvious talent for programming computers and soon found a job doing it, for $8.75 an hour, in a New Jersey medical center. From the medical center he landed a better job, in the Rutgers University computer science department, where, through some complicated combination of jobs and grants, he was able to pursue a master’s degree. After Rutgers he spent a few years working at Internet start-ups until, in 1998, he received a job offer from a big New Jersey telecom company called IDT. For the next decade he designed computer systems and wrote the code to route millions of phone calls each day to the cheapest available phone lines. When he joined the company it had five hundred employees; by 2006 it had five thousand, and he was its star technologist. That year a headhunter called him and told him that there was fierce new demand on Wall Street for his particular skill: writing code that parsed huge amounts of information at great speed.
Serge knew nothing about Wall Street and was in no particular rush to learn about it. His singular talent was for making computers go fast, but his own movements were slow and deliberate. The headhunter pressed upon him a bunch of books about writing software on Wall Street, plus a primer on how to make it through a Wall Street job interview, and told him that, on Wall Street, he could make a lot more than the $220,000 a year he was making at the telecom company. Serge felt flattered, and liked the headhunter, but he read the books and decided Wall Street wasn’t for him. He enjoyed the technical challenges at the giant telecom and didn’t really feel the need to earn more money. A year later, in early 2007, the headhunter called him again. By this time IDT was in serious financial trouble; Serge was beginning to worry that the management was running the company into the ground. He had no savings to speak of. His wife, Elina, was carrying their third child, and they’d need to buy a bigger house. Serge agreed to interview with the Wall Street firm that especially wanted to meet him: Goldman Sachs.
At least on the surface, Serge Aleynikov had the sort of life people are said to come to America for. He’d married a pretty fellow Russian immigrant and started a family with her. They’d sold their two-bedroom Cape-style house in Clifton, New Jersey, and bought a bigger colonial-style one in Little Falls. They had a nanny. They had a circle of Russians they called their friends. On the other hand, all Serge did was work, and his wife had no real clue what that work involved; they weren’t actually all that close to each other. He didn’t encourage people to get to know him well or exhibit a great deal of interest in getting to know them. He was acquiring a lot of possessions in which he had very little interest. The lawn in Clifton was a fair example of the general problem. When he’d gone hunting for his first house, he’d been enchanted by the idea of having his very own lawn. In Moscow such a thing was unheard of. The moment he owned a lawn, he regretted it. (“A pain in the butt to mow.”) A Russian writer named Masha Leder, who knew the Aleynikovs as well as anyone, thought of Serge as an exceptionally intellectually gifted but otherwise typical Russian Jewish computer programmer, for whom technical problems became an excuse not to engage with the messy world around him. “All of Serge’s life was some kind of mirage,” she said. “Or a dream. He was not aware of things. He liked slender girls who loved to dance. He married a girl and managed to have three kids with her before he figures out he doesn’t really know her. He was working his ass off and she would spend the money he was making. He would come home and she would cook him vegetarian dishes. He was serviced, basically.”
And then Wall Street called. Goldman Sachs put Serge through a series of telephone interviews, then brought him in for a long day of face-to-face interviews. These he found extremely tense, even a bit weird. “I was not used to seeing people put so much energy into evaluating other people,” he said. One after another, a dozen Goldman employees tried to stump him with brain teasers, computer puzzles, math problems, and even some light physics. It must have become clear to Goldman (it was to Serge) that he knew more about most of the things he was being asked than his interviewers did. At the end of the first day, Goldman invited him back for a second day. He went home and thought it over: He wasn’t all that sure he wanted to work at Goldman Sachs. “But the next morning I had a competitive feeling,” he says. “I should conclude it and try to pass it because it’s a big challenge.”
He’d been surprised to find that in at least one way he fit in: More than half the programmers at Goldman were Russians. Russians had a reputation for being the best programmers on Wall Street, and Serge thought he knew why: They had been forced to learn to program computers without the luxury of endless computer time. Many years later, when he had plenty of computer time, Serge still wrote out new programs on paper before typing them into the machine. “In Russia, time on the computer was measured in minutes,” he said. “When you write a program, you are given a tiny time slot to make it work. Consequently we learned to write the code in ways that minimized the amount of debugging. And so you had to think about it a lot before you committed it to paper. . . . The ready availability of computer time creates this mode of working where you just have an idea and type it and maybe erase it ten times. Good Russian programmers, they tend to have had that one experience at some time in the past—the experience of limited access to computer time.”
He returned for another round of Goldman’s grilling, which ended in the office of a senior high-frequency trader—another Russian, Alexander Davidovich. The Goldman managing director had just two final questions for Serge, both designed to test his ability to solve problems. The first: Is 3,599 a prime number?
Serge quickly saw that there was something strange about 3,599: It was very close to 3,600. He jotted down the following equations:
3599 = (3600 – 1) = (60² – 1²) = (60 – 1) (60 + 1) = 59 × 61
3599 = 59 × 61
Not a prime number.
The problem wasn’t that difficult, but, as he put it, “it was harder to solve the problem when you are anticipated to solve it quickly.” It might have taken him as long as two minutes to finish. The second question the Goldman managing director asked him was more involved, and involving. He described for Serge a room, a rectangular box, and gave him its three dimensions. “He says there is a spider on the floor, and he gives me its coordinates. There is also a fly on the ceiling, and he gives me its coordinates as well. Then he asked the question: Calculate the shortest dista
nce the spider can take to reach the fly.” The spider can’t fly or swing; it can only walk on surfaces. The shortest path between two points was a straight line, and so, Serge figured, it was a matter of unfolding the box, turning a three-dimensional object into a two-dimensional surface, then using the Pythagorean theorem to calculate the distances. This took him several minutes to work out; when he was done, Davidovich offered him a job at Goldman Sachs. His starting salary plus bonus came to $270,000.
HE’D JOINED GOLDMAN at an interesting moment in the history of both the firm and Wall Street. By mid-2007 Goldman’s bond trading department was aiding and abetting a global financial crisis, most infamously by helping the Greek government to rig its books and disguise its debt, and by designing subprime mortgage securities to fail, so that they might make money by betting against them. At the same time, Goldman’s equities department was adapting to radical changes in the U.S. stock market—just as that market was about to crash. A once sleepy oligopoly dominated by Nasdaq and the New York Stock Exchange was rapidly turning into something else. The thirteen public stock exchanges in New Jersey were all trading the same stocks. Within a few years there would be more than forty dark pools, two of them owned by Goldman Sachs, also trading the same stocks.
The fragmentation of the American stock market was fueled, in part, by Reg NMS, which had also stimulated a huge amount of stock market trading. Much of the new volume was generated not by old-fashioned investors but by the extremely fast computers controlled by the high-frequency trading firms. Essentially, the more places there were to trade stocks, the greater the opportunity there was for high-frequency traders to interpose themselves between buyers on one exchange and sellers on another. This was perverse. The initial promise of computer technology was to remove the intermediary from the financial market, or at least reduce the amount he could scalp from that market. The reality turned out to be a windfall for financial intermediaries—of somewhere between $10 billion and $22 billion a year, depending on whose estimates you wanted to believe. For Goldman Sachs, a financial intermediary, that was only good news.
The bad news was that Goldman Sachs wasn’t yet making much of the new money. At the end of 2008, they told their high-frequency trading computer programmers that their trading unit had netted roughly $300 million. That same year, the high-frequency trading division of a single hedge fund, Citadel, made $1.2 billion. The HFT guys were already known for hiding their profits, but a lawsuit between one of them, a Russian named Misha Malyshev, and his former employer, Citadel, revealed that, in 2008, Malyshev had been paid $75 million in cash. Rumors circulated—they turned out to be true—of two guys who had left Knight for Citadel and guarantees of $20 million a year each. A headhunter who sat in the middle of the market and saw what firms were paying for geek talent says, “Goldman had started to figure it out, but they really hadn’t figured it out. They weren’t top ten.”
The simple reason Goldman wasn’t making much of the big money now being made in the stock market was that the stock market had become a war of robots, and Goldman’s robots were slow. A lot of the moneymaking strategies were of the winner-take-all variety. When every player is trying to do the same thing, the player who gets all the money is the one whose computers can take in data and spit out the obvious response to it first. In the various races being run, Goldman was seldom first. That is why they had sought out Serge Aleynikov in the first place: to improve the speed of their system. There were many problems with that system, in Serge’s view. It wasn’t so much a system as an amalgamation. “The code development practices at IDT were much more organized and up-to-date than at Goldman,” he says. Goldman had bought the core of its system fifteen years earlier in the acquisition of one of the early electronic trading firms, Hull Trading. The massive amounts of old software (Serge guessed that the entire platform had as many as 60 million lines of code in it) and fifteen years of fixes to it had created the computer equivalent of a giant rubber-band ball. When one of the rubber bands popped, Serge was expected to find it and fix it.
Goldman Sachs often used complexity to advantage. The firm designed complex subprime mortgage securities that others did not understand, for instance, and then took advantage of the ignorance they had introduced into the marketplace. The automation of the stock market created a different sort of complexity, with lots of unintended consequences. One small example: Goldman’s trading on the Nasdaq exchange. In 2007, Goldman owned the (unmarked) building closest to Nasdaq. The building housed Goldman’s dark pool. When Serge arrived, tens of thousands of messages per second were flying back and forth between computers inside the two buildings. Proximity, he assumed, must offer Goldman Sachs some advantage—after all, why else buy the building closest to the exchange? But when he looked into it he found that, to cross the street from Goldman to Nasdaq, a signal took 5 milliseconds, or nearly as much time as it would take, a couple of years later, for a signal to travel on the fastest network from Chicago to New York. “The theoretical limit [of sending a signal] from Chicago to New York and back is something like seven milliseconds,” said Serge. “Everything more than that is the friction caused by man.” The friction could be caused by physical distance—say, if the signal moving across a street in Carteret traveled in something less direct than a straight line. It could be caused by computer hardware. But it could also be caused by slow, clunky software—and that was Goldman’s problem. Their high-frequency trading platform was designed, in typical Goldman style, as a centralized hub-and-spoke system. Every signal sent was required to pass through the mother ship in Manhattan before it went back out into the marketplace. “But the latency [the 5 milliseconds] wasn’t mainly due to the physical distance,” says Serge. “It was because the traffic was going through layers and layers of corporate switching equipment.”
Broadly speaking, there were three problems Serge had been hired to solve. They corresponded to the three stages of an electronic trade. The first was to create the so-called ticker plant, or the software that translated the data from the thirteen public exchanges so that it could be viewed as a single stream. Reg NMS had imposed on the big banks a new obligation: to take in the information from all the exchanges in order to ensure that they were executing customers’ orders at the official best market price—the NBBO. If Goldman Sachs purchased 500 shares of Intel at $20 a share on the New York Stock Exchange on behalf of a customer without first taking the 100 shares of Intel offered at $19.99 on the BATS exchange, they’d have violated the regulation. The easiest and cheapest solution for the big banks to this problem was to use the combined data stream created by public exchanges—the SIP. Some of them did just that. But to assuage the concerns of their customers that the SIP was too slow and offered them a dated view of the market, a few banks promised to create a faster data stream—but nothing they created for customers’ orders was as fast as what they created for themselves.
Serge had nothing to do with anything used by Goldman’s customers. His job was to build the system that Goldman Sachs’s own proprietary traders would use in their activities—and it went without saying that it needed to be faster than anything used by the customers. The first and most obvious thing he did to make Goldman’s robots faster was exactly what he had done at IDT to enable millions of phone calls to find their cheapest route: He decentralized Goldman’s system. Rather than have signals travel from the various exchanges back to the Goldman hub, he set up separate mini–Goldman hubs inside each of the exchanges. To acquire the information for its private ticker plant, Goldman needed to place its computers as close as possible to the exchange’s matching engine. The software that took the output from the ticker plant and used it to figure out smart trades in the stock market was the second stage of the process: Serge rewrote a lot of that code to make it run faster. The third stage was called “order entry.” As it sounds, this was the software that sent those trades back out into the market to be executed. Serge worked on that, too. He didn’t think of it this way, but in effect he
was building a high-frequency trading firm within Goldman Sachs. The speed he created for Goldman Sachs could be used for many purposes, of course. It could be used simply to execute Goldman’s prop traders’ smart strategies as quickly as possible. It could also be used by Goldman’s prop traders to trade the slow-moving customer orders in their own dark pool against the wider market. The speed Serge gave them could be used, for example, to sell Chipotle Mexican Grill to Rich Gates at a high price in the dark pool while buying it from him at a lower price on a public exchange.
Flash Boys: A Wall Street Revolt Page 13