Baker DAO
Baker DAO
  • documentation
    • Introduction
    • $BREAD Rises
  • What makes BakerDAO Unique
  • Pre-Deposit Vaults and Whitelists
  • Mechanics
    • Baking and Burning
    • Loans
    • Looping
    • Borrowing vs Looping
    • Interest Fees
    • Staking
  • Contract Addresses
  • The Bakery
    • BreadGT
    • Pooled Baking
    • BreadBox
    • Auto TWAP
    • iBREAD
    • GameFi
  • Security
  • User Guide
    • Using the Bake/Burn Page
    • Borrowing with $BREAD Collateral
    • How to use Looping
    • Repaying Loans
  • Links
    • Website
    • Twitter/X
  • Telegram
  • Legal
    • Terms and Conditions
    • Privacy Policy
Powered by GitBook
On this page
  1. Mechanics

Interest Fees

How Interest Fees Work

Interest in Baker DAO works differently from traditional loans. Here's a comprehensive explanation of how the interest fee mechanism functions:

Basic Interest Calculation

The standard interest calculation follows this formula:

Interest Fee = Borrowed Amount × (INTEREST_APR_BPS / BPS_DENOMINATOR) × (Loan Duration in Days / 365)

Where:

  • INTEREST_APR_BPS is the annual interest rate in basis points (690 BPS = 6.9%)

  • BPS_DENOMINATOR is 10,000 (standard basis point denominator)

  • Loan Duration in Days is your selected loan term

For example, if you borrow 100 BERA for 30 days:

Interest Fee = 100 × (690 / 10,000) × (30 / 365) = 100 × 0.069 × 0.0822 = 0.567 BERA

The Minimum Interest Fee Mechanism

Baker DAO implements a minimum interest fee to ensure that the borrowing system cannot be exploited to bypass the burn fee. This is based on the smart contract function:

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;
    }
}

Let's break down what this means:

  1. The function first calculates a standard interest fee based on APR and duration

  2. It then calculates the over-collateralization amount (the 1% buffer between the loan and collateral)

  3. It determines what the burn fee would be if the user burned both the borrowed amount and the over-collateralization

  4. Finally, it compares these values to determine the appropriate interest fee

 // Assume you have 100 BERA worth of BREAD
 // Borrow 99 BERA
 // If I sold my BREAD, I would get 100 BERA - 2.69% burn fee = 97.31 BERA
 // If I borrow BERA against that same BREAD, I should receive no more than 97.31 BERA
 // If I borrow 99 BERA, that means there is 1 BERA overCollateralizationAmount
 // Interest Fee should be at least (99 - 97.31) = 1.69 BERA
 // Ensure that borrowing + letting yourself get liquidated isn't cheaper than burning

How the Minimum Fee Works in Practice

The protocol ensures that taking a short-term loan and defaulting isn't cheaper than simply burning BREAD tokens. Here's how:

  1. Standard Case: If the regular interest calculation (6.9% APR pro-rated for your loan duration) results in an interest fee higher than the minimum threshold, this standard interest is applied.

  2. Minimum Fee Case: If the regular interest calculation would result in a fee lower than the minimum threshold, the fee is increased to the minimum.

The minimum fee is calculated as:

Minimum Fee = Burn Fee - Over-collateralization Amount

Where:

  • Burn Fee is the cost of burning the equivalent amount of BREAD (2.69% of value)

  • Over-collateralization Amount is the 1% buffer between borrowed amount and collateral

Fee Comparison Examples

Example 1: 1-Day Loan

  • Borrow Amount: 100 BERA

  • Duration: 1 day

  • Standard Interest Calculation: 0.019 BERA (0.019%)

  • Minimum Fee Check: Applies

  • Actual Fee: Minimum fee of 1.69% (1.69 BERA)

Example 2: 365-Day Loan

  • Borrow Amount: 100 BERA

  • Duration: 365 days

  • Standard Interest Calculation: 6.9 BERA

  • Minimum Fee Check: Standard interest exceeds minimum

  • Actual Fee: 6.9 BERA

PreviousBorrowing vs LoopingNextStaking

Last updated 2 months ago