# Dynamic Fees

The dynamic fee model and pool reblancing for our AMM was created by iterating on the numerous AMM designs throughout crypto over the years but adapted to the specific characteristics of a constant product system, which doesn’t use discrete price bins. Instead, we use factors like volatility to compute the dynamic fee.

Dynamic Fee depends on&#x20;

1. **How volatile the market is:** If prices are fluctuating frequently, we increase the fee to protect the pool and generate more rewards for Liquidity Providers (LPs).
2. **How balanced the pool is:** GAMMA aims for a 50/50 split of token amounts in the pool. The further away from that balance we get, the more we adjust the fee.
3. **Volume:** If trading volume is high, fees can adapt to provide the optimum returns for LPs.

***

## **Dynamic Fee Formula**

{% code fullWidth="false" %}

```
dynamic_fee_rate = base_fee + volatility_component + recent_price_volatility
```

{% endcode %}

* **volatility\_component**

{% code lineNumbers="true" fullWidth="false" %}

```
volatility_component = min(max_volatility_fee, volatility_factor * recent_price_volatility)
```

{% endcode %}

* **recent\_price\_volatility**

<pre class="language-html" data-line-numbers data-full-width="false"><code class="lang-html"><strong>recent_price_volatility = (max_price - min_price) / avg_price over the last N observations
</strong></code></pre>


---

# 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.goosefx.io/goosefx-amm/gamma/dynamic-fee.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.
