pub fn loan_to_value(
        &self,
        collateral_exchange_rate: CollateralExchangeRate,
        borrow_token_price: Decimal,
    ) -> Result<Decimal, ProgramError> {
        let loan = self.borrowed_liquidity_wads;
        let collateral_value = collateral_exchange_rate
            .decimal_collateral_to_liquidity(self.deposited_collateral_tokens.into())?
            .try_div(borrow_token_price)?;
        loan.try_div(collateral_value)
    }
/// Ratio of loan balance to collateral value
Ratio of loan balance to collateral value
Ratio of loan balance to collateral value
pub fn loan_to_value(
        &self,
        collateral_exchange_rate: CollateralExchangeRate,
        borrow_token_price: Decimal,
    ) -> Result<Decimal, ProgramError> {
        let loan = self.borrowed_liquidity_wads;
        let collateral_value = collateral_exchange_rate
            .decimal_collateral_to_liquidity(self.deposited_collateral_tokens.into())?
            .try_div(borrow_token_price)?;
        loan.try_div(collateral_value)
    }
pub fn loan_to_value ( & self , collateral_exchange_rate : CollateralExchangeRate , borrow_token_price : Decimal , ) -> Result < Decimal , ProgramError > { let loan = self . borrowed_liquidity_wads ; let collateral_value = collateral_exchange_rate . decimal_collateral_to_liquidity ( self . deposited_collateral_tokens . into ( ) ) ? . try_div ( borrow_token_price ) ? ; loan . try_div ( collateral_value ) }
Ratio of loan balance to collateral value
Ratio of loan balance to collateral value
&self
collateral_exchange_rate
CollateralExchangeRate
borrow_token_price
Decimal