Inefficient Markets XIV

Inefficient Markets XIV
New ways to make and lose money
Bitcoin, HFT
Damien Challet
[email protected]
December 9, 2015
1 / 59
Today
Other ways to make money
other assets
other methods
Other ways to lose money
other assets
new methods
Case studies
2 / 59
What can go wrong?
Strategies
Backtest
Portfolio
Trading
Computers
Bug
Internet
3 / 59
Strategy overfitting: method
Method X: Smith et al. (2003)
Backtest 1995-2015
My bet
better performance before 2003
E.g.
SVM (1995)
Random Forests (2001)
4 / 59
Overfitting: computer
Moore’s law:
optimal number of transistors ∝ 2y/2
source 1
source 2
5 / 59
Technology laws
Koomey:
cpu / Joule ∝ 23y/2
Kryders:
Gb / $ ∝ 2y/2
Solar panel costs
6 / 59
Other asset: Bitcoin
Digital asset
Payment system
Decentralized
transaction between A and B, amount C
public list of all transactions: ledger
ledger constantly checked
7 / 59
Bitcoin: public ledger
Chain of transactions
Transaction
Transaction
Owner 1's
Public key
Owner 2's
Public key
Hash
Owner 3's
Public key
Hash
Ver
ify
Owner 0's
Signature
Hash
Ver
i
fy
Owner 1's
Signature
gn
Owner 2's
Signature
gn
Si
Owner 1's
Private Key
Transaction
Si
Owner 2's
Private Key
hash = digital summary
e.g. md5sum lecture13.lyx →
169bbaca6b33a3ec1290aeb1ccdf7c7c
public key = product of 2 large prime numbers
private key = factorization of these 2 numbers
Owner 3's
Private Key
8 / 59
Bitcoin mining
Check a block of hashes
If at least 51% of mining power agrees on the answer, accepted
Payoff: 25 bitcoins/block until 2016, then halving every 4 years
Max number of bitcoins: 21,000,000
Difficulty of computing block: dynamically adjusted w.r.t total
mining power
9 / 59
Bitcoin mining power [hashes/seconds]
CPU (Central Processing Unit)
GPU (Graphical Processing Unit)
FPGA (Field Programmable Gate Array)
ASIC (Application-specific integrated circuit)
0.02 MH/J
1 MH/J
20 MH/J
2000 MH/J
Profits
10 / 59
Bitcoin farming
(movie)
O(102 )$ /month
Farming: add K processors
11 / 59
Bitcoin farming
(movie)
O(102 )$ /month
Farming: add K processors
12 / 59
Optimal farming
Minimize variance
Group mining power and share coins
Maximize expected return
Choose what coin to mine
(e.g. www.ltcrabbit.com)
13 / 59
Which coins?
http://cryptocoincharts.info/coins/info
14 / 59
Bitcoin/altcoins: risk
(Algorithm: secure?)
What is the author?
Coin wallet?
15 / 59
Bitcoin: author?
Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System (2008)
https://bitcoin.org/bitcoin.pdf
Who’s that?: theories
group of people or a genius
Nick Szabo, author of bit gold (pre-bitcoin attempt)
Hal Finney (1956 – 2014), a pre-bitcoin cryptographic pioneer
Dorian Prentice Satoshi Nakamoto
16 / 59
Bitcoin author: 08/12/2015
Wired (2015) link
(video)
17 / 59
The next day
(link)
18 / 59
What is illegal?
That million-coin trove—The Tulip Trust—is the same size
as a mysterious bitcoin fortune that’s long been visible on
bitcoin’s blockchain and widely attributed to Satoshi
Nakamoto. [wired.com]
1,000,000 x 450$ =...
→TAX !
19 / 59
Where is my wallet?
20 / 59
Where is my electronic wallet?
https://bitcointalk.org/index.php?topic=576337
21 / 59
Where is my broker?
Bitcoin exchanges
most famous: mt.gov: btc ←→USD, limit order book
2014 (70% market share)
February 2014: 850,000 bitcoins “missing” (450Mo USD)
Bad, but at least we have data!
22 / 59
Meta orders in mt.gov
Donier and Bonart (2014)
23 / 59
Data and other cryptocurrencies
Bitcoin order book data: link
Other coins (altcoins): link
24 / 59
How to make money with bitcoins?
Quantitative strategy
good:
lots of data
revealed liquidity
problem:
trade confirmation delay
security
Corporate strategy
25 / 59
How to make money with bitcoins
Bitcoin fund: e.g. Exante
annual management fee 1.75%, as well as a 0.5% transaction fee.
service: cost of entry
The good:
simple
in the news:
Bitcoin Hedge Fund Returns Nearly 5,000% Nov 25
2013 | 12:00pm ET A hedge fund that invests
exclusively in controversial crypto-currency bitcoin is
not only this year’s best-performing hedge fund—it
may be the best-performing hedge fund ever. The
US$35 million fun, launched last year, is up an
astonishing 4,847%, according to HedgeWeek.
Bitcoins themselves have surged some 6,000% in value
against the dollar this year. source
26 / 59
How to make money with altcoins?
https://www.walletbuilders.com/
27 / 59
How to make money: ETF, not HF
HF: complex, long, sophisticated, employees
ETF:
simple
quick
(almost) no employees
(almost) too late
28 / 59
ETFs: good names
Gold
GLD, OUNZ
Bond
GOVT
Cyber security
HACK
29 / 59
HACK ETF
109 $ AUM in 7 months link
30 / 59
New ways to make money: High Frequency Trading
Algorithmic trading
Not about frequency, but speed
HFT= “HIGHEST possible frequency trading”
31 / 59
Short history of algo trading
Thomas Peterffy (founder of Interactive Brokers)
It wasn’t until 1987 that Peterffy was able to take people out of the loop
entirely. With the world’s first electronic stock exchange, the NASDAQ
terminal, traders could type in orders directly into a computer.
Peterffy didn’t want to type in the orders. He and his engineers hacked
into the NASDAQ terminal and wired it up to their own computer, which
traded automatically based on algorithms.
A senior NASDAQ official saw Peterffy’s setup and said Peterffy was
breaking the rules: All orders had to be entered through the keyboard.
He gave Petterfy’s group one week to fix the problem.
Peterffy and his engineers came up with a solution. They built a robot
with rubber fingers that typed entries into the keyboard. It satisfied the
NASDAQ rules. And on active trading days, the robot typed so fast it
sounded like a machine gun.
(source)
32 / 59
Highest speed: light
→ Information conveyed by light
Speed of light in void
300’000 km/s
Speed of light: 10−6 s = 1µs
10−9 s
300 m/µs
= 1ns
0.3 m/ns
Australia, through the earth
0.068s
Speed of light:
(Grace Hopper)
Geostationary satellites (36’000km+triangle, single way) '0.2s
Moon:
Mars:
Sun:
1.3s
3-21mins
8 mins
33 / 59
Fastest communication: laws of computation evolution
1
Moore:
optimal number of transistors ∝ 2y/2
2
Koomey:
cpu / Joule ∝ 23y/2
3
Kryders:
Gb / $ ∝ 2y/2
34 / 59
HFT: speed
From Hardiman and Bouchaud (2013):
e-Mini future self-reaction minimal speed
35 / 59
HFT, what assets?
Same assets, different exchanges, slightly different locations
ARCA, BATS, NYSE, NASDAQ: NBBO
Similar assets, different exchanges
SPY @ NY, e-Mini futures @Chicago
Related assets, cross-correlation
(old ideas)
36 / 59
Types of HFT
Triangular arbitrage in FX (very old)
Market Making, automated, at highest speed
queue jumping: priority in large tick order books
stale quotes
Low-latency
Reaction to news (Twitter)
pair trading between two venues
37 / 59
Speed: where from?
Technology
Links between markets
Collocation
News sources
38 / 59
Technology
Faster computers
CPU
bus speed
memory speed
Faster networks
overclock ethernet
shorter cables
faster switches (FPGA: 2ns vs CPU: 200 ns)
39 / 59
Links between markets
(source)
The most famous example is that which made the legendary banker and
speculator Nathan Rothschild hugely rich from the Napoleonic wars
between Britain and France. Rothschild had an agent at the Battle of
Waterloo in 1815. His agent saw that Napoleon was losing and rushed
back to the coast, hired a boat for a humungous sum of 2000 francs
through a storm to England. On getting the news, Rothschild rushed to
the London Stock Exchange and acted as though he wanted to sell British
shares, giving the impression that British commander, Wellington, had
lost. Everybody pitched in to sell and Rothschild quietly bought them all
up before the news arrived of the British victory.
Other sources: homing pigeon
Other sources: not true
https://en.wikipedia.org/wiki/Nathan Mayer Rothschild
40 / 59
Links between markets
Most important:
CME (Chicago) ←→ NYSE and NASDAQ
41 / 59
Links
1
Fiber: secret 300M$ between CME and NY (Spread Networks)
speed of light in cable: 30% loss (+relays)
2
Microwave: source FCC
1
2
3
towers
switches
straight line: 8ms
42 / 59
Latencies
source: http://www.mckay-brothers.com/faster-than-others/
43 / 59
HFT: effects on quotes
From Budish et at 2013, cross-correlation between SPY and e-Mini
!!!!!!!!!! Epps effect anyone ???????????
44 / 59
Effect on books
Phantom liquidity: because several exchanges
Source: http://www.nanex.net/aqck2/4661.html
45 / 59
Effect on books
source: http://www.nanex.net/FlashCrash/CCircleDay.html
46 / 59
Effect on books
1000s of quotes per second
Source: http://www.nanex.net/aqck2/4661.html
47 / 59
HFT’s problem: gain
From Virtu IPO files
48 / 59
HFT gains: why enormous Sharpe ratios?
Lets do the math
µ√
N
σ
N1
49 / 59
Flash boys (2014)
1
Exchanges are rigged (BATS)
2
Dark pools are rigged
50 / 59
Flash boys: the role of BATS
https://www.batstrading.com/support/fee schedule/byx/
BATS attracts markets orders
Who is the fish?
51 / 59
Flash boys: the role of BATS
https://www.youtube.com/watch?v=f9EjJoCNtoo
52 / 59
Flash boys: the debate
https://www.youtube.com/watch?v=RcpmHyPD PY
53 / 59
SIP vs DirectFeed
http://www.nanex.net/aqck2/4599.html
54 / 59
The debate: aftermath
http://blogs.wsj.com/moneybeat/2014/04/03/bats-forced-to-correctstatements-by-president-obrien-on-how-its-exchanges-work/
55 / 59
The debate: aftermath
link
56 / 59
How to fix HFT?
HFT additional fee (Italy: too many orders)
Fight quote stuffing, market spoofing
Minimum order duration
discrete time: batch auctions
IEX, currently dark pool
350 µs delay (50km optic fiber)
no colocation
soon an exchange (?)
57 / 59
HFT with agent-based models
MG with two time scales
Learning rate
Memory length
More frequent score updates
Given frequency of playing
58 / 59
Case studies: find the bug
59 / 59