# A New Transaction Fee Algorithm for Gamma Swap

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:

$$
\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\*}
$$

where

* &#x20;$$i$$ represents the index price of the underlying (e.g. the price of BTC)
* $$M\_{power}$$  the mark price of the power perp component; $$M\_{power}$$  the mark price of the futures component
* $$m'=\frac{2i}{1-hT}-\frac{2i\_0}{1-h\_0T}\approx2(i-i\_0)$$  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 = Cost\_{Power}\cdot 0.002\cdot 0.02+Cost\_{EffectiveFutures}\cdot 0.002
$$

{% hint style="info" %}
The current transaction fee is $$Cost\_{Power}\cdot 0.002$$ &#x20;
{% endhint %}

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.deri.io/library/academy/gamma-swap/a-new-transaction-fee-algorithm-for-gamma-swap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
