FeeHelper
Last updated
Last updated
Author: Trader Joe
This library contains functions to calculate fees
Modifier to check that the fee is not too large
Parameters
fee
uint128
The fee
Modifier to check that the protocol share is not too large
Parameters
protocolShare
uint128
The protocol share
Calculates the fee amount from the amount with fees, rounding up
Parameters
amountWithFees
uint128
The amount with fees
totalFee
uint128
The total fee
Returns
<none>
uint128
feeAmount The fee amount
Calculates the fee amount that will be charged, rounding up
Parameters
amount
uint128
The amount
totalFee
uint128
The total fee
Returns
<none>
uint128
feeAmount The fee amount
Calculates the composition fee amount from the amount with fees, rounding down
Parameters
amountWithFees
uint128
The amount with fees
totalFee
uint128
The total fee
Returns
<none>
uint128
The amount with fees
Calculates the protocol fee amount from the fee amount and the protocol share, rounding down
Parameters
feeAmount
uint128
The fee amount
protocolShare
uint128
The protocol share
Returns
<none>
uint128
protocolFeeAmount The protocol fee amount
Internal function to check that the fee is not too large
Parameters
fee
uint128
The fee