Uniswap / docs

📓 Uniswap V3 docs website
https://docs.uniswap.org
317 stars 526 forks source link

Add volatility based dynamic fee hook guide with mdx formatting #755

Closed krisoshea-eth closed 1 month ago

krisoshea-eth commented 1 month ago

This PR introduces a comprehensive guide on implementing a Volatility-Based Dynamic Fee Hook in Uniswap V4. This document is written in MDX format, aligning with our documentation standards.

Key Features of the Document:

  1. Complete implementation of a volatility-based dynamic fee hook for Uniswap v4
  2. Detailed breakdown of the contract structure and key components
  3. Explanation of the volatility-based fee structure and thresholds
  4. Implementation of the Realized Volatility Oracle interface
  5. Detailed explanation of core functions:
    • getFee: Calculates fees based on current volatility
    • beforeSwap: Updates fees before each swap
    • afterInitialize: Sets initial fees for dynamic fee pools
  6. Code snippets for each major component of the implementation

Document Structure:

Impact and Importance:

This document offers a concrete example of how to leverage hooks for creating sophisticated, market-responsive fee mechanisms.

vercel[bot] commented 1 month ago

@krisoshea-eth is attempting to deploy a commit to the Uniswap Team on Vercel.

A member of the Team first needs to authorize it.