> For the complete documentation index, see [llms.txt](https://docs.goosefx.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.goosefx.io/goosefx-amm/clmm/risk-and-arbitrage-protections.md).

# Risk & Arbitrage Protections

**Smarter Fee & Flow Logic**

* **1-min Volatility Windows**: Price volatility is tracked in rolling 1-minute windows directly on-chain.
* **Oracle-Based Pricing**: Fees is calculated using oracle-driven price changes instead of just swap deltas.
* **Unified Swap Direction Handling**: Swap direction logic (A→B & B→A) is evaluated together using shared price and volatility context.

<figure><img src="/files/9I3LbwWvSkqLxUGiGmpt" alt=""><figcaption></figcaption></figure>

**Reliable Execution During Congestion**

* **Compute-Aware Batching**: Large transactions are split into smaller compute-efficient instructions.
* **Adaptive Priority Fees**: GAMMA adjusts priority fees in real time to increase success during network congestion.

These changes reduce missed updates on volatile pairs and improve swap reliability.

**Improved Oracle Management**

* **Slot-Based Staleness Checks**: Price freshness is now tracked by Solana slot height instead of wall-clock time, improving consistency.
* **Smarter CEX Routing**: Off-chain price polling is routed via the most liquid CEX book, not just aggregator feeds.

**Toxic Flow Resistance**

* **Directional Fees Optimization**: LP protection mechanisms now handle fee symmetry more efficiently, reducing arbitrage exposure.

\
These measures help GAMMA deliver better pricing, reduce arb risk, and grow yield for LPs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/clmm/risk-and-arbitrage-protections.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.
