Saturday, August 03, 2013

The Spider and the Fly

Michael Lewis has written a riveting report on the trial, incarceration, release, and re-arrest of Sergey Aleynikov, once a star programmer at Goldman Sachs. It's a tale of a corporation coming down with all its might on a former employee who, when all is said an done, damaged the company only by deciding to take his prodigious talents elsewhere.

As is always the case with Lewis, the narrative is brightly lit while the economic insights lie half-concealed in the penumbra of his prose. In this case he manages to shed light on the enormous divergence between the private and social costs of high frequency trading, as well as the madness of an intellectual property regime in which open-source code routinely finds its way into products that are then walled off from the public domain, violating the spirit if not the letter of the original open licenses.

Aleynikov was hired by Goldman to help improve its relatively weak position in what is rather euphemistically called the market-making business. In principle, this is the business of offering quotes on both sides of an asset market in order that investors wishing to buy or sell will find willing counterparties. It was once a protected oligopoly in which specialists and dealers made money on substantial spreads between bid and ask prices, in return for which they provided some measure of price continuity.

But these spreads have vanished over the past decade or so as the original market makers have been displaced by firms using algorithms to implement trading strategies that rely on rapid responses to incoming market data. The strategies are characterized by extremely short holding periods, limited intraday directional exposure, and very high volume. A key point in the transition was the adoption in 2007 of Regulation NMS (National Market System), which required that orders be routed to the exchange offering the best available price. This led to a proliferation of trading venues, since order flow could be attracted by price alone. Lewis describes the transition thus:
For reasons not entirely obvious... the new rule stimulated a huge amount of stock-market trading. Much of the new volume was generated not by old-fashioned investors but by extremely fast computers controlled by 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 has turned out to be a boom in financial intermediation and an estimated take for Wall Street of somewhere between $10 and $20 billion a year, depending on whose estimates you wish to believe. As high-frequency-trading firms aren’t required to disclose their profits... no one really knows just how much money is being made. But when a single high-frequency trader is paid $75 million in cash for a single year of trading (as was Misha Malyshev in 2008, when he worked at Citadel) and then quits because he is “dissatisfied,” a new beast is afoot. 
The combination of new market rules and new technology was turning the stock market into, in effect, a war of robots. The robots were absurdly fast: they could execute tens of thousands of stock-market transactions in the time it took a human trader to blink his eye. The games they played were often complicated, but one aspect of them was simple and clear: the faster the robot, the more likely it was to make money at the expense of the relative sloth of others in the market.
This last point is not quite right: speed alone can't get you very far unless you have an effective trading strategy. Knight Capital managed to lose almost a half billion dollars in less than an hour not because their algorithms were slow but because they did not faithfully execute the intended strategy. But what makes a strategy effective? The key, as Andrei Kirilenko and his co-authors discovered in their study of transaction-level data from the S&P E-mini futures market, is predictive power:
High Frequency Traders effectively predict and react to price changes... [they] are consistently profitable although they never accumulate a large net position... HFTs appear to trade in the same direction as the contemporaneous price and prices of the past five seconds. In other words, they buy... if the immediate prices are rising. However, after about ten seconds, they appear to reverse the direction of their trading... possibly due to their speed advantage or superior ability to predict price changes, HFTs are able to buy right as the prices are about to increase... They do not hold positions over long periods of time and revert to their target inventory level quickly... HFTs very quickly reduce their inventories by submitting marketable orders. They also aggressively trade when prices are about to change. 
Aleynikov was hired to speed up Goldman's systems, but he was largely unaware of (and seemed genuinely uninterested in) the details of their trading strategies. Here's Lewis again:
Oddly, he found his job more interesting than the stock-market trading he was enabling. “I think the engineering problems are much more interesting than the business problems,” he says... He understood that Goldman’s quants were forever dreaming up new trading strategies, in the form of algorithms, for the robots to execute, and that these traders were meant to be extremely shrewd. He grasped further that “all their algorithms are premised on some sort of prediction—predicting something one second into the future.”
Effective prediction of price movements, even over such very short horizons, is not an easy task. It is essentially a problem of information extraction, based on rapid processing of incoming market data. The important point is that this information would have found its way into prices sooner or later in any case. By anticipating the process by a fraction of a second, the new market makers are able to generate a great deal of private value. But they are not responsible for the informational content of prices, and their profits, as well as the substantial cost of their operations, therefore must come at the expense of those investors who are actually trading on fundamental information.

It is commonly argued that high frequency trading benefits institutional and retail investors because it has resulted in a sharp decline in bid-ask spreads. But this spread is a highly imperfect measure of the value to investors of the change in regime. What matters, especially for institutional investors placing large orders based on fundamental research, is not the marginal price at which the first few shares trade but the average price over the entire transaction. And if their private information is effectively extracted early in this process, the price impact of their activity will be greater, and price volatility will be higher in general.

After all, it was a large order from an institutional investor in the S&P futures market that triggered the flash crash, sending indexes plummeting briefly, and individual securities trading at absurd prices. Accenture traded for a penny on the way down, and Sotheby's for a hundred thousand dollars a share on the bounce back.

In evaluating the impact on investors of the change in market microstructure, it is worth keeping in mind Bogle's Law:
It is the iron law of the markets, the undefiable rules of arithmetic: Gross return in the market, less the costs of financial intermediation, equals the net return actually delivered to market participants.
This is just basic accounting, but often overlooked. If one wants to argue that the new organization of markets has been beneficial to investors, one needs to make the case that the costs of financial intermediation in the aggregate have gone down. Smaller bid-ask spreads have to be balanced against the massive increase in volume, the profits of the new market makers, and most importantly, the costs of high-frequency trading. These include nontrivial payments to highly skilled programmers and quants, as well as the costs of infrastructure, equipment, and energy. Lewis notes that the "top high-frequency-trading firms chuck out their old gear and buy new stuff every few months," but these costs probably pale in comparison with those of cables facilitating rapid transmission across large distances and the more mundane costs of cooling systems. All told, it is far from clear that the costs of financial intermediation have fallen in the aggregate.

This post is already too long, but I'd like to briefly mention a quite different point that emerges from the Lewis article since it relates to a theme previously explored on this blog. Aleynikov relied routinely on open-source code, which he modified and improved to meet the needs of the company. It is customary, if not mandatory, for these improvements to be released back into the public domain for use by others. But his attempts to do so were blocked:
Serge quickly discovered, to his surprise, that Goldman had a one-way relationship with open source. They took huge amounts of free software off the Web, but they did not return it after he had modified it, even when his modifications were very slight and of general rather than financial use. “Once I took some open-source components, repackaged them to come up with a component that was not even used at Goldman Sachs,” he says. “It was basically a way to make two computers look like one, so if one went down the other could jump in and perform the task.” He described the pleasure of his innovation this way: “It created something out of chaos. When you create something out of chaos, essentially, you reduce the entropy in the world.” He went to his boss, a fellow named Adam Schlesinger, and asked if he could release it back into open source, as was his inclination. “He said it was now Goldman’s property,” recalls Serge. “He was quite tense. When I mentioned it, it was very close to bonus time. And he didn’t want any disturbances.” 
Open source was an idea that depended on collaboration and sharing, and Serge had a long history of contributing to it. He didn’t fully understand how Goldman could think it was O.K. to benefit so greatly from the work of others and then behave so selfishly toward them... But from then on, on instructions from Schlesinger, he treated everything on Goldman Sachs’s servers, even if it had just been transferred there from open source, as Goldman Sachs’s property. (At Serge’s trial Kevin Marino, his lawyer, flashed two pages of computer code: the original, with its open-source license on top, and a replica, with the open-source license stripped off and replaced by the Goldman Sachs license.)
This unwillingness to refresh the reservoir of ideas from which one drinks may be good for the firm but is clearly bad for the economy. As Michele Boldin and David Levine have strenuously argued, the rate of innovation in the software industry was dramatic prior to 1981 (before which software could not be patented):
What about the graphical user interfaces, the widgets such as buttons and icons, the compilers, assemblers, linked lists, object oriented programs, databases, search algorithms, font displays, word processing, computer languages – all the vast array of algorithms and methods that go into even the simplest modern program? ... Each and every one of these key innovations occurred prior to 1981 and so occurred without the benefit of patent protection. Not only that, had all these bits and pieces of computer programs been patented, as they certainly would have in the current regime, far from being enhanced, progress in the software industry would never have taken place. According to Bill Gates – hardly your radical communist or utopist – “If people had understood how patents would be granted when most of today's ideas were invented, and had taken out patents, the industry would be at a complete standstill today.”
Vigorous innovation in open source development continues under the current system, but relies on a willingness to give back on the part of those who benefit from it, even if they are not legally mandated to do so. Aleynikov's natural instincts to reciprocate were blocked by his employer for reasons that are easy to understand but very difficult to sympathize with.

Lewis concludes his piece by reflecting on Goldman's motives:
The real mystery, to the insiders, wasn’t why Serge had done what he had done. It was why Goldman Sachs had done what it had done. Why on earth call the F.B.I.? Why coach your employees to say what they need to say on a witness stand to maximize the possibility of sending him to prison? Why exploit the ignorance of both the general public and the legal system about complex financial matters to punish this one little guy? Why must the spider always eat the fly?
The answer to this, I think, is contained in the company's response to Lewis, which is now appended to the article. The statement is impersonal, stern, vague and legalistic. It quotes an appeals court that overturned the verdict in a manner that suggests support for Goldman's position. Like the actions of the proverbial spider, it's a reflex, unconstrained by reflection or self-examination. Even if the management's primary fiduciary duty is to protect the interests of shareholders, this really does seem like a very shortsighted way to proceed.


Update (August 6). RT Leuchtkafer, whose writing has been featured in several earlier posts, sends in the following by email (posted with permission):
I'd add the task for HFT shops is more than information extraction in short timeframes - they've expanded that task to be one of coaxing information leakage from the exchanges, for which they pay the exchanges handsomely.

On intermediation and its costs, intermediary participation in the equities markets has easily tripled since the HFT innovation (and the deregulation of intermediation), and so on net I've argued that aggregate position intermediation costs have gone up even as per share costs have gone down.  Intermediaries make much less on a share than they used to but thanks to deregulation they interpose themselves between natural buyers and sellers much more often than they did, with the result that even though portfolio implementation costs have gone down the portion of those costs captured by intermediaries has greatly increased. 
In addition, Steve Waldman has pointed out that the costs of defensive expenditures to counter HFT strategies are also subject to Bogle's Law and need to be accounted for. For some vivid examples see this post by Jason Voss (via Themis Trading).

Responses to this post on Economist's View and Naked Capitalism are also worth a look; I especially recommend the discussion of open source following this comment by Brooklin Bridge.


  1. Great job Rajiv!

    What I'll add is this: There's the horrible argument that Goldman Sachs should do these horrible things because they should do whatever maximizes the profits of their shareholders – Sell crack, poison the streams children drink from, whatever, it must be good because invisible hand! But, of course, any trained and decent economist knows about all of the ways the pure free market and invisible hand can go horribly wrong, especially if you care about optimizing total societal utils, which I consider ridiculously more important that Pareto optimality. These ways include externalities, asymmetric, and just poor, information, monopoly power, high transactions costs, zero marginal cost idea/information goods,...

    But here's something you rarely, if ever, hear. Are you really optimizing shareholder utility, or doing what shareholders really want, if you do anything that maximizes profits? And the answer is often, of course not. Would the average shareholder of Goldman Sachs vote for these horrible actions in exchange for just a slightly higher return, if they had to spend the time to vote and were completely informed of what was going on, and the implications?

    Plus, many shareholders hold extremely diversified portfolios. So, they can vote that none of the companies in Goldman Sachs industry do these horrible things, and thus the decrease in profits is much less than if Goldman Sachs is the only one acting ethically.

    Of course, the average shareholder holds only a micron of each company, and so it's not worth his time to vote. I've owned a piece of every company on every major exchange for years through a market wide mutual fund, but I've never voted. So, who controls tends to be major shareholders, often very greedy, and/or the managers themselves.

    But don't think that maximal profit at any cost is always what the average shareholder wants, even weighted by shares owned. The average shareholder, even weighted by shares owned, is often very willing to have a slightly lower return on his total portfolio to have his companies not doing horrible things.

  2. I hadn't discovered your blog but after reading this and the post you linked about investment extraction, I'm glad I did.

    I guess it seems the takeaway is for GS greed > innovation.

    They're souless parasites. They create nothing. And they want this guy in prison? Their villainy is comical and tragic.

  3. I agree with Richard and David. Great job Rajiv!
    Always the same story. Tricky law applications. Parasite use of innovations and unlawful development application and evil behavior with this guy and others.

  4. An excellent commentary on a wonderful article. You draw out some of the economic implications of Lewis' piece that was more about the social, political, and legal aspects. It appears that there is much more liquidity than would be socially beneficial. Is there any work on what an appropriate transactions tax would be?

    And where is Aleynikov now? Back in jail?

  5. I read somewhere that modified open source code must be made public only if the application was redistributed.

    If kept for internal use only, then sharing it is not required. Can this point be clarified?

  6. Richard, you make an excellent point - the fiduciary duty of corporations ought to be to maximize shareholder utility not value, unless shareholders care about nothing other than value. Hard to implement with distributed ownership as you point out.

    Ironically, since voice is not an option, shareholders unhappy with a companies practice have only the option to exit. But this means that value maximizing firms will end up with value seeking shareholders.

    David and Ciudando, I don't really like to use terms like greed or evil in this context, since the company has a duty to shareholders to maximize value (subject to Richard's important caveat). My point is that even on the basis of this criterion they are acting in a shortsighted manner. Also, their actions regarding both HFT and open-source have social costs that policy needs to address.

    Som, there's more liquidity when its not needed, and it dries up when most needed (as in the flash crash). A tax is not the only option, there's a recent paper on one second batch auctions that might have a similar effect.

    Jacob, I read the same thing in a comment on the Lewis article but am not sure what the answer is. That's why I said this violates the spirit if not the letter of the open license.

    Thanks to all of you for your comments.

  7. the fiduciary duty of corporations ought to be to maximize shareholder utility not value

    I'm surprised to hear you state this as a matter of fact. The principle that management owes a duty only shareholders is a relatively recent development in corporate governance. For most of the 20th century it was taken for granted -- by law as well as scholarship -- that corporations owed duties to a variety of stakeholders. Gerald Davis' Managed by the markets has a good discussion of this.

    Even if you do think this is a normative ideal, it's not clear that it can be coherently followed, even in principle. Corporations, like other complex organizations, rely on a large number of implicit contracts and norms to function. These only bind to the extent that participants are intrinsically motivated to respect them. When the duty to maximize shareholder value is taken to permit or require breaking these implicit contracts, as here, it erodes the social foundations on which the corporation is built. And, when you're willing to violate implicit obligations to customers, employees, etc., as here, you'll probably find yourself willing to violate your obligations to shareholders as well. This contradiction between the goals of making managers faithless masters and making them faithful servants is nicely described here -- I think you'll like this article, if you haven't seen it before.

  8. Thanks Josh, the article looks interesting (but long!) and I will put it on my list of things to read.

    You're right of course - the fact that corporations are protected by limited liability alone requires that they have obligations to other entities than shareholders. I should have been more careful. The point I was trying to make was that even if shareholders were the only group to which firms had obligations, it's not clear that value maximization should be the primary goal.

    But I'm not sure I really get your point about implicit contracts, norms and intrinsic motivation. To the extent that violating norms and implicit contracts erodes the foundations on which the corporation is built, such violations would be disastrous for the value of the firm.

    In fact, one of the points I was trying to make at the end of my post was that Goldman's knee-jerk aggression was a poor strategy even from the perspective of shareholder value.

  9. It was a great article and very long I agree. When this all occurred there were many items that were not discussed and open source code was the big one. If you have never seen the documentary, "Quants the Alchemists of Wall Street" will help you understand more about Serge..written at layman's level..

  10. "(At Serge’s trial Kevin Marino, his lawyer, flashed two pages of computer code: the original, with its open-source license on top, and a replica, with the open-source license stripped off and replaced by the Goldman Sachs license.)"

    It's important to note that this is criminal and civil copyright infringement. Stripping of licenses and copyright notices, and substitution of other (inaccurate) ones is STRICTLY FORBIDDEN under copyright law and every time Goldman Sachs does it, Goldman Sachs is subject to penalties of over $150,000 per copy.

    Someone needs to shut GS down. It's a criminal operation.

  11. "He went to his boss, a fellow named Adam Schlesinger, and asked if he could release it back into open source, as was his inclination. “He said it was now Goldman’s property,” recalls Serge. “He was quite tense. "

    I understand Schlesinger's tension, given that Schlesinger presumably knew that he (Schlesinger) was violating federal law by lying about the copyright status of a work.