Interest Fees
How Interest Fees Work
Basic Interest Calculation
Interest Fee = Borrowed Amount × (INTEREST_APR_BPS / BPS_DENOMINATOR) × (Loan Duration in Days / 365)Interest Fee = 100 × (690 / 10,000) × (30 / 365) = 100 × 0.069 × 0.0822 = 0.567 BERAThe Minimum Interest Fee Mechanism
function getInterestFee(uint256 borrowed, uint256 numberOfDays) public view returns (uint256) {
uint256 interestFee = borrowed * INTEREST_APR_BPS * numberOfDays * 1e18 / 365 / BPS_DENOMINATOR / 1e18;
uint256 overCollateralizationAmount = borrowed * (BPS_DENOMINATOR - COLLATERAL_RATIO) / COLLATERAL_RATIO;
uint256 burnFee = (borrowed + overCollateralizationAmount) * burnFeeBps / BPS_DENOMINATOR;
if(burnFee <= overCollateralizationAmount) {
return interestFee;
} else if(interestFee >= burnFee - overCollateralizationAmount) {
return interestFee;
} else {
return burnFee - overCollateralizationAmount;
}
}How the Minimum Fee Works in Practice
Fee Comparison Examples
Last updated