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

Was this helpful?

  1. Library
  2. Academy
  3. Gamma Swap

A New Transaction Fee Algorithm for Gamma Swap

PreviousHedging Impermanent Loss with Gamma SwapNextGlossary

Last updated 1 year ago

Was this helpful?

Since its introduction earlier this year, Gamma Swap has garnered significant attention. Despite its appeal, the beta phase highlighted several concerns. Most technical issues have been addressed, yet the matter of transaction fees demands a novel solution.

Under the existing fee algorithm, closing a Gamma Swap position often incurs an exorbitant cost. This issue originates from the absence of a pre-existing model for fee calculation during the initial design phase of Gamma Swap, a pioneering derivative product. Initially, we adopted a straightforward method, imposing fees on the power perpetual component, but this approach has been shown to be impractical.

To remedy this, we propose the Info-Advantage-Based fee algorithm. The idea of this model is to neutralize the profits that a trader might gain with an informational edge of a certain size. Take, for example, a front-runner who has the ability to get ahead of the DPMM by a margin of 0.1% in price movement. The fee structure is designed so that the gross revenue they would make from a round trade (opening and closing a position) would be offset by the transaction fee.

Employing this principle, we've formulated the following fee algorithm:

FeeGamma=i2ā‹…0.002ā‹…0.02+(iāˆ’i0)iā‹…0.004ā‰ˆMpowerā‹…0.002ā‹…0.02+m′Mfuturesā‹…0.002\begin{align*} Fee_{Gamma} &= i^2\cdot 0.002 \cdot 0.02 + (i-i_0)i \cdot 0.004\\ &\approx M_{power}\cdot 0.002\cdot 0.02 + m'M_{futures}\cdot0.002 \end{align*}FeeGamma​​=i2ā‹…0.002ā‹…0.02+(iāˆ’i0​)iā‹…0.004ā‰ˆMpower​⋅0.002ā‹…0.02+m′Mfutures​⋅0.002​

where

  • iii represents the index price of the underlying (e.g. the price of BTC)

  • MpowerM_{power}Mpower​ the mark price of the power perp component; MpowerM_{power}Mpower​ the mark price of the futures component

  • m′=2i1āˆ’hTāˆ’2i01āˆ’h0Tā‰ˆ2(iāˆ’i0)m'=\frac{2i}{1-hT}-\frac{2i_0}{1-h_0T}\approx2(i-i_0)m′=1āˆ’hT2iā€‹āˆ’1āˆ’h0​T2i0ā€‹ā€‹ā‰ˆ2(iāˆ’i0​) is the number of effective futures.

Inside the code, this is the algorithm of calculating the exact amount of the fee charged on a specific trade:

Fee=CostPowerā‹…0.002ā‹…0.02+CostEffectiveFuturesā‹…0.002Fee = Cost_{Power}\cdot 0.002\cdot 0.02+Cost_{EffectiveFutures}\cdot 0.002Fee=CostPower​⋅0.002ā‹…0.02+CostEffectiveFutures​⋅0.002

Please note the figures 0.002 and 0.02 are illustrative parameters chosen to demonstrate the mechanics of the new algorithm. The final parameters will be established upon the official release of Gamma Swap featuring the updated fee algorithm.

We will officially release the Gamma Swap with this new fee algorithm in Deri V4.

The current transaction fee is CostPowerā‹…0.002Cost_{Power}\cdot 0.002CostPower​⋅0.002