Skip to content

Commit 7f3338e

Browse files
authored
Add images to Dynamic Fees concept section (#837)
1 parent 2aa83bc commit 7f3338e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

docs/contracts/v4/concepts/07-dynamic-fees.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,19 @@ In Uniswap v4, the dynamic fee capability of a pool is determined at pool creati
4848
1. **Periodic Updates via PoolManager:** Fees can be updated by calling the `updateDynamicLPFee` function on the PoolManager contract at specified intervals.
4949
2. **Per-Swap Updates via beforeSwap Hook:** Fees can be dynamically set for each swap by returning the fee from the `beforeSwap` hook. This allows hooks to override the LP fee for each swap in dynamic fee pools.
5050

51-
These methods offer flexibility in implementing various fee strategies. For more detailed information on implementing these methods, please refer to our [Dynamic Fees Implementation Guide](https://uniswap-docs-staging.vercel.app/documentation/featured-guides/hooks/v4/guides-for-solidity-contracts/dynamic-fee-pools).
51+
These methods offer flexibility in implementing various fee strategies.
52+
53+
Below is an example of how to set dynamic fees using the `beforeSwap` hook:
54+
55+
![](./images/Uniswap_V4_Dynamic_Fees_Step_1.jpg)
56+
57+
Before a swap occurs, the `beforeSwap` hook is invoked to determine the fee based on the defined logic. This hook calls the `updateDynamicLPFee` function on the PoolManager contract to update the fee.
58+
59+
![](./images/Uniswap_V4_Dynamic_Fees_Step_2.jpg)
60+
61+
The `updateDynamicLPFee` function in the PoolManager contract updates the pool's fee accordingly.
62+
63+
For more detailed information on implementing these methods, please refer to our [Dynamic Fees Implementation Guide](https://uniswap-docs-staging.vercel.app/documentation/featured-guides/hooks/v4/guides-for-solidity-contracts/dynamic-fee-pools).
5264

5365
## Considerations and Best Practices
5466

485 KB
Loading
484 KB
Loading

0 commit comments

Comments
 (0)