The instantaneous interest rate being earned by depositors. This rate is expressed in annualized form, does not reflect the effects of compounding, and is inclusive of any protocol fees that may be in place. The rate changes as the utilization ratio of the deposited asset changes.
The instantaneous interest rate being paid by borrowers. This rate is expressed in annualized form, does not reflect the effects of compounding, and is inclusive of any protocol fees that may be in place. The rate changes as the utilization ratio of the borrowed asset changes.
The instantaneous interest rate being paid by borrowers. This rate is expressed in annualized form, does not reflect the effects of compounding, and is inclusive of any protocol fees that may be in place. The rate changes as the utilization ratio of the borrowed asset changes.
DepositNotebalance * depositNoteExchangeRate
LoanNotebalance * loanNoteExchangeRate
for (const r in reserves) {
borrowed += reserves[r].outstandingDebt.muln(reserves[r].price)?.tokens;
}
- CacheReserveInfo
- depositNoteExchangeRate: BN
- The value of the deposit note (unit: reserve tokens per note token)
- loanNoteExchangeRate: BN
- The value of the loan note (unit: reserve tokens per note token)
- minCollateralRatio: number
- The minimum allowable collateralization ratio for a loan on this reserve
- liquidationBonus: number
- The bonus awarded to liquidators when repaying a loan in exchange for a collateral asset.
- Reserve
- Liquidation Premium(ex: 3%)
- The bonus awarded to liquidators when repaying a loan in exchange for a collateral asset.
- Market Size(Reserve Size)
- (outstandingDebt + availableLiquidity) * price
- Utilisation Rate
- outstandingDebt / marketSize
- ReserveState
- outstandingDebt: BN
- Total Borrowed
- uncollectedFees: BN,
- totalDeposits: BN,
- totalDepositNotes: BN,
- totalLoanNotes: BN
- Obligation
- depositedValue: number,
- borrowedValue: number,
- colRatio: number,
- utilizationRate: number
- User’s position values
- depositBalance = depositNoteBalance * depositNoteExchangeRate
- loanBalance = loanNoteBalance * loanNoteExchangeRate
- collateralBalance = collateralNoteBalance(balance of collateraNotePubkey account) * depositNoteExchangeRate
- Deposited value = Sigma(collateralBalance * price)
- Borrowed value = Sigma(loanBalance * price)
- Maximum Withdraw amount = (Deposited Value – c_ratio * borrowedValue) / price
- (Or) collateralBalance
- Maximum Borrow Amount = Deposited value / c_ratio – borrowedValue
- If maxBorrowAmount > availableLiquidity, maxBorrowAmount = availableLiquidity
- Maximum Repay Amount = loanBalance or walletBalance