Interests
Interest is the reward paid for providing liquidity in a SRWA Lending Protocol, or the amount that is paid when taking out the loan. much like traditional interest earned on a bank deposit or loan. With every protocol interaction, interests are calculated so the user and the platform states can be updated accordingly.
There are three types of interests that are being calculated:
Borrow interest:
borrow_interest = total_pool_borrow * borrow_apr
Deposit interest:
deposit_interest = borrow_interest - reserve_interest
Reserve interest
reserve_interest = borrow_interest * reserve_factor
User states will be updated on every interaction with the protocol, for the deposit and withdraw actions, SD Token balance will be updated with the accrued interest, for the borrow and repay actions, SB Token balance will be updated with the accrued interest.