Fees

Introduction

Stablis is designed with flexibility and adaptability at its core, allowing it to accommodate the varying needs of its users. The protocol offers two types of fees:

  • Fixed fees: Minting fee & Redemption fee

  • Borrowing interest rate

The aim of these fees is to maintain the stability and liquidity of the protocol while also providing an incentive for user participation.

Both fixed fees and continuous interest can be adjusted by the governance of the Stablis Protocol. This means that the Stablis community can vote on the parameters of these fees, allowing the protocol to adapt to changing market conditions and ensuring that it continues to offer competitive rates for its users.

Borrowing fees

Every time you borrow USDs from your Chest, a one-off borrowing fee is charged on the drawn amount and added to your debt. Please note that the borrowing fee is variable (and determined algorithmically) and has a minimum value of 0.5%. This minimum value can be changed through governance by the community. A 10 USDs liquidation reserve charge will be applied as well, but returned to you upon repayment of debt. The borrowing fee is added to the debt of the Chest and is given by a Base rate. The fee rate is confined to a range between 0.5% - 5% and is multiplied by the amount of liquidity drawn by the borrower.

For example: The borrowing fee stands at 0.5% and the borrower wants to receive 4000 USDs to their wallet. Being charged a borrowing fee of 20 USDs, the borrower will incur a debt of 4030 USDs after the Liquidation Reserve and issuance fee are added.

Redemption fees

Redemption fees are based on the baseRate state variable in Stablis, which is dynamically updated. The baseRate increases with each redemption, and decays to 0 over time with a 12 hour half life.

Upon each redemption:

  • baseRate is decayed based on time passed since the last fee event

  • baseRate is incremented by an amount proportional to the fraction of the total USDs supply that was redeemed

  • The redemption fee is given by (baseRate + 0.5%) * Value withdrawn collateral asset (Eth/sMetis)

baseRateNew = baseRateOld + redeemedUSDs / (2 * totalUSDs)

Where baseRateOld is the value just prior to this redemption, and baseRateNew is the new value (and gets applied to this redemption).

Interest fees

Borrow Interest Rate is a fee that accrues over time on outstanding debt. This is common in most lending protocols and serves as a source of revenue that will be shared with STS stakers. In Stablis, this fee is charged on the USDs borrowed against the collateral and the parameters for this can be changed through governance.

Interest Calculation

Interest accrues to all borrowers in a market when any Metis address interacts with the protocol contracts, calling one of these functions: liquidate, batchLiquidateChests, redeemCollateral, openChest, addColl, withdrawColl, withdrawUSDS, repayUSDS, adjustChest, closeChest.

A successful execution triggers the _accrueActiveInterests method, which causes interest to be added to the underlying balance of every borrower in the market. Interest accrues for the current block, as well as each prior block in which the _accrueActiveInterests method was not triggered (no user interacted with the ChestManager contract). Interest compounds only during blocks in which one of the aforementioned methods is invoked.

Example of interest accrual:

  • Alice mints 10000 USDs from the Stablis protocol.

  • At the time of supply, the interestRate is 0.00000009504 % per second. (3% yearly)

  • No one interacts with the ChestManager contract for 100 seconds.

  • Subsequently, Bob borrows some USDs

  • Alice’s underlying debt is now 10,000.0009504 USDs (which is $0.000009504 times 100 seconds times the principal, plus the original 10,000 USDs).

  • Alice’s underlying USDs balance in subsequent blocks will have interest accrued based on the new value of 10,000.0009504 USDs instead of the initial 10,000 USDs.

Interest Rate Index and Borrowing Balance

Implementation

Each time a transaction occurs, the Interest Rate Index for the asset is updated to compound the interest since the prior index. This is done using the interest for the period, denominated by rt , calculated using a per-second interest rate. The formula for this is:

activeInterestIndexc,n=activeInterestIndexc,(n1)×(1+r×t)activeInterestIndex_{c,n} = activeInterestIndex_{c,(n-1)} \times (1 + r \times t)

In this formula:

  • activeInterestIndexc,nactiveInterestIndex_{c,n} represents the Interest Rate Index for collateral type cc

    at time nn

  • rr represents the per-second interest rate

  • tt represents the time period since the last index update

The market's total borrowing outstanding is also updated to include the interest accrued since the last index. The formula for this update is:

totalDebtc,n=totalDebtc,(n1)(1+rt)totalDebt _{c,n} ​ =totalDebt_{c,(n−1)} ∗(1+r∗t)

In this formula:

  • totalDebtc,ntotalDebt_{c,n}​ represents the total debt balance for collateral type cc at time nn

Each individual chest tracks the activeInterestIndex at the time of its last debt change.

The current chest debt at any time is then:

currentChestDebt=Chest.debtactiveInterestIndexChest.activeInterestIndexcurrentChestDebt= \frac{Chest.debt * activeInterestIndex}{Chest.activeInterestIndex}

Limitations

When calculating interest in _accrueActiveInterests simple interest is applied over the seconds since the last update. This will underestimate the amount of interest that would be calculated if it were compounded every second.

The code is designed to accrue interest as frequently as possible. Additionally, the size of the discrepancy between the computed and theoretical interest will depend on the volume of transactions being handled by the Stablis protocol, which may change unpredictably.

Last updated