Deri Protocol Docs
HomeMiningFuturesOptions
  • Genesis
    • Getting Started
  • πŸ“ˆTrading [Guide]
    • Deri Lite
      • Perpetual Futures
      • Everlasting Options
      • Power Perpetuals
    • Deri Pro
      • Perpetual Futures
      • Everlasting Options
      • Power Perpetuals
      • Gamma Swap
    • Arbitrage
  • πŸ“ΆMining [Guide]
    • AMM Liquidity Mining
    • DERI Liquidity Mining
  • How it works
    • Architecture
    • DPMM (Proactive Market Making)
    • Oracle
    • External Custody
    • Funding Fee
    • Leverage
    • Margin Requirement
    • Open Interest
    • Liquidation
    • Mining (AMM Liquidity Mining)
    • Limit Orders and Stop Orders
  • Governance
    • Deri Improvement Proposal (DIP)
  • Library
    • Derivative Products
    • Whitepaper
    • Code Audits
    • Tokenomics
    • List of Smart Contracts
    • Referral Program
    • Social Links & Media
    • Bridge
    • Trade on Demo Testnet
    • Academy
      • General
        • What are derivatives in DeFi?
        • What are the 3 biggest mistakes of trading derivatives?
        • Four tips for your trading
      • Perpetual Futures
        • General Intro about Perpetual Futures
        • How to Arbitrage
      • Everlasting Options
        • Introducing EverLasting Options
        • Numerical Examples of Everlasting Option Pricing
      • Power Perpetuals
        • Introducing Power Perpetuals
        • Hedging Impermanent Loss with Power Perpetuals (1)
        • Hedging Impermanent Loss with Power Perpetuals (2)
      • Gamma Swap
        • Introducing Gamma Swap
        • Gamma Swap by Deri Protocol
        • Hedging Impermanent Loss with Gamma Swap
        • A New Transaction Fee Algorithm for Gamma Swap
    • Glossary
    • ℹ️FAQs
      • Trading FAQ
        • Perpetual Futures
        • Everlasting Options
      • Mining FAQ
      • Mini-App FAQ
  • DEVELOPERS
    • How to find the Token ID associated with your account
    • Ideas to build
  • Support
    • Submit a question
    • Bug Report & Suggestions
    • Brand Asset
Powered by GitBook
On this page
  • Introduction
  • Mark Price and Funding
  • The Greeks
  • Margin
  • Summary

Was this helpful?

  1. Library
  2. Academy
  3. Gamma Swap

Introducing Gamma Swap

PreviousGamma SwapNextGamma Swap by Deri Protocol

Last updated 2 years ago

Was this helpful?

Introduction

This paper introduces a new type of derivative, Gamma Swap, inspired by . It is for the buyers (taking the long side) to gain the Gamma exposure of some underlying asset and the sellers (taking the short side) to earn the funding fees by providing that exposure.

We want to define the Gamma Swap of some underlying asset XXXfor the long and short sides to have the following PnL, respectively:

  • A long position pays the funding fee and has the PnL∝(xβˆ’x0)2PnL\propto(x-x_0)^2PnL∝(xβˆ’x0​)2 , where x0x_0x0​ is the entry price of the position;

  • A short position collects the funding fee and has the PnLβˆβˆ’(xβˆ’x0)2PnL\propto-(x-x_0)^2PnLβˆβˆ’(xβˆ’x0​)2 , where x0x_0x0​ is the entry price of the position;

Mathematically, we can split (xβˆ’x0)2(x-x_0)^2(xβˆ’x0​)2 into the following two parts, which can be tracked by long Power Perps and short Perpetual Futures, respectively.

(xβˆ’x0)2=[x2βˆ’x02]βˆ’[2x0(xβˆ’x0)] (x-x_0)^2=[x^2-x_0^2]-[2x_0(x-x_0)](xβˆ’x0​)2=[x2βˆ’x02​]βˆ’[2x0​(xβˆ’x0​)]

Due to the Gamma premium, of 1 unit of power perp is x21βˆ’hT \frac{x^2}{1-hT}1βˆ’hTx2​ , where TTT is the funding period and h=r+Οƒ2h=r+\sigma^2h=r+Οƒ2 (rrr is the risk-free interest rate and Οƒ\sigmaΟƒ is the volatility). Therefore, we define Gamma Swap as follows:

1GammaSwap=1PowerPerpβˆ’2x01βˆ’h0TPerpFutures 1\text{GammaSwap}=1\text{PowerPerp}-\frac{2x_0}{1-h_0T}\text{PerpFutures}1GammaSwap=1PowerPerpβˆ’1βˆ’h0​T2x0​​PerpFutures

where h0h_0h0​ is the value of hhh at the entry point. That is, we define 1 unit of Gamma Swap has the PnL equivalent to the portfolio of long 1 Power Perp and short 2x01βˆ’h0T\frac{2x_0}{1-h_0T}1βˆ’h0​T2x0​​ Perpetual Futures. Per this definition, Gamma swap has the following theoretical value:

Pgamma=11βˆ’hT(x2βˆ’x02)βˆ’2x01βˆ’h0T(xβˆ’x0)P_{gamma}=\frac{1}{1-hT}(x^2-x_0^2)-\frac{2x_0}{1-h_0T}(x-x_0)Pgamma​=1βˆ’hT1​(x2βˆ’x02​)βˆ’1βˆ’h0​T2x0​​(xβˆ’x0​)

When volatility stays still at h=h0h=h_0h=h0​ , we have:

Pgamma=11βˆ’hT(xβˆ’x0)2P_{gamma}=\frac{1}{1-hT}(x-x_0)^2Pgamma​=1βˆ’hT1​(xβˆ’x0​)2

which gives exactly the PnL that we want in our motivation. Now we have successfully structured a new derivative, Gamma Swap, to provide the wanted risk exposure.

Derivative v.s. Portfolio

However, the equivalency brings us to the question: why do we need such a new derivative instead of simply holding a portfolio of futures and powers? This is because the latter has the following two disadvantages:

  • At the entry point, a unit of Gamma Swap has zero Delta, while the perp component and the power component have the exact opposite non-zero Delta. To long 1 power and short 2x01βˆ’h0T\frac{2x_0}{1-h_0T}1βˆ’h0​T2x0​​ perps separately, one needs to post margin for the power component (mostly for its positive Delta) as well as for the perp component (for its negative Delta), respectively. These two parts of margin are purely a waste of capital since the two corresponding parts of Delta are not wanted and canceled out.

  • To construct such a portfolio, for the unwanted positive Delta and negative Delta, one is paying extra transaction fees and trading costs (slippage, funding fees, etc.).

Put simply, to obtain pure Gamma exposure by holding a portfolio of powers and perps, one has to allocate extra capital for margin as well as pay extra costs for 0 Delta. And Gamma Swap is introduced to directly provide the Gamma exposure without such wastes.

Trade with specified entry price

By default, a Gamma swap is traded with the current price as the entry price. However, one can also enter a Gamma swap position specifying the entry price xsx_sxs​ to gain the Gamma exposure around the specified point, i.e. to have Pnl∝(xβˆ’xs)2Pnl\propto(x-x_s)^2Pnl∝(xβˆ’xs​)2 . A Gamma swap traded with a specified entry price is treated per the following definition:

1GammaSwap(xs)=1PowerPerpβˆ’2xs1βˆ’h0TPerpFutures1\text{GammaSwap}(x_s)=1\text{PowerPerp}-\frac{2x_s}{1-h_0T}\text{PerpFutures}1GammaSwap(xs​)=1PowerPerpβˆ’1βˆ’h0​T2xs​​PerpFutures

Mark Price and Funding

To trade Gamma swap, we need a composite trading venue that contains two (virtual) primitive trading venues for power perps and perpetual futures, respectively. This paper only introduces the concept of Gamma swap and the implementation of the composite trading venue will be discussed in a subsequent paper. Here we just assume we already have such a composite trading venue that has real-time Mark prices for the (virtual) power perps and perpetual futures, denoted as MpowerM_{power}Mpower​ and MperpM_{perp}Mperp​ respectively.

Hereafter, we use iii to represent the index price of the underlying, which is different from the general term of price xxx in the previous conceptual discussion. Just as how perpetual futures and power perps are traded (with orderbook or AMM), the index price iii is an external input to the trading venue. With the composite trading venue giving MpowerM_{power}Mpower​ and MperpM_{perp}Mperp​ , it is straightforward to define the mark price of Gamma swap as follows:

Mgamma=Mpowerβˆ’2i01βˆ’h0TMperp+i021βˆ’h0TM_{gamma}=M_{power}-\frac{2i_0}{1-h_0T}M_{perp}+\frac{i_0^2}{1-h_0T}Mgamma​=Mpowerβ€‹βˆ’1βˆ’h0​T2i0​​Mperp​+1βˆ’h0​Ti02​​

where i0i_0i0​ is the entry price (or the specified entry price). Note the third item on RHS is a constant to make the expression financially meaningful.

With such a set-up, Gamma swap does not have a simple mark-price-based funding mechanism (like power perp’s). Instead, we define that the Gamma swap has composite funding consisting of power funding and perp funding:

Fgamma=Fpower+(2i1βˆ’hTβˆ’2i01βˆ’h0T)FperpF_{gamma}=F_{power}+\left(\frac{2i}{1-hT}-\frac{2i_0}{1-h_0T}\right)F_{perp}Fgamma​=Fpower​+(1βˆ’hT2iβ€‹βˆ’1βˆ’h0​T2i0​​)Fperp​

where(i0,h0)(i_0,h_0)(i0​,h0​) are the (i,h)(i,h)(i,h) as of the position entry point, and

Fpower=Mpowerβˆ’i2TFperp=Mperpβˆ’iT\begin{align*} F_{power}=&\frac{M_{power}-i^2}{T}\\ F_{perp}=&\frac{M_{perp}-i}{T} \end{align*}Fpower​=Fperp​=​TMpowerβ€‹βˆ’i2​TMperpβ€‹βˆ’i​​

Notice that the coefficient of FperpF_{perp}Fperp​ is a bit complicated, constantly varying with iii . Essentially, this can be understood as every unit of Gamma swap has βˆ’2i01βˆ’h0T-\frac{2i_0}{1-h_0T}βˆ’1βˆ’h0​T2i0​​ β€œreal futures” as well as 2i1βˆ’hT\frac{2i}{1-hT}1βˆ’hT2i​ β€œvirtual futures”, and hence totally (2i1βˆ’hTβˆ’2i01βˆ’h0T)\left(\frac{2i}{1-hT}-\frac{2i_0}{1-h_0T}\right)(1βˆ’hT2iβ€‹βˆ’1βˆ’h0​T2i0​​) effective futures.

The Greeks

Since1GammaSwap=1PowerPerpβˆ’2x01βˆ’h0TPerpFutures 1\text{GammaSwap}=1\text{PowerPerp}-\frac{2x_0}{1-h_0T}\text{PerpFutures}1GammaSwap=1PowerPerpβˆ’1βˆ’h0​T2x0​​PerpFutures , we have:

Ξ”gamma=Ξ”powerβˆ’2x01βˆ’h0TΞ”perp=2x1βˆ’hTβˆ’2x01βˆ’h0T\begin{align*} \Delta_{gamma}&=\Delta_{power}-\frac{2x_0}{1-h_0T}\Delta_{perp}\\ &=\frac{2x}{1-hT}-\frac{2x_0}{1-h_0T} \end{align*}Ξ”gamma​​=Ξ”powerβ€‹βˆ’1βˆ’h0​T2x0​​Δperp​=1βˆ’hT2xβ€‹βˆ’1βˆ’h0​T2x0​​​

Especially, at the entry point, we have Ξ”gamma=0\Delta_{gamma}=0Ξ”gamma​=0 . This is exactly what we want from the Gamma swap: pure Ξ“\GammaΞ“ without Ξ”\DeltaΞ” .

However, when the price changes while hhh stays still (h=h0)(h=h_0)(h=h0​) , we have:

Ξ”gamma=21βˆ’h0T(xβˆ’x0)\begin{align*} \Delta_{gamma}=\frac{2}{1-h_0T}(x-x_0) \end{align*}Ξ”gamma​=1βˆ’h0​T2​(xβˆ’x0​)​

That is, when xxx drifts away from x0x_0x0​, the Gamma swap will linearly build a non-zero Ξ”\DeltaΞ” proportional to (xβˆ’x0)(x-x_0)(xβˆ’x0​). This is the Ξ”\DeltaΞ” β€œbuilt” by the Ξ“\GammaΞ“ , which is the micro-process of how the Gamma swap works. Note that Ξ“\GammaΞ“ is the second-order differential, which would only affect PnL by its integral, i.e., the first-order differential, Ξ”\DeltaΞ” .

Please note that a Gamma swap traded with a specified entry price xsx_sxs​ has a non-zero Ξ”\DeltaΞ” at the beginning:

Ξ”gamma(ent.price=xs)=21βˆ’hT(x0βˆ’xs)\begin{align*} \Delta_{gamma}(ent.price=x_s)=\frac{2}{1-hT}(x_0-x_s) \end{align*}Ξ”gamma​(ent.price=xs​)=1βˆ’hT2​(x0β€‹βˆ’xs​)​

So, if wanting to obtain Ξ“\GammaΞ“ together with a non-zero Ξ”\DeltaΞ”, one can trade Gamma swap with a properly specified entry price.

The Ξ“\GammaΞ“ of Gamma swap is as follows:

Ξ“gamma=Ξ“powerβˆ’2i01βˆ’h0TΞ“perp=21βˆ’hT\begin{align*} \Gamma_{gamma}&=\Gamma_{power}-\frac{2i_0}{1-h_0T}\Gamma_{perp}\\ &=\frac{2}{1-hT} \end{align*}Ξ“gamma​​=Ξ“powerβ€‹βˆ’1βˆ’h0​T2i0​​Γperp​=1βˆ’hT2​​

which is a constant as long as volatility stays still. This is also what we want from the Gamma swap: almost constant Ξ“\GammaΞ“ .

The effects of varying volatility

The previous analyses assume volatility stays unchanged. So how would varying volatility affect Gamma swaps? It’s easy to see that a Gamma swap has the same Vega as power’s. So we only look into how volatility affects Ξ”gamma\Delta_{gamma}Ξ”gamma​ and Ξ“gamma\Gamma_{gamma}Ξ“gamma​ .

βˆ‚Ξ”gammaβˆ‚Οƒ=2xT(1βˆ’hT)2βˆ‚hβˆ‚Οƒ=4xTΟƒ(1βˆ’hT)2\frac{\partial \Delta_{gamma}}{\partial \sigma}=\frac{2xT}{(1-hT)^2}\frac{\partial h}{\partial \sigma}=\frac{4xT\sigma}{(1-hT)^2}βˆ‚Οƒβˆ‚Ξ”gamma​​=(1βˆ’hT)22xTβ€‹βˆ‚Οƒβˆ‚h​=(1βˆ’hT)24xTσ​

A small change in volatility, δσ \delta\sigmaδσ , would cause:

δΔgamma=δσσ⋅4xTΟƒ2(1βˆ’ht)2β‰ˆΞ΄ΟƒΟƒ4TΟƒ2x\delta\Delta_{gamma}=\frac{\delta\sigma}{\sigma}\cdot\frac{4xT\sigma^2}{(1-ht)^2}\approx \frac{\delta\sigma}{\sigma}4T\sigma^2xδΔgamma​=σδσ​⋅(1βˆ’ht)24xTΟƒ2β€‹β‰ˆΟƒΞ΄Οƒβ€‹4TΟƒ2x

For small TTT, e.g. 1 day or 1 week, this is usually a negligible amount.

Similarly, we have:

βˆ‚Ξ“gammaβˆ‚Οƒ=4ΟƒT(1βˆ’hT)2\frac{\partial \Gamma_{gamma}}{\partial \sigma}=\frac{4\sigma T}{(1-hT)^2}βˆ‚Οƒβˆ‚Ξ“gamma​​=(1βˆ’hT)24ΟƒT​
δΓgammaΞ“gamma=δσσ⋅2Οƒ2T1βˆ’hT\frac{\delta\Gamma_{gamma}}{\Gamma_{gamma}}=\frac{\delta\sigma}{\sigma}\cdot\frac{2\sigma^2 T}{1-hT}Ξ“gamma​δΓgamma​​=σδσ​⋅1βˆ’hT2Οƒ2T​

which is around 4% of (δσ/Οƒ)(\delta\sigma/\sigma)(δσ/Οƒ) for T=1weekT=1\text{week}T=1week , or around 0.5% for T=1dayT=1\text{day}T=1day .

Therefore, we can conclude that varying volatility does not substantially affect the constancy of a Gamma swap’s Ξ“ \GammaΞ“ , which is a very important feature for the use cases.

In summary, the analysis of the Greeks shows Gamma swap gives exactly what we want: (almost) constant and pure Ξ“\GammaΞ“ without Ξ”\DeltaΞ” .

Margin

One possible margin solution for Gamma swap could be the β€œGreek-based margin”. That is, with Ξ”gamma\Delta_{gamma}Ξ”gamma​ and Ξ“gamma\Gamma_{gamma}Ξ“gamma​ , we can estimate the change of the Gamma swap value due to the underlying price change from xxx to x+Ξ΄x x+\delta xx+Ξ΄x , with a second-order Taylor expansion:

Ξ΄Pgammaβ‰ˆΞ”gammaΞ΄x+12Ξ“gammaΞ΄x2\delta P_{gamma}\approx\Delta_{gamma}\delta x+\frac{1}{2}\Gamma_{gamma}\delta x^2Ξ΄Pgammaβ€‹β‰ˆΞ”gamma​δx+21​Γgamma​δx2

And the margin system works as follows: the trader is required to post as collateral the possible loss associated with a specific risk scenario, e.g. Ξ΄x/x=Β±5%\delta x/x =\pm5\%Ξ΄x/x=Β±5% .

Summary

This paper introduces a new type of derivative, Gamma Swap, to efficiently and directly provide almost constant and pure Gamma exposure for traders. However, as a composite derivative, it depends on a composite trading venue to facilitate the trading. We will discuss such a composite trading venue in a subsequent paper.

Application-wise, since Gamma is one of the most primitive elements in the financial world (probably only second to Delta), there would be many potential use cases of Gamma swap. In fact, it would be the go-to solution whenever pure Gamma is needed. We will discuss the applications of Gamma swap in subsequent papers.

The Greeks are the motivation to design Gamma Swap. We look into them in this section. To avoid confusion, in this paper the word β€œgamma” refers to the derivative Gamma swap, while the Greek letter Ξ“\GammaΞ“ refers to .

Discussions are welcome. You can send emails to , or DM on Twitter.

Power Perpetuals
the theoretical price
the Greek
0xAlpha@dfactory.tech
0xAlpha