Defending against high-frequency attacks

It was the summer of 2008. I was 22 years old, and it was my second week working in the crude oil and natural gas options pit at the New York Mercantile Exchange (NYMEX.) My head was throbbing after two consecutive weeks of disorientation. It was like being born into a new world, but without the neuroplasticity of a young human. And then the crowd erupted. “Yeeeehawwww. YeEEEeeHaaaWWWWW. Go get ’em cowboy.”

It seemed that everyone on the sprawling trading floor had started playing Wild Wild West and I had no idea why. After at least thirty seconds, the hollers started to move across the trading floor. They moved away 100 meters or so and then doubled back towards me. After a few meters, he finally got it, and I’m sure he learned a life lesson. Don’t be the biggest jerk in a room filled with traders, and especially, never wear triple-popped pastel-colored Lacoste shirts. This young aspiring trader had been “spurred.”

In other words, someone had made paper spurs out of trading receipts and taped them to his shoes. Go get ’em cowboy.

I was one academic quarter away from finishing a master’s degree in statistics at Stanford University and I had accepted a full time job working in the algorithmic trading group at DRW Trading. I was doing a summer internship before finishing my degree, and after three months of working in the algorithmic trading group in Chicago, I had volunteered to work at the NYMEX. Most ‘algo’ traders didn’t want this job, because it was far-removed from our mental mathematical monasteries, but I knew I would learn a tremendous amount, so I jumped at the opportunity. And by learn, I mean, get ripped calves and triceps, because my job was to stand in place for seven straight hours updating our mathematical models on a bulky tablet PC as trades occurred.

I have no vested interests in the world of high-frequency trading (HFT). I’m currently a PhD student in the quantum information group at Caltech and I have no intentions of returning to finance. I found the work enjoyable, but not as thrilling as thinking about the beginning of the universe (what else is?) However, I do feel like the current discussion about HFT is lop-sided and I’m hoping that I can broaden the perspective by telling a few short stories.

What are the main attacks against HFT? Three of them include the evilness of: front-running markets, making money out of nothing, and instability. It’s easy to point to extreme examples of algorithmic traders abusing markets, and they regularly do, but my argument is that HFT has simply computerized age-old tactics. In this process, these tactics have become more benign and markets more stable.

Front-running markets: large oil producing nations, such as Mexico, often want to hedge their exposure to changing market prices. They do this by purchasing options. This allows them to lock in a minimum sale price, for a fee of a few dollars per barrel. During my time at the NYMEX, I distinctly remember a broker shouting into the pit: “what’s the price on DEC9 puts.” A trader doesn’t want to give away whether they want to buy or sell, because if the other traders know, then they can artificially move the price. In this particular case, this broker was known to sometimes implement parts of Mexico’s oil hedge. The other traders in the pit suspected this was a trade for Mexico because of his anxious tone, some recent geopolitical news, and the expiration date of these options.

Some confident traders took a risk and faded the market. They ended up making between $1-2 million dollars from these trades, relative to what the fair price was at that moment. I mention relative to the fair price, because Mexico ultimately received the better end of this trade. The price of oil dropped in 2009, and Mexico executed its options enabling it to sell its oil at a higher than market price. Mexico spent $1.5 billion to hedge its oil exposure in 2009.

This was an example of humans anticipating the direction of a trade and capturing millions of dollars in profit as a result. It really is profit as long as the traders can redistribute their exposure at the ‘fair’ market price before markets move too far. The analogous strategy in HFT is called “front-running the market” which was highlighted in the New York Times’ recent article “the wolf hunters of Wall Street.” The HFT version involves analyzing the prices on dozens of exchanges simultaneously, and once an order is published in the order book of one exchange, then using this demand to adjust its orders on the other exchanges. This needs to be done within a few microseconds in order to be successful. This is the computerized version of anticipating demand and fading prices accordingly. These tactics as I described them are in a grey area, but they rapidly become illegal.

Making money from nothing: arbitrage opportunities have existed for as long as humans have been trading. I’m sure an ancient trader received quite the rush when he realized for the first time that he could buy gold in one marketplace and then sell it in another, for a profit. This is only worth the trader’s efforts if he makes a profit after all expenses have been taken into consideration. One of the simplest examples in modern terms is called triangle arbitrage, and it usually involves three pairs of currencies. Currency pairs are ratios; such as USD/AUD, which tells you, how many Australian dollars you receive for one US dollar. Imagine that there is a moment in time when the product of ratios \frac{USD}{AUD}\frac{AUD}{CAD}\frac{CAD}{USD} is 1.01. Then, a trader can take her USD, buy AUD, then use her AUD to buy CAD, and then use her CAD to buy USD. As long as the underlying prices didn’t change while she carried out these three trades, she would capture one cent of profit per trade.

After a few trades like this, the prices will equilibrate and the ratio will be restored to one. This is an example of “making money out of nothing.” Clever people have been trading on arbitrage since ancient times and it is a fundamental source of liquidity. It guarantees that the price you pay in Sydney is the same as the price you pay in New York. It also means that if you’re willing to overpay by a penny per share, then you’re guaranteed a computer will find this opportunity and your order will be filled immediately. The main difference now is that once a computer has been programmed to look for a certain type of arbitrage, then the human mind can no longer compete. This is one of the original arenas where the term “high-frequency” was used. Whoever has the fastest machines, is the one who will capture the profit.

Instability: I believe that the arguments against HFT of this type have the most credibility. The concern here is that exceptional leverage creates opportunity for catastrophe. Imaginations ran wild after the Flash Crash of 2010, and even if imaginations outstripped reality, we learned much about the potential instabilities of HFT. A few questions were posed, and we are still debating the answers. What happens if market makers stop trading in unison? What happens if a programming error leads to billions of dollars in mistaken trades? Do feedback loops between algo strategies lead to artificial prices? These are reasonable questions, which are grounded in examples, and future regulation coupled with monitoring should add stability where it’s feasible.

The culture in wealth driven industries today is appalling. However, it’s no worse in HFT than in finance more broadly and many other industries. It’s important that we dissociate our disgust in a broad culture of greed from debates about the merit of HFT. Black boxes are easy targets for blame because they don’t defend themselves. But that doesn’t mean they aren’t useful when implemented properly.

Are we better off with HFT? I’d argue a resounding yes. The primary function of markets is to allocate capital efficiently. Three of the strongest measures of the efficacy of markets lie in “bid-ask” spreads, volume and volatility. If spreads are low and volume is high, then participants are essentially guaranteed access to capital at as close to the “fair price” as possible. There is huge academic literature on how HFT has impacted spreads and volume but the majority of it indicates that spreads have lowered and volume has increased. However, as alluded to above, all of these points are subtle–but in my opinion, it’s clear that HFT has increased the efficiency of markets (it turns out that computers can sometimes be helpful.) Estimates of HFT’s impact on volatility haven’t been nearly as favorable but I’d also argue these studies are more debatable. Basically, correlation is not causation, and it just so happens that our rapidly developing world is probably more volatile than the pre-HFT world of the last Millennia.

We could regulate away HFT, but we wouldn’t be able to get rid of the underlying problems people point to unless we got rid of markets altogether. As with any new industry, there are aspects of HFT that should be better monitored and regulated, but we should have level-heads and diverse data points as we continue this discussion. As with most important problems, I believe the ultimate solution here lies in educating the public. Or in other words, this is my plug for Python classes for all children!!

I promise that I’ll repent by writing something that involves actual quantum things within the next two weeks!

Navajo Preparatory High Visit: Reflections by Ana Brown

Evan Miyazono and I recently visited Navajo Preparatory High School in Farmington, New Mexico, the second half of the first exchange of visitors between Caltech and Navajo Prep. Two students and two teachers from the high school visited our campus last summer, spending time touring labs, working on small science and technology projects, and sharing their background and thoughts on science education in the Navajo Nation with us. Evan and I were happy to return the favor and take a trip out to Farmington.

Ana teaching about solar power

We spent the school days giving lectures about light and solar power to the underclassmen and having discussions with the seniors about college applications, college life, and graduate school. We took over physics classes for the entire freshmen class, and spent an hour and a half with each class teaching them the basic E&M they needed to know to understand the wave nature of light and walking them through some simple experiments with lenses and diffraction gratings. When Evan put a piece of paper on which he had cut two very thin slits in front of a green laser-pointer, “oh”s and “ah”s bubbled up from the students as they saw the diffraction pattern appear on the other side of the room. During a math class where Evan was demonstrating how the area and circumference of a circle are related in an intuitive way by breaking up the area of the circle into a rectangle with sides r and pi*r, from where I stood to the side of the classroom, I could hear a student exclaim to his friend “Math is amazing!”.

The next day, after I gave a presentation to the freshmen physics classes on solar power and photovoltaic cells, four students asked for help or resources for their science projects. Two students were making a working model of a “modernized Hogan.” The school has a hogan in the middle of campus where important ceremonies and traditional Navajo gatherings take place. The students want to build a table-top model hogan with working solar water heating and photovoltaic panel to provide warm water and lighting. Another student is working on making a smart phone app for visitors to the Navajo Nation as her senior project. Her app will inform tourists about Navajo landmarks and the significance they hold to the Navajo people. She wants to inform visitors about her culture in an effort to replace the many stereotypes held about native people and Navajos in particular with factual information. These are just a few examples of how students are honoring the traditions of their culture while also taking advantage of new technology and empowering themselves through science education.

Ana speaking to Navajo Prep students

Ana with Navajo Prep Class

I shared with the students stories of friends of mine who had grown up on the Navajo Reservation and the unique issues they confronted in college and afterward. Students who come from tribal reservations often experience homesickness to a much greater degree than other groups when they go away to college. Many of these young adults are accustomed to a very tight community and strong sense of belonging and support that they feel in their hometown, so leaving that community to join a huge group of strangers with cultures foreign from their own can be a big challenge. I gave an informal seminar to the senior class where I discussed college in general as well as issues specific to native students. I gave them advice gleaned from my own experiences as well as the experiences of some of my Navajo friends. Evan and I also answered tons of questions that the students had about all aspects of college—getting in, financial aid, being successful, and finding balance. They asked how to approach a professor about doing research in their lab and how to budget their finances, what kind of summer job they should look for, and how to balance family life and ties with college life. The seniors had so many questions that together we spent more than two hours discussing these topics and answering general and specific questions. I was really happy we could provide so much useful and desired information for these young scholars.

In our free time Evan and I got to spend more time with teachers and students, sharing meals, information, and ideas. It was great to get to know the students and teachers better and learn more about their perspectives and experiences, and how education is fitting into their lives. I look forward to continuing to develop these relationships from afar. We already have plans to mentor a couple of students with their science and senior projects and hope to recruit more Caltech grad students to serve as mentors. Supporting and encouraging these native students in their participation in math and science fields, and higher education in general, as well as helping them to maintain a strong commitment and connection to their culture and families is something that I want to continue to foster as a mentor and ally of the school. I want to thank IQIM for providing the funding for this trip that made these connections possible.

A Quantum Adventure

by Jorge Cham

How do you make something that has never existed before?

I often get suggestions for comics I should draw, which I welcome because A) I like to think of PHD Comics as a global collaborative effort and B) after 17 years, I’m almost out of ideas. This particular suggestion came from Chen-Lung Hung, a postdoc in Physics at Caltech:

PANEL 1 – Ask a scientist: “What motivates you to do the research you do?”

PANEL 2 – What people expect them to answer: “This can lead to real-life applications such as A, B, C, D, etc.”

PANEL 3 – How a real scientist would answer: “Because it’s cool.”

blog_02s

Ok, granted, the punchline needs work. Chen-Lung also asked me to make it clear that his research has important real-life applications, should someone from NSF, who funds his work, happen to be reading this blog.

Chen-Lung’s work with Prof. Jeff Kimble of Caltech’s IQIM is the subject of the third installment in our animated series of explanations of Quantum concepts and devices.

“The problem with atoms,” Prof. Kimble said at one point during our 3-4 hour conversation, “is that they exist in three dimensional space.” I didn’t know that was a problem (unless you expect them to exist in more than 3 dimensions), but Jeff explained that it means it’s very hard to control Quantum systems because the world is wide open, and information can leak and be corrupted from any direction. After a entire academic career making breakthroughs with one type of Quantum System, he’s now directing his group towards a new, experimental type which they believe has more potential for building devices with many Quantum Objects. As Jeff says in the video, “It’s a privilege to be able to explore.”

blog_04s

Shaping light, trapping atoms, alligator waveguides… The goal, Jeff and Chen-lung explained, is to make systems that are “surprising.” Not surprisingly, it was really hard to draw this video. How do you depict something that has never existed before? And more importantly, do you draw alligators differently from crocodiles? (Did you know alligators only exist in two places in the world: the Southern part of the United States, and in China?).

blog_03s

Hopefully, those of you watching will get some understanding of some key Quantum concepts and what it takes to build and manipulate Quantum systems, but to be honest, I make these videos because I think the work is really cool.

Jeff and Chen-Lung: thanks for taking us along on this adventure of yours, the privilege is all ours.

Watch the third installment of this series:

Jorge Cham is the creator of Piled Higher and Deeper (www.phdcomics.com).

CREDITS:

Featuring: Jeff Kimble and Chen-Lung Hung
Animated by Jorge Cham

Produced in Partnership with the Institute for Quantum Information and Matter (http://iqim.caltech.edu) at Caltech with funding provided by the National Science Foundation and the Betty and Gordon Moore Foundation.

The 10 biggest breakthroughs in physics over the past 25 years, according to us.

Making your way to the cutting edge of any field is a daunting challenge. But especially when the edge of the field is expanding; and even harder still when the rate of expansion is accelerating. John recently helped Physics World create a special 25th anniversary issue where they identified the five biggest breakthroughs in physics over the past 25 years, and also the five biggest open questions. In pure John fashion, at his group meeting on Wednesday night, he made us work before revealing the answers. The photo below shows our guesses, where the asterisks denote Physics World‘s selections. This is the blog post I wish I had when I was a fifteen year-old aspiring physicist–this is an attempt to survey and provide a tiny toehold on the edge (from my biased, incredibly naive, and still developing perspective.)

The IQI's

The IQI’s quantum information-biased guesses of Physics World’s 5 biggest breakthroughs over the past 25 years, and 5 biggest open problems. X’s denote Physics World’s selections. Somehow we ended up with 10 selections in each category…

The biggest breakthroughs of the past 25 years:

*Neutrino Mass: surprisingly, neutrinos have a nonzero mass, which provides a window into particle physics beyond the standard model. THE STANDARD MODEL has been getting a lot of attention recently. This is well deserved in my opinion, considering that the vast majority of its predictions have come true, most of which were made by the end of the 1960s. Last year’s discovery of the Higgs Boson is the feather in its cap. However, it’s boring when things work too perfectly, because then we don’t know what path to continue on. That’s where the neutrino mass comes in. First, what are neutrinos? Neutrinos are a fundamental particle that have the special property that they barely interact with other particles. There are four fundamental forces in nature: electromagnetism, gravity, strong (holds quarks together to create neutrons and protons), and weak (responsible for radioactivity and nuclear fusion.) We can design experiments which allow us to observe neutrinos. We have learned that they are electrically neutral, so they aren’t affected by electromagnetism. They are barely affected by the strong force, if at all. They have an extremely small mass, so gravity acts on them only subtly. The main way in which they interact with their environment is through the weak force. Here’s the amazing thing: only really clunky versions of the standard model can allow for a nonzero neutrino mass! Hence, when a small but nonzero mass was experimentally established in 1998, we gained one of our first toeholds into particle physics beyond the standard model. This is particularly important today, because to the best of my knowledge, the LHC hasn’t yet discovered any other new physics beyond the standard model. The mechanism behind the neutrino mass is not yet understood. Moreover, neutrinos have a bunch of other bizarre properties which we understand empirically, but not their theoretical origins. The strangest of which goes by the name neutrino oscillations. In one sentence: there are three different kinds of neutrinos, and they can spontaneously transmute themselves from one type to another. This happens because physics is formulated in the language of mathematics, and the math says that the eigenstates corresponding to ‘flavors’ are not the same as the eigenstates corresponding to ‘mass.’ Words, words, words. Maybe the Caltech particle theory people should have a blog?

Shor’s Algorithm: a quantum computer can factor N=1433301577 into 37811*37907 exponentially faster than a classical computer. This result from Peter Shor in 1994 is near and dear to our quantum hearts. It opened the floodgates showing that there are tasks a quantum computer could perform exponentially faster than a classical computer, and therefore that we should get BIG$$$ from the world over in order to advance our field!! The task here is factoring large numbers into their prime factors; the difficulty of which has been the basis for many cryptographic protocols. In one sentence, Shor’s algorithm achieves this exponential speed-up because there is a step in the factoring algorithm (period finding) which can be performed in parallel via the quantum Fourier transform.
Continue reading

Quantum Matter Animated!

by Jorge Cham

What does it mean for something to be Quantum? I have to confess, I don’t know. My Ph.D was in Robotics and Kinematics, so my neurons are deeply trained to think in terms of classical dynamics. I asked my siblings (two engineers and one architect) what comes to mind for them when they hear the word Quantum, what they remember from college physics, and here is what they said:

– “Quantum Leap!” (the late 80’s TV show)

– “Quantum of Solace!” (the James Bond movie which, incidentally, was filmed in my home country of Panama, even though the movie was set in Bolivia)

– “I don’t remember anything I learned in college”

– “Light acting as a particle instead of a wave?”

The third answer came from my sister, who went to MIT. The fourth came from my brother, who went to Stanford (+1 point for Stanford!).

Screen Shot 2013-06-11 at 12.15.21 AM

I also asked my spouse what comes to mind for her. She said, “Quantum Computing: it’s the next big advance in computers. Transistors the size of atoms.” Clearly, I married someone smarter than me (she also went to Stanford). When I asked if she knew how they worked, she said, “I don’t know how it works.” She also said, “Quantum is related to how time moves more slowly as you approach the speed of light, right?” Nice try, but that’s Relativity (-1 point for Stanford!).

I think the word Quantum has a special power in our collective consciousness. It’s used to convey science-iness, technology, the weirdness of the Physical world. If you Google “Quantum”, most of the top hits are for technology companies that have nothing to do with Quantum Physics (including Quantum Fishing Tackles. I suppose that half the time, you pull up a dead fish).

It’s one of those words that a lot of people have heard of, but very few really understand what it means. Which is why I was excited when Spiros Michalakis and IQIM approached me to produce a series of animations that explore and explain Quantum Information and Matter. Like my previous videos (The Higgs Boson, Dark Matter, Exoplanets), I’d have the chance to interview experts in this field and use their expertise and their voices to learn and to help others learn what amazing things lie just around the corner, beyond our classical understanding of the Universe.

Screen Shot 2013-06-11 at 12.16.55 AM

This will be a big Leap for me (I’m trying to avoid the obvious pun), and a journey of exploration. The first installment goes live today, and you can watch it below. Like Schrödinger’s box, I don’t know what we’ll discover with these videos, but I know there are exciting possibilities inside. This is also going to be a BIG challenge. Understanding and putting Quantum concepts in visual form will be hard. I mean, Hair-pulling hard. Fortunately, I’ve discovered there’s a remedy for that.

Screen Shot 2013-06-11 at 12.17.20 AM

Watch the first installment of this series:

Jorge Cham is the creator of Piled Higher and Deeper (www.phdcomics.com).

CREDITS:

Featuring: Amir Safavi-Naeini and Oskar Painter http://copilot.caltech.edu/

Produced in Partnership with the Institute for Quantum Information and Matter (http://iqim.caltech.edu) at Caltech with funding provided by the National Science Foundation.

Transcription: Noel Dilworth
Thanks to: Spiros Michalakis, John Preskill and Bert Painter

It’s been a tough week for hidden variable theories

The RSS subscriptions which populate my Google Reader mainly fall into two categories: scientific and other. Sometimes patterns emerge when superimposing these disparate fields onto the same photo-detection plate (my brain.) Today, it became abundantly clear that it’s been a tough week for hidden variable theories.

Let me explain. Hidden variable theories were proposed by physicists in an attempt to explain the ‘indeterminism’ which seems to arise in quantum mechanics, and especially in the double-slit experiment. This probably means nothing to many of you, so let me explain further: the hidden variables in Tuesday’s election weren’t enough to trump Nate Silver’s incredibly accurate predictions based upon statistics and data (hidden variables in Tuesday’s election include: “momentum,” “the opinions of undecided voters,” and “pundit’s hunches.”) This isn’t to say that there weren’t hidden variables at play — clearly the statistical models used weren’t fully complete and will someday be improved upon — but hidden variables alone weren’t the dominant influence. Indeed, Barack Obama was re-elected for a second term. However, happy as I was to see statistics trump hunches, the point of this post is not to wax political, but rather to describe the recent failure of hidden variable theories in an arena more appropriate for this blog: quantum experiments.

Continue reading