> 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.
