pub fn collateral_to_obligation_token_amount(
        &self,
        collateral_amount: u64,
        obligation_token_supply: u64,
    ) -> Result<u64, ProgramError> {
        let withdraw_pct =
            Decimal::from(collateral_amount).try_div(self.deposited_collateral_tokens)?;
        let token_amount: Decimal = withdraw_pct.try_mul(obligation_token_supply)?;
        token_amount.try_floor_u64()
    }
/// Amount of obligation tokens for given collateral
Amount of obligation tokens for given collateral
Amount of obligation tokens for given collateral
pub fn collateral_to_obligation_token_amount(
        &self,
        collateral_amount: u64,
        obligation_token_supply: u64,
    ) -> Result<u64, ProgramError> {
        let withdraw_pct =
            Decimal::from(collateral_amount).try_div(self.deposited_collateral_tokens)?;
        let token_amount: Decimal = withdraw_pct.try_mul(obligation_token_supply)?;
        token_amount.try_floor_u64()
    }
pub fn collateral_to_obligation_token_amount ( & self , collateral_amount : u64 , obligation_token_supply : u64 , ) -> Result < u64 , ProgramError > { let withdraw_pct = Decimal :: from ( collateral_amount ) . try_div ( self . deposited_collateral_tokens ) ? ; let token_amount : Decimal = withdraw_pct . try_mul ( obligation_token_supply ) ? ; token_amount . try_floor_u64 ( ) }
Amount of obligation tokens for given collateral
Amount of obligation tokens for given collateral
&self
collateral_amount
u64
obligation_token_supply
u64