IFeeCalculator
Last updated
Last updated
Interface for a contract that calculates fees for a vault and protocol
Register a new vault with the fee calculator
function registerVault() external;
Process a fee claim for a specific vault
Expected to be called by the vault only when claiming fees Only accrues fees and updates stored values; does not transfer tokens Caller must perform the actual transfers to avoid permanent fee loss
function claimFees(uint256 feeTokenBalance) external returns (uint256, uint256, address);
Parameters
feeTokenBalance
uint256
Available fee token balance to distribute
Returns
<none>
uint256
earnedFees The amount of fees to be claimed by the fee recipient
<none>
uint256
protocolEarnedFees The amount of protocol fees to be claimed by the protocol
<none>
address
protocolFeeRecipient The address of the protocol fee recipient
Process a protocol fee claim for a vault
Expected to be called by the vault only when claiming protocol fees Only accrues protocol fees and updates stored values; does not transfer tokens Caller must perform the actual transfers to avoid permanent protocol fee loss
function claimProtocolFees(uint256 feeTokenBalance) external returns (uint256, address);
Parameters
feeTokenBalance
uint256
Available fee token balance to distribute
Returns
<none>
uint256
accruedFees The amount of protocol fees claimed
<none>
address
protocolFeeRecipient The address of the protocol fee recipient
Returns the current claimable fees for the given vault, as if a claim was made now
function previewFees(address vault, uint256 feeTokenBalance)
external
view
returns (uint256 vaultFees, uint256 protocolFees);
Parameters
vault
address
The address of the vault to preview fees for
feeTokenBalance
uint256
Available fee token balance to distribute If set to type(uint256).max
, the function returns all accrued fees If set to an actual balance, the result is capped to that claimable amount
Returns
vaultFees
uint256
The amount of claimable fees for the vault
protocolFees
uint256
The amount of claimable protocol fees
Returns the address that receives protocol fees
function protocolFeeRecipient() external view returns (address);
Returns
<none>
address
The address that receives the protocol fees
Emitted when a new vault is registered
event VaultRegistered(address indexed vault);
Parameters
vault
address
The address of the registered vault
Thrown when attempting to register an already registered vault
error Aera__VaultAlreadyRegistered();