📝dynamic_calculator

Description: This module contains calculation functions used for determining user-specific and potential future state values in the Navi lending and borrowing project. It includes functions to calculate a user's health factor, collateral value, loan value, APY, and more, considering potential changes to a user's balances.

Use Cases: This module is used for risk management and user-interface purposes, such as determining whether a user's action will put their account at risk of liquidation, or providing the user with information about the potential impact of their intended action.

dynamic_health_factor

public fun dynamic_health_factor<CoinType>(
  clock: &Clock,
  storage: &mut Storage,
  oracle: &PriceOracle,
  pool: &mut Pool<CoinType>,
  user: address,
  asset: u8,
  estimate_supply_value: u64, 
  estimate_borrow_value: u64, 
  is_increase: bool
): u256 {}

dynamic_calculate_apy

public fun dynamic_calculate_apy<CoinType>(
  clock: &Clock, 
  storage: &mut Storage, 
  pool: &mut Pool<CoinType>, 
  asset: u8, 
  estimate_supply_value: u64, 
  estimate_borrow_value: u64, 
  is_increase: bool
): (u256, u256){}

Last updated