Wednesday, May 06, 2020

Evolutionary Biology of Left-Right

not really true, but funny
It's straightforward to explain why a binary set of competing coalitions within a collective is common. Given the non-linear political payoff to coalition size--eg, when moving from 49% to 51% of the votes--the larger party gains more than it loses by letting the minor group add some of their priorities to their platform. The minority group joining the larger party, meanwhile, will see its priorities relegated to secondary positions but within a ruling or near-ruling party, such that their policies will have a higher chance of actually being implemented. When there are mutual gains from trade the transaction occurs spontaneously, resulting in the bipartisan equilibrium.

A less obvious phenomenon is the left-right political dichotomy. The differences are not as obvious because on many issues the right and left have changed sides, such as censorship and the right to free speech. Classical liberalism dominated the 19th century and emphasized negative rights, which only require others to abstain from interfering with you. These are promoted by left and right for different things: the left champions abortion, euthanasia, and recreational drugs, while the right champions economic transactions, guns, and homeschooling. President Woodrow Wilson was widely seen as a Progressive, but as he led the US into the disastrous WW1, leftist intellectuals sought a new term unsullied by this connection and chose 'liberalism,' highlighting the tricky nature of distilling the essence of right and left political views.

One speculative explanation is that the left-right divide is based, if not in our genes, then on our pathogen aversion intuition formed through evolution (see this book, or this online paper). The physical immune system evolved to defend us when pathogens enter the body. Concurrently, humans and other animals have evolved a behavioral immune system, which motivates us to avoid situations where we might become exposed to infection. Feces and rotting flesh are universally considered bad smells, and unsurprisingly contain a lot of dangerous bacteria.  Avoiding potential sources of infection has been crucial to our survival, and the motivation to avoid infection remains deeply rooted in us to this day.

Supposedly, this behavioral immune system explains the left-right stance on immigration. If you are hypersensitive to infection the last thing you want to do is to interact with a pathogen source. It operates entirely outside conscious awareness, utilizing the emotion of disgust to motivate avoidance of potentially infected objects and people. Thus it would explain why the right discourages sexual freedom because it leads to sexually transmitted diseases, and also why the right sees immigrants as an infection hazard, the way the American Indians should have looked at the Europeans.

If some people see dangers in immigrants via these deep evolutionary roots, it's difficult to reach a mutual understanding with reason-based, rational arguments. The fear comes from deeply ingrained unconscious systems that one can't control any more than one can choose to like the smell of rotting meat. You can discuss whether immigrants are a financial gain or burden to society, but if germophobes are concerned about an entirely different risk they aren't even fully aware of, such arguments will have no resonance.

As usual, it puts the right into being unreasonable, driven by instinctive heuristics now irrelevant as proven by science in peer-reviewed journals. Such evolutionary arguments are only popular, if even allowed, among academics for understanding bad right-wing beliefs or tendencies. If you apply such reasoning to why women or African Americans act or believe in a certain way, it would be immediately shot down as sexist or racist if you were explaining anything that was not an obviously good thing. Even for advantageous attributes--say why people of West African descent dominate sprinting--it is 'problematic,' because it provides a slippery slope for explaining disadvantageous attributes, perpetuating oppression.  Intellectuals are highly attuned to their particular status hierarchy, needing citations, faculty recommendations, and book blurbs. Suggesting the intolerable status quo is not explained by a malevolent cis-white-Christian-hetero pathology marks you a potential quisling at best. Tribalism requires identifying enemies, and also potential traitors insufficiently dismissive of existential threats (or, sticking with biology, a fellow ant infected with the Cordyceps fungus).

I don't find the behavioral immune theory to the left-right divide stupid, just tenuous. My aversion to dirt or sticky things has little valence in my thoughts about immigration, but that's my conscious brain working, perhaps puppeteered by a hyperactive behavioral immune response. In any case, the Covid-19 pandemic is a falsification of this theory. If the right were relatively hypertensive to pathogens, the current left-right stance on easing lockdown restrictions would be the opposite. The right wants to break the lockdown more than the left. One could argue the real factor here is that the right does not value life highly relative to economics, but the lockdown is not just opening up factories, but beaches, parks, and all sorts of places where people congregate.

Tuesday, April 21, 2020

Factor Momentum vs Factor Valuation

I am not a fan of most equity factors, but if any equity factor exists, it is the value factor. Graham and Dodd, Warren Buffet, Fama and French have all highlighted value as an investment strategy. Its essence is the ratio of a backward-looking accounting value vs. a forward-looking discounting of future dividends. As we are not venture capitalists, but rather, stock investors, all future projections are based on current accounting information. To the extent that a market is delusional, as in the 1999 tech bubble, that should show up as an excess deviation from the accounting or current valuation metric (eg, earnings, book value).  If there's any firm characteristic that should capture some of the behavioral bias trends among investors, this is it. 

Alternatively, there's the risk story. Many value companies are just down on their luck, like Apple in the 1990s, and people project recent troubles too far into the future. Thus, current accounting valuations are low, but these are anomalous and should be treated as such. Alas, most value companies are not doing poorly, they just do not offer any possibility of a 10-fold return, like Tesla or Amazon. Greedy, short-sighted investors love stocks with great upside--ignoring the boring value stocks--and just as they buy lottery tickets with an explicit 50% premium to fair value, they are willing to pay for hope.

There are several value metrics and all tell a similar story now. As an aside, note that it's useful to turn all your value metrics into ratios where higher means cheaper: B/M, E/P, CashFlow/Price, Operating Earnings/Book Equity. This helps your intuition as you sift through them. Secondly, E/P is better than P/E because E can go through zero into negative numbers, creating a bizarre non-monotonicity between your metric and your concept; in contrast, if P goes to zero predicting its future performance is irrelevant.

If you rank all stocks by their B/M, take the average B/M of the top and bottom 30%, and put them in a ratio, you get a sense of how cheap value stocks are: (B/M, 80th percentile)/(B/M, 20th percentile). Historically all value ratios are trend stationary. Given B/M ratios generally move mainly via their market cap and not book value or earnings, this means that value stock performance is forecastable. A high ratio of B/M for the top value stocks over the bottom value stocks implies good times for value stocks, as the M of the value stocks increases relative to the M of the anti-value stocks (eg, growth). All of these value metrics are near historical highs over the past 70 years (see AlphaArchitech's charts here).

This is pretty compelling, so much so that last November Cliff Asness at AQR decided to double down on their traditional value tilt. While there are dozens of value metrics today that scream 'buy value now', we have the Ur-metric--Book/Market--going back to 1927 in the US. This suggests we are not anywhere close to a top, which was much higher for most of the 1930s when value did relatively well on a beta-adjusted basis.

It's easy to come up with a story as to why the 1930s are not relevant today, but that is throwing out one-tenth of your data just because it disagrees with you.

Yet there's another way to time factors, momentum, whereby a factor's relative performance tends to persist for a couple months at least, and perhaps a year. Momentum refers to relative outperformance as opposed to absolute performance, which is referred to as 'trend following.' Trend following works as well but applies to asset classes like stocks, bonds, and gold, while momentum refers to stocks, industries, or factors.

Year to date, iShares' growth ETF (IWO) outperformed its value ETF (IWN) by 12%. For the past 10 years, growth has outperformed value by 100%. While iShare's growth ETF has a slightly higher beta (1.27 vs 1.05), that does not explain more than 20% of this.  Regardless of your momentum definition--3 months, 12 months--value is not a buy based on its momentum, which is currently negative, and has been for over a decade in the US.

In 2019, AQR's Tarun Gupta and Bryan Kelly authored 'Factor Momentum Everywhere in the Journal of Portfolio Management. They noted that 'persistence in factor returns is strange and ubiquitous.' Incredibly, they found that performance persisted using 1 to 60 months of past returns. I was happy to assume factor momentum exists, but usually saw evidence at the 6 month and below horizon (eg, see Arnott et al). If they found it at 60 months, my Spidey sense tingled, maybe this is an artifact of a kitchen-sink regression where 121 Barra factors are thrown in, generating persistence in alpha? That hypothesis would take a lot of work, but at the very least I should see if value factor momentum is clear.

I created several value proxy portfolios using Ken French's factor data:
  • HML Fama-French's value proxy, long High B/M short Low B/M (1927-2020)
  • B/M book to market (1927-2020)
  • CF/P cashflow to price (1951-2020)
  • E/P earnings to price (1951-2020)
  • OP operating profits to book equity (1963-2020)
I applied a rolling regression against the past 36 months of market returns to remove the market beta. As the HML portfolio's beta has gone from significantly positive to negative and back to slightly positive over time, it's useful to make this metric beta-neutral to avoid seeing market fluctuations show up as value fluctuations. Unlike the Barra factors, removing the market factor is not prone to overfitting, and captures something most sophisticated investors do not just understand but actually use.

The non-zero beta is just one reason to hate on the HML factor. Another is that, as it contains a short position, it can be of little interest if the short position is driving the results because for most factor investors--who have long horizons--short portfolios are not in your opportunity set. Most 'bad' stocks, following the low-vol phenomenon, are not just bad longs, but also bad shorts: returns are low, not negative, and volatility is very high. Shorting equity factors is generally a bad idea, and thus an irrelevant comparison because you should not be tempted to short these things.

The result is a set of 5 beta-neutral value proxy portfolios. I then ranked them by their past returns and looked at the subsequent returns. These returns are all relative, cross-sectional, because value-weighted, beta-adjusted returns across groupings net to zero each month by definition. By removing the market (ie, CAPM) beta, we can see the relative performance, which is the essence of momentum as applied to stocks (as defined by the seminal Jagdeesh and Titman paper).

The 12-month results were inconsistent with momentum in the value factor.

Using 6-months, momentum becomes more apparent (6M but returns annualized).

With the 1-month momentum, factor momentum is clear: past winners continue (returns are annualized).

I'm rather surprised not to find momentum at 12 months, given it shows up at that horizon in the trend-following literature, and would like to understand how Gupta and Kelly found it at 60 months. Nonetheless, it does seem factor momentum at shorter horizons is real.

If we exclude the US 1930s, valuations of value are at an extreme, if we include them they are not. Meanwhile, over the next several months, value's past performance suggests a continuation of the trend.  Given the big moves in value tend to last for over a year (eg, the run-up and run-down in the 2000 technology bubble), it seems prudent to accept missing out on the first quarter of this regime change and wait until value starts outperforming the market before doubling down.

Thursday, April 09, 2020

Fermi's Intuition on Models

In this video snippet, Freeman Dyson talks about an experience he had with Enrico Fermi in 1951. Dyson was originally a mathematician who had just shown how two different formulations of quantum electrodynamics (QED), Feynman diagrams and Schwinger-Tomonoga's operator method, were equivalent. Fermi was a great experimental and theoretical physicist who built the first nuclear reactor and discovered things like neutrinos, pions, and muons.

Dyson and a team at Cornell were working on a model of strong interactions, the forces that bind protons and neutrons in the nucleus. Their theory had a speculative physical basis: a nucleon field and a pseudo-scalar meson field (the pion field), which interacted with the proton. Their approach was to use the same tricks Dyson used on QED. After a year and a half, they produced a model that generated a nice agreement with Fermi's empirical work on meson-proton scattering he had produced at his cyclotron in Chicago.

Dyson went to Chicago to explain his theory to Fermi and presented a graph showing how his theoretical calculations matched Fermi's data. Fermi hardly looked at the graphs, and said,
I'm not very impressed with what you've been doing. When one does a theoretical calculation there are two ways of doing it. Either you should have a clear physical model in mind, or you should have a rigorous mathematical basis. You have neither. 
Dyson asked about the numerical agreement between his model and the empirical data. Fermi then responded, 'how many free parameters did you use for the fitting?'  Dyson noted there were four. Fermi responded, 'Johnny von Neumann always used to say with four parameters I can fit an elephant, with five I can make him wiggle his trunk. So I don't find the numerical agreement very impressive.'

I love this because it highlights a good way of looking at models. A handful of free parameters can make any model fit the data, generating the same result as a miracle step in a logical argument.  Either you derive a model from something you know to be true, or you derive them from a theory with a clear intuitive causal mechanism.

The entire interaction took only 15 minutes and was very disappointing, but Dyson was blessed with the wisdom and humility to take Fermi's dismissal as definitive and went back to Cornell to tell the team they should just write up what they had done and move on to different projects.

While this was crushing, with hindsight Dyson was grateful to Fermi. It saved his team from wasting years on a project that he discovered later would have never worked. There is no 'pseudo-scalar pion field.'  Eventually, physicists replaced the pion with 2 quarks, of which there are 6, highlighting the futility of the physical basis of their approach. Any experimental agreement they found was illusory.

After this experience, Dyson realized he was best suited to simplify models or connecting axioms to applications like quantum field theory. What was required for the strong interactions at that time was not a deductive solution but an invention--in this case, quarks--and that requires strong intuition. He realized his strengths were more analytic, less intuitive.

Unfortunately, today our best scientists are unconcerned about the ability of free parameters to make a bad theory seem fruitful. In physics, we have inflation, dark matter, and dark energy, things that never been isolated or fit into the Standard Model. In climate science, an anachronistic and clearly wrong Keynesian macro-model is one of many components (e.g., atmospheric, ocean, vegetation). They fit known data well but are totally unfalsifiable.

Tuesday, April 07, 2020

Decentralized Networks Need Centralized Oracles

I created an open-source contract and web-front-end, OracleSwap, because I want to see crypto move back to its off-the-grid roots. I cannot administer it because I have too many fingerprints on it to benefit directly. OracleSwap is a template that makes it easy for programmers to administer contracts that reference objective outcomes: liquid assets or sports betting. Users create long or short swap (aka CFD) positions that reference a unique Oracle contract that warehouses prices (the prototype references ETH/USD, BTC/USD, and the S&P500). The only users in this contract are liquidity providers, investors, and oracle. The single attack surface is via a conspiring oracle posting a fraudulent price. It contains several innovations, including forward-starting prices (like market-on-close), netting exposure for liquidity providers, and the ability and incentive for cheated parties to zero-out their cheater.

 The White Paper and Technical Appendix describe it more fully, but I want to explain why a centralized, pseudonymous, oracle is better than a decentralized oracle for smart contracts. Many thoughtful crypto leaders believe decentralization is a prerequisite for any dapp on the blockchain, which they define as implying many agents and a consensus mechanism. This is simply incorrect, a category error that assumes the parts must have all the characteristics of the whole. The bottom line is that decentralized oracles are inefficient and distract from the fundamental mechanism that makes any oracle 'trustless.'

 Attack and Censorship Resistance Is the Key 

After the first crusade (1099), the Knights Templar safeguarded pilgrims to newly conquered Jerusalem and quickly developed an early international bank. A pilgrim could deposit money or valuables within a Templar stronghold and receive an official letter describing what they had. That pilgrim could then withdraw cash along the route to take care of their needs. By the 12th century, depositors could freely move their wealth from one property to the next.

 The Templars were not under any monarch's control, and even worse, many owed them money. Eventually, King Philip IV of France seized an attack surface by arresting hundreds of top Templars, including the Grand Master, all on the same day across Europe in 1307. They were charged with heresy, the medieval version of systematic risk, a clear threat to all that is good and noble. A few years later many Templars were executed and the Templar banking system disappeared [unknown Templars were somehow able to flee with their vast fortune, which back then was not digital, and it is a mystery where it went].

 Governments, exchanges, and traditional financial institutions have always fought anything that might diminish their market power. Decentralization is essential for resisting their inevitable attacks, in that if someone takes over an existing blockchain, it can reappear via a hard fork. The present value of the old chain would create a willing and able army of substitute miners if China or Craig Wright decided to appropriate 51% of existing Ethereum miners.

 Vitalik Buterin nicely describes this resiliency in his admirable assessment of his limited power:
The thing with developers is that we are fairly fungible people. One developer goes down, and someone else can keep on developing. If someone puts a gun to my head and tells me to write a hard fork patch, I'll definitely write the hard fork patch. I'll write the GitHub issue, I'll write up the code, I'll publish it, and I'll do everything they say. If I do this and publish a hard fork patch to delete a bunch of accounts, how many people will be willing to download the update, install it and switch to that update? This is called decentralization.
 Vitalik Buterin. TechCrunch: Sessions Blockchain 2018 Zug, Switzerland

The potential for a hard fork in the case of an attack is the primary protection against outsiders. This depends on the protocol having a deep and committed set of users and developers who prioritize essential bitcoin principles--transparency, immutability, pseudonymity, confiscation-proof, and permissionless access--and why decentralization is critical for long-run crypto security.

 Outside attacks have decimated if not destroyed several once useful financial innovations. E-gold, Etherdelta, Intrade, and ShapeShift all had conspicuous centralization points, allowing authorities to prosecute, close, or force them to submit to traditional financial protocols. A pseudonymous oracle running virtually scripts on remote servers across the globe would be impervious to such interference. This inheritance is what makes Ethereum so valuable, in that dapps do not need their own decentralized consensus mechanisms to avoid such attacks.

 Any oracle that facilitates derivative trading or sports betting is subject to regulation in most developed countries. Dapp corporations are conspicuous attack surfaces. To the extent Augur and 0x do not compete with traditional institutions, authorities are wise to see them as insignificant curiosities simply. If these protocols ever become competitive with conventional financial institutions—by providing a futures position on the ETH price, for instance—all the traditional fiat regulations will be forced upon them under the pretext of safeguarding the public. Maker and Chainlink are already flirting with KYC, because they know they cannot conspicuously monetize markets that will ultimately generate profits without surrendering to the Borg collective.

 Satoshi needed to remain anonymous at the early stages of bitcoin to avoid some local government prosecuting him before bitcoin could work without him. The peer-to-peer system bitcoin initially emulated, Tor, is populated by people who do not advertise on traditional platforms, have institutional investors, or speak at conferences. Viable dapps should follow this example and focus less on corporatization and more on developing their reputation among current crypto enthusiasts.

Conspiracy-Proofness is Redundant and Misleading 

For cases involving small sums of money, it is difficult for random individuals in decentralized systems to collude at the expense of other participants. The costs of colluding are too high, which eliminates the effect of trolls and singular troublemakers. Yet this creates a dangerous sense of complacency as any robust mechanism must incent good behavior even if there is collusion. If we want the blockchain to handle real, significant transactions someday, this implies cases where there would be enough ETH at stake to presume someone will eventually conspire to hack the system.

Satoshi knew that malicious collusion would be feasible with proof-of-work, just not problematic because it would be self-defeating. In the Bitcoin White Paper, Satoshi emphasized how proof-of-work removed the need for a trusted third party, why the term trustless is often attributed to a decentralized network. With proof-of-work, it is not impossible to double-spend, just contrary to self-interested rationality. Specifically, he wrote that anyone with the ability to double-spend 'ought to find it more profitable to play by the rules … than to undermine the system and the validity of his own wealth.'

 For the large blockchains like Ethereum and Bitcoin, one needs specialized mining equipment that is only valuable if miners follow the letter and spirit of their law. The capital destroyed by manipulating blocks is a thousand-fold greater than the direct hash-power cost of such an attack. While a handful of Bitcoin or Ethereum mining groups can effectively collude and control 51% network control, it is not worrisome because it would not be in their self-interest to engineer a double-spend given the cost of losing future revenue. For example, in the spring of 2019, the head of Binance, Changpeng Zhao, suggested a blockchain rollback to undo a recent theft. The bitcoin community mocked him, and he quickly recanted because this would not be in the long-term self-interest of the bitcoin miners or exchanges. Saving $40 million would decimate a $100 billion blockchain, making this an easy decision.

 People often mention 'collusion resistance' as a primary decentralization virtue. A better term would be 'conspiracy resistance.' A decentralized system must generate proper incentives even if there is collusion because collusion is invariably possible as, in practice, large decentralized blockchains are controlled by a handful of teams (Michels' Iron Law of Oligarchy). There have been several instances of benign blockchain collusion, which when applied judiciously and sparingly increases resiliency (e.g., vulnerabilities in Bitcoin were patched behind the scenes in September 2018, the notorious Ethereum 2016 rollback in response to the DAO hack). Law professor Angela Walsh highlighted episodes of benign collusion as evidence the Bitcoin and Ethereum are not decentralized, and thus should be more regulated by the standard institutions.

 Lawyers are keen on technical definitions, but the key point is that the conventional regulators cannot regulate Bitcoin or Ethereum if they tried, highlighting the essential decentralization of these protocols. If the SEC in the US, or the FCA in the UK, tried to aggressively regulate Ethereum they would find the decision-makers soon outside their jurisdiction, Similarly, if Joe Lubin and Vitalik Buterin agreed to fold Ethereum into Facebook miners would fork the old chain and the existing Ether would be more valuable on this new chain. To the extent such a move is probable, the protocol is decentralized, safe from outsiders who do not like its vision for whatever reason.

 Conspiracy resistance all comes down to incentives, making sure that those running the system find running the system as generally understood more valuable than cheating. This same profit-maximizing incentive not only keeps miners honest, but it also protects them from themselves. While blockchains have many things in common, they have very different priorities. Users who prioritize speed prefer EOS; those who prioritize anonymity, Monero; institutional acceptance, Ripple. A quorum of miners who conspire to radically change their blockchain's traditional priorities will devalue their asset by alienating their base, and those who share the new priority will not switch over, but rather highlight that their favorite blockchain has been right all along. Competition among cryptos prevents hubristic insiders from doing too much damage.

 Costly Decentralization 

Quick and straightforward monitoring is essential for creating an incentive-compatible mechanism. For a decentralized oracle, various subsets of agents are at work on any outcome. It is difficult to find a concise set of data on, say, the percentage and type of Augur markets declared invalid, or a listing of Chainlink's past outcome reports. While all oracle reporting exists (immutably!), putting this together is simply impractical for an average user. Further, past errors and cheats are dismissed as anomalies, which lowers the cost of cheating.

 The 2017 ICO bubble encouraged everyone in the crypto space to issue tokens regardless of need; how a token would make a dapp more efficient was a secondary concern for investors eager to invest in the next bitcoin. Even if a small fraction of ICO money was applied to research and development, that implies hundreds of millions of dollars of talent and time focused on creating decentralized dapps that could justify their need for tokens. All would have all recognized the value of a dependable decentralized oracle, yet they were unable to deliver one, a telling failure. The most popular oracles today are effectively centralized, as ChainLink and MakerDAO have conspicuous attack surfaces as they are both tightly controlled by insiders. They will continue to be effectively centralized because the alternative would be an Augur-like system that is intolerably inefficient (slow, hackable, lame contracts).

 Decentralized oracles that depend on the market value of their tokens incenting good behavior have a significant wedge between how much users must pay the oracle and how much is needed to keep it honest. For example, suppose there is a game such that one needs to pay the reporter 1 ETH so that the net benefit of honestly reporting is greater than a scam the reporter can implement. If only 2% of token holders report on an outcome, this implies we must pay 50 ETH to the oracle collectively (1/0.02), as we have no way to focus the present value of the token onto the subset of token-holders reporting. One could force the reporter to post a bond that would be lost if they report dishonestly, but to make this work it would caps payoff at trivial levels based on reporter capital, which inefficiently ignores the present value of the oracle, and also implies a lengthy delay in payment.

 Another problem with decentralized oracles is they generally serve a diverse set of games. While this facilitates delusions of Amazon-like generality, it makes specific contracts poorly aligned with oracle incentives. The frequency and the size of the payoff will vary across applications so that an oracle fee incenting honesty at all times will be too expensive for most applications. Efficient solutions minimize contextual parameters, implying the best general solution will be suboptimal for any particular use.

 While there are obvious costs to decentralization within an oracle, there are no benefits if the fundamental censorship/attack resistance requirement is satisfied. The wisdom of the crowd is not relevant for contracts on liquid assets like bitcoin or the S&P500. A reputation scoring algorithm is pointless because the most obvious risk is an exit scam, which relies on behaving honestly until the final swindle (Bitconnect).

 To align the oracle's payoff space in a cryptoeconomically optimal way, one needs to create an oracle payoff such that the benefit of truthful reporting always outweighs the costs of misreporting. By having the oracle in total control, its revenue from truthful reporting is maximized; by being unambiguously responsible and easy to audit and punish, its costs from misreporting are fully born by the oracle; by playing a specific repeated game, the cost/benefit calculus is consistent each week; by giving a cheated user the ability and incentive to punish a cheating oracle, the cheat payoff minimized. These all lead to the efficiency of a single-agent oracle.

 Fault Tolerance 

Unintentional errors can come from corrupted sources or the algorithm that aggregates these prices and posts a single price to the contract. We often make unintentional mistakes and rely on the goodwill and common sense of those we do business with to 'undo' those cases where we might have added an extra zero to a payment. Credit cards allow chargebacks, and if a bank accidentally deposits $1MM in your account, you are liable to pay it back. The downside is that this process involves third parties who enforce the rule that big unintentional mistakes are reversible, and this implies they have rights over user account balances.

 In OracleSwap, the oracle contract itself has two error checks within the solidity code. First, if prices move by more than 50% from their prior value, and secondly, if they are exactly the same as their previous value. These constraints catch the most common errors. Off the blockchain, however, is where error filtering is more efficiently addressed in general, and ultimately it should be made into an algorithm because otherwise, one introduces an attack surface via the human who would verify a final report. Thus, using many people to reduce errors just adds back in the more subtle and dangerous source of bad prices. OracleSwap uses an automated pull of prices from several independent sources, over a couple-minute window, and takes the median. As the contract is targeting long-term investors, a median price from several exchanges will have a tolerable standard error; as the precise feeds and exchanges are unspecified, this prevents censorship; as prices a posted during a 1-hour window that precludes trading, it is easy to collect and validate an accurate price.

 A Market: Competing Centralized Agents 

Decentralizing oracles solves a problem they do not have: attack and censorship resistance. An agent updating an oracle contract only needs access to the internet and pseudonymity to avoid censorship. Given that, the best way to create proper oracle incentives is to create a game where the payoffs for honesty and cheating are well parameterized, and outsiders can easily verify if an agent is behaving honestly. Simplicity is essential to any robust game, and this implies removing parties and procedures.

 Markets are the ultimate decentralized mechanism. It is not a paradox that markets consist of centralized agents as it is often the nature of things that properties exist at lower levels but not higher ones. A decentralized market just needs consumers to have both choice and information, and for businesses to have free entry. Markets have always depended upon individuals and corporations with valuable reputations because invariably quality is difficult to assess, so consumers prefer sellers with good reputations to avoid going home with bad eggs or a car with bad wiring. Blockchains are the best accountability device in history, allowing contracts to create valuable reputations for their administrators while remaining anonymous and thus uncensorable.

 A set of competing contracts is more efficient than generalized oracles designed for unspecified contracts, or generalized trading protocols designed for unspecified oracles. A simple contract tied to an oracle that is 'all-in' creates clear and unambiguous accountability, generating the strongest incentive for honest reporting

Tuesday, March 31, 2020

The Real Corporate Bond Puzzle

The conventional academic corporate bond puzzle has been that 'risky' bonds generate too high a return premium (see here).  The most conspicuous credit metric captures US BBB and AAA bond yields going back to 1919 (Moody's calls them Baa and Aaa). This generates enough data to make it the corporate spread measure, especially when looking at correlations with business cycles.  Yet BBB bonds are still 'investment grade' (BBB, A, AA, and AAA), and have only a  25 basis point expected loss rate (default x loss in event of default). 10-year cumulative default rate after the initial rating.  Since the spread between Baa and Aaa bonds has averaged about 1.0% since 1919, this generates an approximate 0.75% annualized excess return compared to the riskless Aaa yield. Given the modest amount of risk in BBB portfolios, this creates the puzzle that corporate bond spreads are 'too high.'

HY bonds have grades of B and BB (CCC bonds are considered distressed). Their yields have averaged 3.5% higher than AAA bonds since 1996, yet the implication on returns is less obvious because the default rates are much higher (3-5% annually over the cycle). As a defaulted bond has an average recovery rate of 50% of face, a single default can wipe out many years of a 3.5% premium. 

Prior to the 1980s all HY bonds were 'fallen angels,' originally investment grade but downgraded due to poor financial performance. Mike Milken popularized the market to facilitate corporate take-overs, and by the 1990s it became common for firms to issue bonds in the B or BB category. In the early 1990s there was a spirited debate as to the actual default rate, and total returns, on HY bonds. This was not merely because we did not have much data on default and recovery rates, but also because bonds issued as HY instead of falling to HY might be fundamentally different. Indeed, when I worked at Moody's in the late 1990's I came across an internal report, circa 1990, that guestimated the default rate for HY bonds would be around 15% annualized. HY bonds were not just risky, but there was a great deal of 'uncertainty' in the sense of Knight or Keynes (winning a lottery vs. the probability Ivanka Trump becomes president).

We now have 32 years of data on this asset class, and as usual, the risky assets have lower returns than their safe counterparts. There is a HY yield premium, but no return premium.

The primary data we have are the Bank of America (formerly Merrill Lynch) bond indices, which go back to December 1988. Here we see a seemingly intuitive increase in risk and return:

Annualized Returns to US Corp Bond Indices
Bank of America (formerly Merrill Lynch)
December 1988 to March 2020


These indices are misleading. Just as using end-of-day prices to generate a daily trading strategy is biased, monthly price data for these relatively illiquid assets inflate the feasible return. Managers in this space pay large bid-ask spreads, and if they are seen eager to exit a position--which is usually chunky--this generates price impact, moving the price. Add to this the operational expense incurred in warehousing such assets, and we can understand why actual HY ETFs have lagged the Merrill HY index by about 1.4%, annualized

High Yield ETF Return Differential to BoA High Yield Index
2008 - 2020
2007 - 2020
JNK v. BoA
HYG vs. BoA
JNK and HYG are US tickers, BoA is their High Yield Total Return Index

With this adjustment, the HY return premium in the BoA HY index disappears relative to Investment Grade bonds. In my 2008 book Finding Alpha I documented that over the 1997-2008 period, closed-end bond funds showed a 2.7% return premium to IG over HY bonds.

Via Twitter, Michael Krause informed me about a vast duration difference in the ETFs I was examining, and so I edited an earlier draft for the sake of accuracy.

More recently, we can look at the difference in the HY and IG bond ETFs since then. HYG and JNK have an average maturity of 5.6 years. Investment-grade ETFs LQD and IGSB have maturities of 13 and 3, respectively. Adjusting for this, this implies a 200 basis point (ie, 2.0%) annualized premium for HY ETFs.

There is a 50 basis point management fee for the HY ETFs, about 10 bps for the IG ETFs. Given the much greater amount of research needed to buy HY ETFs, it reflects a real cost, not something that should be ignored as exogenous, unnecessary.

This generates, actually, a nice risk-return plot: linear in 'residual volatility', the volatility unexplained by interest rate changes.

Tuesday, March 10, 2020

OracleSwap: An Open-Source Derivative Contract Suite

A couple of years ago, I thought it would be good to create a crypto fund. I soon discovered that as a registered US firm my options were severely limited. I could go long or short a handful of crypto names over-the-counter, but they had excessive funding rates for going long and short (eg, >12%), and required 100% margin; I could short bitcoin at the CBOE, but I had to put up five times the notional as collateral. No reasonable estimate of alpha can overcome such costs. To use popular exchanges like Deribit or BitMEX would require lying about my domicile which would violate US regulations related to investment advisors, and also diminishes my legal rights if such an exchange decided to simply not give me my money back.

So I thought, why not create my own derivatives contract? Ethereum gives users the ability to create simple contracts, and nothing is more straightforward than a futures contract. I figured I could create a contract where the money at risk would be small relative to the notional, and its oracle would be honest because of the present value of this repeated game. The basic idea was simple enough, but the details are important and difficult, which turned this into a 2-year trip (I have sincere empathy for Ethereum's development pace).

Many initial crypto enthusiasts were motivated by the belief that our traditional financial system was corrupted by bailouts and greed. Ironically, the standard floundering blockchain dapp is constrained by their earlier short-sighted greed. Enterprising capitalists discovered that if you sell tokens, you can propose a vague blockchain business model and people will think it will be just like bitcoin, only it would offer insurance, porn, or dentistryThis required corporate structures because even in 2017 no one was gullible enough to invest in a token that funded an individual. Supposedly, the token is for use and decentralized governance, the latter implying all of the desirable bitcoin properties: transparency, immutability, pseudonymity, confiscation-proof, and permissionless access. Yet consensus algorithms are much easier to apply to blockchains than cases where essential information exists off the blockchain; non-blockchain consensus mechanisms do not generate all of those desirable bitcoin properties because they are much easier to game. 

Decentralization is a good thing, but like democracy, not at every level. A nation of purely independent contractors would never have developed the technology we have today, as things like computer chips and airplanes require hierarchal organization, and hierarchies need centralization. To relegate a market to atomistic, anonymous participants implies either an intolerable base level of fraud or costly adjudication mechanisms that jeopardize security and delay payments. A free market is built on a decentralized economy, which is based on free entry by firms and free choice by consumers. The degree of centralization within those firms is particular to a market, some of which should be large (e.g., banks).

The Coase Theorem highlights that the optimal amount of vertical integration depended on transaction costs related to information, bargaining, and enforcement. This is why firm size varies depending on the product. Naïve types think that we should just have small businesses because then we would have no oppression from businesses wielding market power. Given our current level of technology, that implies mass starvation. The naïve extension is that we should have large firms, but they should be zealously regulated by selfless technocrats. This ignores the universal nature of regulators, who protect existing firms under the pretext of protecting the consumer. This latter point is especially relevant as most protocols have some ability to permission access, and regulators will hold them accountable. Large institutions do not like competition, and governments do not like complete independence among their subjects, resulting in either KYC or curiosities like trading CryptoKitties.

The alternative I present is based on the idea that decentralization is basically competition, and that dapps can simply inherit the essential bitcoin properties by being on the blockchain without tokens and avoid convoluted consensus algorithms. That makes it cheaper and easier to design a viable product. A pseudonymous ethereum account allows oracles to develop a reputation because its actions are transparent and immutable; outsiders cannot censor it. Lower costs, crypto-security, and pemissionless access, provides a valuable way for people to lever, short, and hedge various assets: the initial contract has derivatives on ETHUSD, BTCUSD, and the S&P500.

The result is OracleSwap, an ethereum derivatives contract suite. I have a working version on the web, at While it is live on the Ethereum Main Network, it is restricted to margins of 1 or 2 szabo, which even with leverage is well under $0.01 in notional value. It is meant to provide an example. I would be an oracle and liquidity provider myself, but as a middle-aged American, that is not practical. I have fingerprints all over this thing and my friends tend to have good jobs in the highly regulated financial sector, and we would have a lot to lose by violating US regulations (e.g., CFTC SEF regulations within Dodd-Frank, FinCEN, BSA). Yet there are many who can and do invest in exchanges prohibited to US investors, and such investors need better choices.

Many competent programmers have the ability and resources to modify and administer such a contract (you can rent server space for $10/month). The oracle is honest because the present value of oracle revenue is an order of magnitude greater than a cheat. Further, the oracle has economies of scale, so those who are disciplined can create a working product, and by the time they graduate, they will have generated a couple-year track record supplying timely and accurate data. 

Several innovations make this work, all focused on radical simplicity. This lowers costs and reduces direct and indirect costs. The most important innovations are the following:  

·         Forward-starting prices

Trades are transacted at the next-business-day closing price. As this contract targets long-term investors, the standard errors generated by differences in various 4 PM ET prices are minimal and unbiased (the median of several sources over different intervals within a 5-minute window for crypto, the SPX uses the close price). As an institutional investor, I always used next-day VWAP prices. Limit order books generate many complications, and provide nothing of interest to long term investors; day trading blockchain assets is predicated on delusion. 

·         LP netting

The key to market-making capital efficiency is allowing the liquidity provider to net trades. Without a token, this had to be done through netting exposures at the weekly settlement. The LP's are basically mini-exchanges, in that long and short positions are netted. Weekly settlement can handle 200 positions in a single function call, but this can be broken up into 200-unit chunks, allowing an almost unlimited set of positions for any LP. They balance long and short demand by adjusting their long and short funding rates. The Law of Large Numbers implies larger LPs will have more balanced books, allowing them to generate a higher gross-to-net asset ratio, which implies higher returns for a given level of risk and capital; LPs are incented by economies of scale, not delusional token appreciation. 

·         The oracle

This contract is designed for those who want to stay off the grid, and so its pseudonymous oracle can maintain its anonymity and avoid censorship. Its main costs are fixed, as once the contract, front-end, and automated scripts for updating prices are created, maintenance is trivial. The oracle is kept honest via the repeated game it is playing, and the ability and incentive for users to burn their PNL rather than submit to a fraudulent PNL at settlement. A centralized oracle is much easier to incentivize because it is all-in on the brand value of its oracle contract, as a cheat should eliminate future users.

the only way to cheat involves colluding with an oracle that posts fraudulent prices, so the contract focuses on minimizing a cheat payoff while concentrating the cheat cost on the oracle. An oracle's reputation is black or white, as its history of reported prices is easy to monitor, and no rational person would ever use an oracle that cheated once. All of an oracle's brand value is in the contract due to its pseudonymous nature, so there is less incentive to sell-out to seize or protect some traditional brand value (e.g., Steem). While explaining the incentive structure requires more space than I have here, the crucial issues are that players have the ability and the will to decimate a cheat. 

Not only are the ethereum contracts open source, but the web3.js front end is as well. By downloading the web front-end users can eliminate the risk that someone is watching their interactions with the identical front-end hosted at Yet, it is mainly a template for developers. I hired people to create the basic structures as I am not a hard-core programmer, but I have modified them endlessly and in the process had to learn a lot about Drizzle/React, JavaScript, Python, and Solidity.

Python is for the APIs that pull prices from data providers and post them to the contract. This has to be automated with error-checking processes and redundancies. You can send questions related to this contract to I can't promise I'll respond, but I'll try.


This site is not encrypted--http as opposed to https--but as this contract is denominated in szabo, and the website and contract do not ask for no user information such as emails, etc, users can interact via MetaMask or without worry. Users can also download the front-end from GitHub and run a local version with all the same functionality (it's open source). It is fully functional.

Technical Document

Excel Worksheet of Technical Document Examples

Monday, February 24, 2020

BitMex Funding Rate Arbitrage

Last year I wrote about the peculiar BitMEX ether perpetual swap. The average funding rate paid by long ETH swap holders has been 50% annualized since it started trading in August 2018, considerably higher than the BTC swap rate of 2%. BitMEX makes enough money off their day trading users via their latency edge to insiders, so they let their rube traders fight over the basis: the shorts get what the longs pay. At 30k feet, it seems you can go long ETH, short the BitMEX ETH perpetual swap, and make 50% annualized with no risk. Arbitrage!

Actually, there's no arbitrage. This 50% funding rate anomaly is just the result of the simplistic pricing algorithm they used, which generates a convoluted payout. That is, as a crypto exchange, everything is denominated in BTC, but their ETH perpetual swap references the USD price of ETH. This generates the following USD return:

  • ETHswap USD return=[1+ret(BTC)]*ret(ETH)
where ret(BTC) and ret(ETH) are the net returns for bitcoin and ether. The expected value of this swap, assuming a zero risk premium for ETH and BTC, is just the covariance of the ETH and BTC:

  • E{ETHswap USD return}=covariance(ret(ETH),ret(BTC))=ρb,eσbσe
This is unfortunate because wary investors have to look at the current funding rate and expected correlation to make sure they are getting a good deal. Luckily, BitMEX insiders have arbitraged this pretty well historically, so you would have done well be simply ignoring the correlation and funding rate, and trusting arbs to sort it all out for you. If we look at the historical returns on ETH/USD, and compare them to the BitMEX ETH swap, we see this fits the data perfectly:

This shows the additive total return, in USD, for someone who was simply long ETH, and one long the ETH perpetual swap at BitMEX. The differences are insignificant. 

Note that this uses BitMEX's published funding rates, which update every 8 hours. It uses BTC and ETH prices from Windex, and the covariance is derived from BTC and ETH returns. So just as arbitrage pricing theory would suggest, the BitMEX ETH swap returns--without the funding rate--are 50% higher than the raw ETH returns in this sample period (annualized). Yet when you subtract the funding rate, it brings things back into alignment. 

In other words, the average annualized funding rate and the covariance (annualized) have been 50%. The 50% made via the convexity adjustment is taken away by the funding rate (vice versa for the short). 

Several people have contacted me after searching around the web for information on arbitraging BitMEX's ETH swap, thinking I too discovered the arbitrage opportunity. Obviously, I wasn't clear: there's no arbitrage here. I'm supplying a link to an Excel workbook with this data to make this easier to see. 

While this is a nice example of efficient markets, going forward, it's not good to trust anyone on the blockchain, especially when you probably lied about your home country (to trade from the US, one uses a VPN and pretends to be from Costa Rica), and they are domiciled in Seychelles (the Panama of Africa?).