Slashdot Mirror


How To Lose $172,222 a Second For 45 Minutes

An anonymous reader writes "Investment firm Knight Capital made headlines in 2012 for losing over $400 million on the New York Stock Exchange because of problems with their algorithmic trading software. Now, the owner of a Python programming blog noticed the release of a detailed SEC report into exactly what went wrong (PDF). It shows how a botched update rollout combined with useless or nonexistent process guidelines cost the company over $172,000 a second for over 45 minutes. From the report: 'When Knight used the Power Peg code previously, as child orders were executed, a cumulative quantity function counted the number of shares of the parent order that had been executed. This feature instructed the code to stop routing child orders after the parent order had been filled completely. In 2003, Knight ceased using the Power Peg functionality. In 2005, Knight moved the tracking of cumulative shares function in the Power Peg code to an earlier point in the SMARS code sequence. Knight did not retest the Power Peg code after moving the cumulative quantity function to determine whether Power Peg would still function correctly if called. ... During the deployment of the new code, however, one of Knight's technicians did not copy the new code to one of the eight SMARS computer servers. Knight did not have a second technician review this deployment and no one at Knight realized that the Power Peg code had not been removed from the eighth server, nor the new RLP code added. Knight had no written procedures that required such a review.'"

37 of 327 comments (clear)

  1. The efficiency of capitalism by Tablizer · · Score: 5, Funny

    See, the private sector can blow money faster than the public sector (OmabaCare site).

    1. Re:The efficiency of capitalism by TsuruchiBrian · · Score: 5, Insightful

      The wealth that the money represented was not "lost", but rather redistributed. Efficient redistribution of wealth is a strength of the private sector not a weakness. The private sector is good at redistributing money where it needs to go for economic growth. This company was not exercising an appropriate level of caution and it's money was redistributed elsewhere.

    2. Re:The efficiency of capitalism by techno-vampire · · Score: 4, Insightful

      I think you're being a tad too literal here. As far as Knight was concerned the money was lost because they didn't have it any longer and they had nothing to show for it.

      --
      Good, inexpensive web hosting
    3. Re:The efficiency of capitalism by uncomformistsheep · · Score: 3

      You can start with Coase's theorem. It shows that when transaction costs are null, welfare is maximized. It is impossible for transaction costs to be null. The way law should be structured and government works is by reducing transaction costs, and make us cooperating.

    4. Re:The efficiency of capitalism by TubeSteak · · Score: 3, Interesting

      As a society we don't need to care what happens to some random company.

      If JP Morgan collapsed tonight, we (as a society) would certainly care about what happens.
      Why? Because some "random companies" are so big that their troubles would shake the (inter)national economy.

      This is a great strength of the private sector, and this property is what is referenced by the phrase "the market is self-regulating".

      The market is not self regulating, unless it is self regulating towards oligopolies, oligopsonies, cartels, and general shittiness.
      Greenspan Concedes Error on Regulation
      October 23, 2008

      But on Thursday, almost three years after stepping down as chairman of the Federal Reserve, a humbled Mr. Greenspan admitted that he had put too much faith in the self-correcting power of free markets and had failed to anticipate the self-destructive power of wanton mortgage lending.

      "Those of us who have looked to the self-interest of lending institutions to protect shareholders equity, myself included, are in a state of shocked disbelief," he told the House Committee on Oversight and Government Reform.

      On a day that brought more bad news about rising home foreclosures and slumping employment, Mr. Greenspan refused to accept blame for the crisis but acknowledged that his belief in deregulation had been shaken.

      I could quote the entire article, hell his entire testimony.
      There was no room in his ideology for private companies to intentionally abandon risk management and externalize the risk by selling it off.
      So despite his attempts to mince words, the results of his Ayn Randian ideology ended up being exactly what one would historically expect from not having meaningful regulation.

      --
      [Fuck Beta]
      o0t!
    5. Re:The efficiency of capitalism by Errol+backfiring · · Score: 3, Insightful

      In this on-line gambling system, money has lost all its real value. One of the very problems we have now is that a bit of on-line gambling can be traded for real work. And off course, that there is so much money to be made with on-line gambling that the financial institutions have left the real economy behind long ago. Nowadays, finance has almost nothing to do with economy anymore.

      --
      Nae king! Nae laird! Nae yurrupiean pressedent! We willna be fooled again!
  2. Garden Variety Upgrade SNAFU by mythosaz · · Score: 3, Insightful

    I'm sure someone will chime in and claim to be the em-effing Change MASTER! but this seems like an ordinary error, the sort I've seen a hundred times before, where one server is a tiny bit wonky, and during the change, something doesn't happen as expected. Normally it's an "inexpensive" error, where some of your VPN users get randomly disconnected... ...and sometimes it's the sort of error where you lose half a billion dollars an hour by HFT trading... ...badly.

    1. Re:Garden Variety Upgrade SNAFU by Alan+Shutko · · Score: 5, Insightful

      There were a number of errors made here.

      1. They failed to deploy to one of eight servers
      2. They failed to automate the deployment to the servers such that it would be impossible to deploy to all servers without knowing.
      3. They didn't have a step between code deployment and production activation where they could validate all 8 servers. For instance, in our company, we deploy the prod code to the prod servers but leave them in a "stage" environment, where the production load balancer doesn't hit those instances. Once we've validated, we then switch the load balancers to point to the correct instance.
      4. They failed to quickly back out a change when they realized it was having problems. In fact, they backed out the part on seven servers but not the flag that was being sent to the servers, which made things worse.
      5. They failed to have a risk-mitigation backstop in place which would have prevented these orders from being submitted once they hit a certain amount, and which was required by SEC Rule 15c3-5(c)(1)(i).

      There were a lot of places that you could put in a control to prevent or limit the effect of these kinds of errors, and that's the lesson people need to learn. Yes, mistakes happen! But try to make it hard to make a mistake, easy to recover from a mistake, and really easy to NOTICE a mistake.

    2. Re:Garden Variety Upgrade SNAFU by sjames · · Score: 3, Insightful

      Except they built in enough safeguards that they were able to debug it and get it fully operational. Having done so, it then accomplished it's mission and considerably more.

      The appropriate measure varies based on the type of risk.

  3. There should be a mandatory one second delay. by Anonymous Coward · · Score: 5, Insightful

    This level of trading does not do the market any good, and puts individual investors at a severe disadvantage against firms like this.

    It can be stopped. And it should be stopped. And the only reason it is not being stopped is because too many rich and powerful people make too much money on it.

    1. Re:There should be a mandatory one second delay. by Anonymous Coward · · Score: 5, Interesting

      Personally, I believe if you're going to buy stock in a company then you should be required to hold said stock for at least 24 hours, if not much longer. the stock market was created to allow people to invest their money in a company, thus allow that company to use that money to grow which should result in a return (or loss). It was not designed for gambling, which is what it has become.

    2. Re:There should be a mandatory one second delay. by ShanghaiBill · · Score: 4, Insightful

      You are confused. "Algorithmic trading" and "High Frequency Trading" are two different things, used for two different purposes. This was caused by AT, and you are complaining about HFS. That makes no sense.

    3. Re:There should be a mandatory one second delay. by Anonymous Coward · · Score: 3, Interesting

      Just tax EVERY transaction. Done.

    4. Re:There should be a mandatory one second delay. by girlintraining · · Score: 5, Informative

      Eh, other posters have already pointed out that you're referencing high frequency trading, not algorithmic trading, so this is offtopic. Nonetheless... where exactly do you think this 1 second delay should be put in, and what would it accomplish? Make the wires "longer"; That would mean less contention for premier data centers in NYC. In one second, you can send a signal around the world five times over. But that doesn't help with the propagation of trade data from which the trades are based on; By adding all that extra lag only in terms of trade execution, but not market data, you're potentially putting billions of dollars at risk as trades are now following market data, instead of running concurrently with them. Think of it this way: You swipe your card to pay for gas. The price shown is $3.55. But when you start the pump, the price drops to $3.54. But you started the pump a second too late, so you're billed a penny more than the guy who waited a split second. Now, multiply this a few million times and suddenly you've got a market crisis. It's the same if you lag the market data but allow trades at full speed.

      Let's say you put this one second latency in for both sides; trade execution and market data. How exactly do you syncronize the data when the price itself is determined by trades -- you potentially have more trades waiting to be executed than you have shares... the price is now in some kind of weird state whereby it cannot be accurate until the trades are complete, yet as the trades complete the price is trading. Now you've turned a tiny amount of speculation into a massive amount of speculation. You've made the problem a thousand times worse!

      You see, no matter where you put in your "one second delay", you're reducing liquidity, increasing costs, and causing money to be lost out of the system. Your idiotic attempt to help the "little guy" has resulted in utter chaos at best, and only made it harder for him at worse!

      High volume trade is just margin trading; Buying low and selling high. Now there's a lot of macroeconomic theory to go into what I say next, too much for a slashdot post, but fundamentally... the more trade there is, the more wealth there is. Lots of trades mean the market is healthy. It means money is moving... and the more money moves, the more it trades hands, the more value that money has. The only time money loses value is when it sits in an account doing nothing. It's like potential energy versus kinetic energy. You cannot harness the power of something that isn't moving.

      Every time I hear about people bitch about high volume trading and "the little guy" I die a little inside; It shows a shocking lack of understanding of how markets actually operate, and how these sorts of trades benefit everyone by improving liquidity. The last economic crisis, in fact, the core of all economic crisis, is the lack of money moving. You can't invest because nothing is producing. You can't produce because nobody's investing. These kind of mexican standoffs are what lead to recessions and depressions. Liquidity is at the very heart of any boom, and its absence at the heart of every bust.

      The reason why the "rich and powerful" have created a wealth gap is because money isn't trading hands. There's no trade going on -- the middle class isn't buying anything new, they're just paying off old debts. The upper class are the only ones with any liquidity, and they're holding onto money because there's nothing to invest in; If nobody's buying anything, what then is the point of investment? There's no return then. And the poor... they can't invest. They're living hand to mouth, paycheck to paycheck... economically, they're useless. They'll spend every dollar they're handed on the same things every day -- food, shelter, clothing, gas, rent... these things are essential to daily life, but they don't grow an economy. To get economic growth, you need people buying laptops, cars, services, luxury items.

      And what started all of this? Ironically, it was a small segment of the population -- th

      --
      #fuckbeta #iamslashdot #dicemustdie
    5. Re: There should be a mandatory one second delay. by gumbi+west · · Score: 3

      The market price of the stock affects the company's ability to raise money through additional issues. This affects their ability to take out loans/sell bonds.

    6. Re:There should be a mandatory one second delay. by smellotron · · Score: 3

      let's do a one day cycle.

      Hey, that's a great idea. It already exists, but it takes place twice daily: the opening auction and the closing auction on NASDAQ or NYSE. You're welcome to restrict your trading to those auctions.

  4. Validation? by egcagrac0 · · Score: 4, Funny

    Damn the validation. Full speed to prod!

  5. Failure of best practices by onyxruby · · Score: 4, Insightful

    No proper change management, no peer review, no proper lab testing. Dev should always reflect production to the greatest reasonable level. No proper maintenance windows. You should never be surprised by a change in production. This is a case study in incompetence and the failure to execute industry best practices. I'm guessing the guy or gal who raised the best practices flag was ignored as being inconvenient or too expensive.

    If I'd done this kind of thing when I was working with the exchanges I would have been fired in a heartbeat. Whoever failed to utilize best practices, or whoever failed to allow the utilization of best practices had damn well better have been fired. This is incompetence of the highest level and a perfect example of why ITIL based best practices were born.

    1. Re:Failure of best practices by Billly+Gates · · Score: 4, Insightful

      Dude, Wall Street traders demand software engineers get things done in minutes and hours!

      There is no process as it all had to be done yesterday if you ask anyone who has worked in that environment.

      They pay top dollars and change core algorithms on the fly as each millisecond costs money to a competitor who has a more efficient trading algorithm that steals from their own HTC network.

      So when when skims and manipulates the prices in milliseconds they steal from those who have process engineered designs who are too slow to react.

      If it messes up they get bailed out by the SEC anyway and they can just fire the programmer.

  6. IT Debt by Anonymous Coward · · Score: 5, Insightful

    They had some code that processed orders in a special way. There was a flag on the order they could set that would trigger that code. We will call this Power Peg. They later moved away from that functionality but it still existed in the system. It sat there for years untested and unused. 9 years later they added new functionality and decided to reuse that same flag. The new code also disabled Power Peg.

    When they pushed the new code into production, they missed a server. That missed server still had Power Peg looking for that flag. Orders started setting that flag and it was processed correctly on all but one server. But that last server was placing orders incorrectly. The logic that Power Peg used was not valid anymore. In a panic they rolled back the code on the servers. Not knowing that Power Peg was the issue, they now had all the servers running Power Peg again.

  7. This is what I like best about /. by rsilvergun · · Score: 5, Insightful

    In the same thread where I can find 1000 people going on about how efficient capitalism is I can find another (sometimes the same) 1000 people complaining all the dumb things their companies do. Well, which one is it? It doesn't work both ways people. Could it be that people are people, no matter what banner they're organized under?

    --
    Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
    1. Re:This is what I like best about /. by Anonymous Coward · · Score: 5, Insightful

      Capitalism produces large corporations that are very efficient at doing dumb things.

    2. Re:This is what I like best about /. by Anonymous Coward · · Score: 5, Insightful

      The money wasn't destroyed, it went to other traders. Maybe they will donate it to children with cancer?

    3. Re: This is what I like best about /. by mc6809e · · Score: 4, Funny

      There's no contradiction.

      It took the government months to levy a 12 million dollar fine while the invisible hand of the free market gave a dumb corporation a 400 million dollar bitch slap in less than a hour.

      Now that's efficiency!

    4. Re:This is what I like best about /. by Tablizer · · Score: 5, Insightful

      The public and private sector do different things better. While the private sector is more efficient in terms of service or widgets per hour, there's also heavy pressure to trick, mislead, and rip off consumers and customers.

      Such "trick" pressure is noticeably lower in the public sector. There is relatively little pressure for a line worker and middle manager to rip off or trick customers because they don't have to compete with other cut-throat competition and are not sweating over narrow margins. They generally don't want the drama of customers sending or phoning complaints and so do an adequate job, even if a bit slow at it.

      Certain kinds of services are better under one versus the other. If it's a service where it's easy to fool customers, especially over longer-term features, then it's probably best done by or heavily regulated by the gov't. If it's something that's relatively easy for a consumer to verify the quality of, then it's probably best done by the private sector.

    5. Re:This is what I like best about /. by TheLink · · Score: 4, Interesting

      You missed out cooperatives. Cooperatives tend to be better behaved than corporations - they tend to rip people off less. There are still bad ones of course, but they have a place in your spectrum somewhere in between Gov and a Corp.

      The problem is starting a cooperative is about the same effort as starting a corporation, but the benefits to the founder are much lower. So more corporations are started than coops. Perhaps if someone can design an incentive scheme that can't be abused then more coops will be started and hopefully we'll have less ripping off going on.

      Then again maybe coops are better behaved only because they self select for founders who are less greedy who then set a less greedy organization culture ;)

      --
    6. Re: This is what I like best about /. by Imsdal · · Score: 5, Interesting

      You could argue that "the free market gave a dumb corporation a 400 million dollar bitch slap in less than a hour" is funny, but actually it,s insightful. It's the perfect example of how companies could and should be punished for doing stupid things.

      And here's an even better example: the flash crash of three years ago. In a few minutes some algorithms went haywire and stock prices dropped dramatically, in some cases down to 1 cent. Clearly that was wrong. The free market fixed this issue in six minutes. That's pretty fast, if you ask me. The government is still, three years later, thinking about what to do about it. Really!?

    7. Re:This is what I like best about /. by Tom · · Score: 5, Funny

      Maybe they will donate it to children with cancer?

      instant +5 Funny

      --
      Assorted stuff I do sometimes: Lemuria.org
  8. The have your punk kid nephew do it mentality by RightwingNutjob · · Score: 3, Insightful

    Didn't RTFA, but summary makes me go WTF in several places:
    1. Python. I thought all the quants liked C, assembler, and even VHDL for their high frequency stuff. No matter
    2. "2nd technician to review". If this were flight hardware or a bridge or skyscraper, there would be a second "technician" to review and at least one "engineer" to personally sign off that what was built/deployed is a) done right and b) is what you want
    3. "no written procedures". There are a very small number of things in life about which it is absolutely imperative to keep a rod firmly up one's ass: a. moving machinery, b. formal mathematics, and c: hundreds of millions of dollars of your clients and shareholders' money.

    1. Re:The have your punk kid nephew do it mentality by Alexey+Nogin · · Score: 3, Informative

      1. Python. I thought all the quants liked C, assembler, and even VHDL for their high frequency stuff.

      Not necessarily. For example, an HFT company Jane Street Capical uses OCaml, claiming it makes code reviews go a lot faster and Knight-style errors a lot less likely. https://queue.acm.org/detail.cfm?id=2038036

  9. Re:They got bailed out by Qzukk · · Score: 3, Informative

    Actually, they asked the SEC to bail them out and got the boot. They had to do a round of private investment and diluted shareholders' value quite a bit. It's generally cited as the "right way" to deal with companies that fuck up and lose billions. Shame we can't do the same with the banks.

    --
    If I have been able to see further than others, it is because I bought a pair of binoculars.
  10. $400 billion / year is "essentially zero"? by raymorris · · Score: 3, Informative

    $400 billion per year in interest payments is "essentially zero"? That number is actually almost manageable, the BIG problem is that it's snowballing.

    You'll recall Obama has been saying that if he wasn't allowed to borrow more, the government would default - wouldn't be able to pay the interest due. We're borrowing to the interest on our borrowing. That's when you know you're fucked, when you're maxing out one credit card to pay the minimum payment on another card. That's essentially what the US government is doing. We're in a trap the we're borrowing more and more in order to make the payments on existing debt, so the debt and the interest just keeps getting bigger and bigger until 100% of our tax money goes to pppay interest, leaving no money for essential government services.

    Looking at what has happened in other countries, the "you're fucked" point, the point at which you can't escape the death spiral, is about 100% of GDP - when a country owes as much as it generates. Eight years ago, our debt to GDP ratio was about 35%. In 2014, it should hit 70%. That tells us we are about six to eight years from becoming Greece.
        The difference between Greece and though, is that Greece is small enough to be bailed out. Nobody has $5 trillion to bail the US out.

  11. private dumb: $20K. Govt dumb: $400 billion by raymorris · · Score: 5, Interesting

    Two things. First, the free market does things efficiently, including dumb things. Microsoft built the Surface efficiently - $390 per tablet. Government spent over $1,000 each buying them.

    Secondly, there's dumb, and there's government dumb.
    A dumb corporation requires three people to do a job that one person could do. A government gets the same job done by creating a new agency which contracts with three companies at $320 million each, requires that it be done in Pascal, and prohibits any testing until the project is "complete", at which time it's six years after tube event that the project was created to handle.

    I just saw one of our most efficient government agencies, one that wins efficiency awards, spend over $19,000 on a project I could do in two days. Funny thing is, I WORK for that agency, so it would have cost them almost nothing to have me do it.

    1. Re:private dumb: $20K. Govt dumb: $400 billion by rsilvergun · · Score: 4, Insightful

      Um, Microsoft used borderline slave labor and a complete disregard for the environment to build the Surface pro. And not the kind of disregard that we get to ignore. It's the kind that makes 'Cancer Villages' (google it)

      And the reason your gov't is making an agency to do a contract to get something done isn't inefficiency, it's socialism. Seriously. It's make work projects to try and spread some money around because otherwise the natural tendency if for money to be hoarded at the top by a few wealthy oligarchs (we call 'em the 1% these days).

      The US Postal Service has God like efficiency. Just ask Netflix. Or just mail a letter and watch it travel across the breath of the United States in less than a week for 33 1/3 cents. The Space programs were (and are) amazing, and did things private industry couldn't hope to accomplish and that we're still reaping the benefits from today. The Gov't can be plenty efficient when it wants to be. It can also be very inefficient when it wants to. There are times when that's a good thing.

      --
      Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
  12. Re:$400 billion / year is "essentially zero"? by Anonymous Coward · · Score: 3, Insightful

    No. You're basically wrong on every point you bring up.

    "Looking at what has happened in other countries, the "you're fucked" point, the point at which you can't escape the death spiral, is about 100% of GDP - when a country owes as much as it generates."

    No, there is no magic debt/GDP limit: http://krugman.blogs.nytimes.com/2013/05/26/reinhart-and-rogoff-are-not-happy/

    "That tells us we are about six to eight years from becoming Greece."

    No, Greece doesn't have its own currency, so we are in no way the same as Greece: http://krugman.blogs.nytimes.com/2013/10/18/the-china-debt-syndrome/?_r=0

  13. to err is human, to fail 100,000/second needs root by raymorris · · Score: 3, Funny

    To err is human. To screw up 100,000 things per second requires root.

  14. Re:Combining nerdism with capitalism by happyhamster · · Score: 4, Insightful

    >> Capitalism is very effective in what it does

    Pumping the money from the poor to the rich.