📜
SRWA Docs
SRWA.ioDemo Application
  • Intro
    • 🥳Welcome!
    • 🔥What's new?
    • 💰Lending
    • 📑RWA Vaulting
    • ✅SRWA Validator
    • 🏅Recognition
    • 🪙SRWA Token - $RWA
  • Products
    • SRWA Lending
      • Core Principles
      • Solution Architecture
      • User Badge
      • Web Application
        • Lending
        • Deposit & Withdraw
        • Borrow & Repay
        • Market
        • Wallet
        • Transactions
      • Lending Protocol
        • Protocol Operation
        • APY Calculation
          • Interest per Epoch
          • Account Position Calculations
        • Liquidations
          • Liquidation Function
          • Regular Liquidation
          • Insolvency Liquidation
          • Micro Liquidation
      • Vaults
        • Pool Params
      • Radix API / Gateway
      • Oracle
      • Risk management
      • Additional Considerations
      • Protocol Incentives
      • Security Audits
      • Release Candidate Config
        • Pool XRD
        • Pool xUSDC
    • SRWA Vaulting
  • Projects
    • 🏗️Ploughshare
  • General Information
    • ☎️Contact
Powered by GitBook
On this page
  • Total Deposit
  • Pool Loan to Value
  • Max Loan Limit
  • Loan Balance
  • Loan Limit Used
  • Net APY
  • Daily

Was this helpful?

  1. Products
  2. SRWA Lending
  3. Lending Protocol
  4. APY Calculation

Account Position Calculations

PreviousInterest per EpochNextLiquidations

Last updated 1 year ago

Was this helpful?

It is worth noting that multiple pools should be taken into consideration.

Based on the implemented Logic for each of the enabled Pools, the account has a unique position:

  • Total deposit balance,

  • Max loan limit,

  • Loan balance,

  • Loan limit used,

  • NetAPY,

  • Daily.

Total Deposit

Represents a sum of user deposit balances across all pools, denominated in USD.

user.total_deposit = SUM p=1..n ( deposit_balance[p] * asset_price[p] )

Pool Loan to Value

Each Pool has a unique Loan to Value (“LTV”) defining how much of deposited funds are accounted as provided collateral. For example, when LTV is 0.8, it means that for each $100 USD deposited, the max loan limit is $80 USD.

Max Loan Limit

The Max Loan Limit represents the value which could be borrowed against all provided collateral.

user.max_loan_limit = SUM p=1..n ( deposit_balance[p] * ltv_ratio[p] * asset_price[p] )

Notice the asset_price is set in USD for a given asset.

Loan Balance

The Loan Balance is a sum of all borrowed assets' values across all available pools.

user.loan_balance = SUM p=1..n ( borrow_balance[p] * asset_price[p] )

Loan Limit Used

The Loan Limit Used represents the ratio between the Loan Balance and Max Loan Limit. The expected value is in the 0-1 range.

user.loan_limit_used = loan_balance / max_loan_limit 

Net APY

NetAPY represents the net user interests within the protocol, including all deposited and borrowed assets. It is a decimal representation used only in front-end calculations and does not affect the protocol.

NetAPY = { SUM p=1..n ( deposit_balance[p] * deposit_rate[p] -
- borrow_balance[p] * borrow_rate[p] ) * asset_price[p] } 
/ 
{ SUM j=1..m ( deposit_balance[j] * asset_price[j] ) }

Daily

Daily results represent the NetAPY, denominated in USD, daily, for a given user. Like Net APY, It is used only for frontend purposes.

daily = total_deposit * NetAPY / 365