Skip to main content
Helpful?

IProtocolFees

Git Source - Generated with forge doc

Interface for all protocol-fee related functions in the pool manager

Functions

protocolFeesAccrued

Given a currency address, returns the protocol fees accrued in that currency

function protocolFeesAccrued(Currency currency) external view returns (uint256 amount);

Parameters

NameTypeDescription
currencyCurrencyThe currency to check

Returns

NameTypeDescription
amountuint256The amount of protocol fees accrued in the currency

setProtocolFee

Sets the protocol fee for the given pool

function setProtocolFee(PoolKey memory key, uint24 newProtocolFee) external;

Parameters

NameTypeDescription
keyPoolKeyThe key of the pool to set a protocol fee for
newProtocolFeeuint24The fee to set

setProtocolFeeController

Sets the protocol fee controller

function setProtocolFeeController(address controller) external;

Parameters

NameTypeDescription
controlleraddressThe new protocol fee controller

collectProtocolFees

Collects the protocol fees for a given recipient and currency, returning the amount collected

This will revert if the contract is unlocked

function collectProtocolFees(address recipient, Currency currency, uint256 amount)
external
returns (uint256 amountCollected);

Parameters

NameTypeDescription
recipientaddressThe address to receive the protocol fees
currencyCurrencyThe currency to withdraw
amountuint256The amount of currency to withdraw

Returns

NameTypeDescription
amountCollecteduint256The amount of currency successfully withdrawn

protocolFeeController

Returns the current protocol fee controller address

function protocolFeeController() external view returns (address);

Returns

NameTypeDescription
<none>addressaddress The current protocol fee controller address

Events

ProtocolFeeControllerUpdated

Emitted when the protocol fee controller address is updated in setProtocolFeeController.

event ProtocolFeeControllerUpdated(address indexed protocolFeeController);

ProtocolFeeUpdated

Emitted when the protocol fee is updated for a pool.

event ProtocolFeeUpdated(PoolId indexed id, uint24 protocolFee);

Errors

ProtocolFeeTooLarge

Thrown when protocol fee is set too high

error ProtocolFeeTooLarge(uint24 fee);

InvalidCaller

Thrown when collectProtocolFees or setProtocolFee is not called by the controller.

error InvalidCaller();

ProtocolFeeCurrencySynced

Thrown when collectProtocolFees is attempted on a token that is synced.

error ProtocolFeeCurrencySynced();
Helpful?