Skip to content

feat(v3-fee-adapter): add excluded-token set to V3OpenFeeAdapter - #134

Closed
pinky-gh[bot] wants to merge 1 commit into
mainfrom
cornbot/code-author/01KQJX87
Closed

feat(v3-fee-adapter): add excluded-token set to V3OpenFeeAdapter#134
pinky-gh[bot] wants to merge 1 commit into
mainfrom
cornbot/code-author/01KQJX87

Conversation

@pinky-gh

@pinky-gh pinky-gh Bot commented May 1, 2026

Copy link
Copy Markdown

What

Adds an excluded-token set to V3OpenFeeAdapter so the protocol can opt out of collecting fees in specific tokens across all v3 pools.

Changes:

  • New excludedTokens mapping (address → bool) on V3OpenFeeAdapter and its interface.
  • setExcludedToken(address token, bool excluded) setter guarded by onlyOwner (tighter than onlyFeeSetter, keeping the exclusion list under stricter control than routine fee adjustments).
  • ExcludedTokenUpdated(address indexed token, bool excluded) event emitted on updates.
  • _setProtocolFee now unpacks the waterfall-resolved feeValue into its two 4-bit sides (feeProtocol0, feeProtocol1) and zeroes out whichever side corresponds to an excluded token before forwarding to IUniswapV3Pool.setFeeProtocol — so if USDC is excluded and is token0 in a pool, feeProtocol0 is forced to 0 regardless of tier/global defaults.

Why

"lets say we dont want to take fees on USDC on any pools"

The existing fee-setting waterfall has no concept of per-token exclusions — operators would have to manually zero the correct fee side pool-by-pool, knowing whether the unwanted token is token0 or token1 in each pool. This diff adds a single authoritative exclusion list that is applied automatically at fee-set time across all pools.

This is an illustrative example patch, not production-ready code.


🤖 Opened by cornbot on behalf of Mark Toda.

@marktoda marktoda closed this May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant