Rhea Finance
  • Introduction
  • RHEA Finance White Paper
  • Genesis
  • Tokenomics
  • Governance
  • Community
  • Team
  • Getting Started
    • Setup Wallet
    • Using the Rainbow Bridge
    • Using the Platform
    • Buy REF Token
    • Staying Safe
  • RHEA Finance
    • Overview
      • Auto Router
      • Multi-chain Router
      • Pooling
      • Staking
      • RHEA V2 & DCL Pools
      • Aggregator Bridge
    • Guides
      • Lending & Borrowing
        • Audits & Risks
        • Supplying
        • Borrowing
        • APY
        • Health Factor
        • LP as Collateral
        • How Lending & Borrowing works
          • Health Factor
          • Interest Rate Model
          • Liquidations
          • Oracle
        • Step by Step Guide
      • Trade
        • Swap
        • Limit Orders
      • Liquidity Management
        • Classic Pools
        • Stable & Rated Pools
        • RHEA v2 Pools
      • Farming
      • Staking
      • Aggregator Bridge
      • RHEA Point System
  • SECURITY
    • Contracts
    • Guardians
    • Oracles
    • Audits
    • Bug Bounty
  • DEVELOPERS
    • CLI Trading
    • CLI Farming
    • RHEA SDK
  • SUPPORT
    • FAQ
    • Help
Powered by GitBook
On this page
  • Introduction
  • Computation
  • Example

Was this helpful?

  1. RHEA Finance
  2. Guides
  3. Lending & Borrowing

Health Factor

Introduction

Users can borrow against their supplied assets. All positions must be over-collateralized. The risk of a position can be understood through the Health Factor, which represents the combined collateral ratios of the borrowed assets.

Computation

The Health Factor is computed per account instead of per asset.

Each asset has a configuration value collateral_factor which indicates the expected price stability factor.

The higher the factor, the higher expectation of the stability of the price of the corresponding asset.

To compute the current health factor for the account, we need to know the current prices of all collateral and borrowed assets.

Firstly, we compute the adjusted sums of all collateral assets and borrowed assets.

adjusted_collateral_sum = sum(collateral_i * price_i * collateral_factor_i) adjusted_borrowed_sum = sum(borrowed_i * price_i / collateral_factor_i)

Now we can compute the health factor:

health_factor = adjusted_collateral_sum / adjusted_borrowed_sum

If the health factor is higher than 100%, it means the account is in a good state and can't be liquidated.

If the health factor is less than 100%, it means the account can be partially liquidated and can't borrow more without repaying some amount of the existing assets or providing more collateral assets.

In the Lending & Borrowing smart contracts, collateral_factor is also named volatility_ratio

Example

Account alice.near supplied to collateral 1000 wNEAR and borrowed 4000 nDAI.

Let's say (note: the numbers are hypothetical for illustration purposes only):

  • the price of wNEAR is 10

  • the price of the nDAI is 1

  • the collateral_factor of wNEAR is 0.5

  • the collateral_factor of nDAI is 1

The health factor of alice.near is the following:

  • adjusted_collateral_sum = sum(1000 * 10 * 0.5) = 5000

  • adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000

  • health_factor = 5000 / 4000 = 125%

PreviousAPYNextLP as Collateral

Last updated 27 days ago

Was this helpful?