Deep Hedging: How to understand one of the most difficult AI & DeFi concept in less than 6mn?

Naomie Halioua
-
October 15, 2022

At PyratzLabs, we are currently working on a decentralized options market maker: the next generation of Robinhood for crypto. In order to outperform our competitor, we have introduced to our trading strategy a deep learning algorithm to help reduce the risk. This deep learning algorithm, called Deep Hedging has been only developed by companies like JPMorgan or Mazars.

Context

First, let me explain you the concept of Decentralised Options Market Maker. An option trading is how investors can speculate on the future direction of the overall market.

For example (considering BTC at 20k today): if I think the BTC market is going over 25k for the next 30 day, I’ll buy a call option with a maturity of 30 days at a strike price of 25k. At the end of this period, I have the right to execute my option, meaning that if the BTC is going over 25k, I’ll earn every $ over this amount. If is not achieve 25k, I’ll loose my premium.

Now that we understood option, let’s understand what is an automated options market maker (AOMM). An AOMM allows traders to buy and sell options on Bitcoin against a pool of liquidity (our protocol).

Since the protocol acts as a market maker, it aims to find an options trading strategy that aims to reduce (or hedge) the risk associated with price movements in the underlying asset : a Delta Hedging strategy. Put another way, we’ll hedge one investment by making a trade in another.

In traditional markets, the most popular models for valuing options called Black-Scholes. Unfortunately, this is not effectively applied to the crypto market microstructure as it is only optimal in a perfect market condition (Market efficiency and zero transaction cost assumptions, low Risk-free rate and volatility of the underlying…).

We seek to overcome this problem by adding a neural network to the delta hedging algorithm: we trained a neural network to trade the optimal hedge point in every market condition using Black Scholes as a label. The network we proposed receives as input the market information and the current delta position.

We’ll explain simply what is a neural network, how we used it on how it is interested to use it in our case.

Neural networks reflect the behavior of the human brain, allowing computer programs to recognize patterns and solve common problems. In our case, the problem we want to solve is to find a delta hedging strategy in a crypto market or in other word to adapt the traditional Black&Scholes trading strategy to a super volatile market.

Without going into details, we use deep learning techniques by training our data on a traditional market, once our algorithm is trained in this traditional environment we change its environment to a crypto environment.

We train our algorithm with four different deep learning algorithm (TCN, RNN, FNN,AttentionNet) and compare it with the traditional Black-Scholes method. Each models have these advantages and disadvantages, we compare them all and then we choose the one we will integrate in the protocol and here are the result:

First approximation:

  • The Neural Network performs way better than the B&S.

We’re going to analyse every metric to conclude. As a metric we’ll look at:

  • The Mean: the mean means “ after your maturity period, what’s the mean profit&loss you’re more likely to achieve”. With a traditional B&S models the asnwer is -367$ with Deep Learning methods we aim to do 10x better.
  • The Standard Deviation is a measure of how dispersed the data is in relation to the mean. Low standard deviation means data are clustered around the mean, and high standard deviation indicates data are more spread out. In other words, we highly prefer when the Std is low, that’s why the neural network are performing the best in the case also, and B&S is performing the worst.
  • The Var95 quantifies the amount of potential loss that could occur within our investment over a specified time period of 30 day in our case. This means that he has a 95% confidence level that the worst loss within 30 days will not exceed 1140$ in the case of the B&S. The best case scenario is while using deep learning model (TCN&RNN) they both have have a 95% confidence level that the worst loss within 30 days will not exceed respectively 361$ and 611$ . It’s way better than the result with B&S methods.
  • The Var99 — same as Var95 but this time with a 99% confidence level. Some deep learning model perform best and some perform worst to the B&S
  • The CVar99 and CVar95 corresponding to CVar, is the weighted average of observations for which the loss exceeds the VaR. The conditional value at risk (CVaR), tell us the average conditional loss expected if the loss is greater than the VaR. Once again, unless for the FNN and AttentionNet model, the Cvar is greater with every model than with classical B&S models.
  • The Huber Loss metric is a deep learning metric used to quantify the different deep learning algorithms, we’ll pass through.

For a second conclusion, we analysed the delta of B&S compared to the delta of our deep learning model. We took the delta hedging for our “model” and compare it to a classical delta hedge.

Remember: we train an algorithm to find at each time the best hedge point in order to reduce or risk. We aim to do better than B&S in a crypto environment.

  • This figure represent the delta rebalancement from the B&S method in comparison to the delta of the Deep Hedging Methods at each maturity time.
  • It all start at bottom right at time =0, the strike is at the money meaning that the delta is equal to 0,5 always.
  • Given the time, the Neural Network is learning with the Black&Scholes Delta as a label.
  • The result is smoother at the extremities of the curve with the Neural Network with the Black&Scholes. As we saw before, Deep Learning model outperform the classic B&S Delta Hedging, and for this reason we obtain better result in the table above with the FNN model than with the classic B&S model.
  • What is most alarming is the model’s extremities: the farther you go from the spot price, the better the delta of the neural network is than the one of black&scholes, so this is what explains the big difference between the results of these two models.

Conclusion

In this paper, we leverage a set of state-of-the-art deep learning technologies to explore the landscape of neural delta hedging.

We seek to explain it to begineer with little Blockchain & Data background

We build a protocol who have the ability to minimize profit and loss for options trading introducing deep learning method.