Quantify your edge I

Quantitools
5 min readMay 27, 2022

This is the first of a series of five articles in which we will discuss in-depth why it is important to base your investment and trading rationale in data and why you should only trust highly accurate and validated data. The comments and logic described here shouldn’t be judged in any case as investment or trading advice, we at Quantitools just share this vision as it is our own practical experience on the field.

Amongst other things, we will talk about trading Bitcoin, cryptocurrencies, Terra tokens and protocols and stablecoins in general. This is, as historical data and plain judgement can tell an area of high risks for trading and investment. However, we do believe that through sound diversification (instead of complex allocation formulas and overfitted systems resulting for data torturing) it is possible to build a stable and uncorrelated portfolio, although it is not easy and it requires a combination of skills, tools and time.

Let’s start with things that went pretty bad, LUNA and the at least in theory stablecoin, UST. The data and analysis presented here can be extended with some exceptions to most asset classes, including futures and equities. We want to answer initially a question, which quantitative trading strategies could have been effective lately in this token?

We will need to get a bit more specific as the number of exchanges and derivatives where you can analyze trading opportunities is massive. So, to start with a specific scenario, let’s say you had fiat money at Coinbase and you wanted to trade LUNA as you saw an interesting opportunity because of extreme volatility (volatility is highly correlated with profitability in trading systems that actually have a proven edge).

Well, you couldn’t trade LUNA, but you could WLUNA. WLUNA is the wrapped version of LUNA, which is the asset that was tradable in Coinbase at the time. WLUNA is in short, a redeemable version of LUNA that keeps track of the LUNA price and therefore can be interchanged at a ratio of 1:1 with the original ERC20 token. We won’t judge the quality of this tradable asset, but rather explain that it was in effect tradable so it should be possible to draw some conclusions from data.

This is a 4H chart of WLUNAUSD. This pair was trading against USD at Coinbase for the date range between the 1st of May to the 24th of May (it still is at the moment of writing). The chart and analysis are created with Multicharts and data is coming from Quantitools data, our own proprietary collected, validated and reshaped data.

Coinbase WLUNA-USDT | 4 hours TF | Chart created with Multicharts | QT Data

Since shorting is not possible on Coinbase, how on earth could you make money on something like this? Are we done yet? Not quite.

A market-neutral strategy is one that by been uncorrelated to the specific asset and prices traded, could theoretically profit in any market circumstance. This is always theory because there are many other risks that are not that evident, such as counterparty default risk. In the LUNA case it is extremely obvious, but this is true of any instrument you can think of. Anyway, let’s suppose for now there is no counterparty risk and you could short with FTX Futures while buying at Coinbase. This is a combined graph of both assets with a spread percentage plot. LUNA-PERP future was delisted from FTX the 13th of May, so we need to compress a bit the date range.

FTX LUNAPERP against Coinbase WLUNA-USDT | 4 hours TF | Chart created with Multicharts | QT Data

Still, it doesn’t look convincing... Even though there are spread opportunities, they are short lived and very few to judge statistically if they are reliable or not. Let’s get granular and inspect a tick chart. First with the full data range, where we can’t see much because of the vast amount of data and secondly within a few hours of the 11th of May. Of course, when performing a fully granular analysis it is way more convenient to perform an exploratory analysis with code and statistical plots, but traditional charting is a good method for idea generation too.

FTX LUNAPERP against Coinbase WLUNA-USDT | 1000 Ticks TF | Chart created with Multicharts | QT Data
FTX LUNAPERP against Coinbase WLUNA-USDT | 1000 Ticks TF | Chart created with Multicharts | QT Data | 11th May zoom

At this atomic level, things change, we see spreads everywhere and shorting FTX Futures while covering at Coinbase seems like an excellent opportunity. In the chart, the red line indicates a 1.05 spread, this means theoretically we could have done a 5% profit every time this happened. We haven’t covered though:

  • Trading fees by the exchanges
  • Market slippage with market orders and/or risk adverse selection with limit orders
  • Exchange’s issues and API downtimes
  • A sound statistical process for arriving to valid conclusions with out-of-sample testing, cross forward validation… This is a crucial phase in any strategy development.
  • Biases. Specifically in this case we are building a strategy that is a extreme example of Hindsight bias, as there was volatility and likely spread opportunities in these periods, we are trying to leverage price discrepancies we already know they probably happened, but would this system have been ready before all the troubles that occurred with the LUNA token?

There are answers for all these questions and it is definitely possible to build a trading system to profit from scenarios like this, but every single aspect needs to be analyzed. And of course, everything starts with the highest quality data, this is the first edge.

By Jesús Martín García

--

--