-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] feat: add initial CLProtocolFeeController implementation #189
base: main
Are you sure you want to change the base?
Conversation
|
|
||
/// @notice Get the protocol fee for a pool given the conditions of this contract | ||
/// @return protocolFee The pool's protocol fee, expressed in hundredths of a bip. The upper 12 bits are for 1->0 | ||
function protocolFeeForPool(PoolKey memory poolKey) external pure override returns (uint24 protocolFee) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need some kind of whitelist here ? For example for some specific token pairs, we might want to manually give its initial protocolFee
IProtocolFees(address(key.poolManager)).setProtocolFee(key, newProtocolFee); | ||
} | ||
|
||
function collectProtocolFee(address recipient, Currency currency, uint256 amount) external onlyOwner { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need better granularity for the permission here ? For example, we might involve different roles for collect fee and set fee ?
(Of course, this could also be implemented in owner contract )
} | ||
|
||
/// @param fee If 1000, the protocol fee is 0.1%, cap at 0.4% | ||
function _buildProtocolFee(uint24 fee) internal pure returns (uint24) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure it's always same fee for zeroForOne and oneForZero
Context
TODO: