pub fn compute_total_value(
    env: &Env,
    deps: Deps,
    info: &PoolInfoRaw,
) -> StdResult<(Uint128, Uint128, Uint128)> {
    let state = STATE.load(deps.storage)?;
    let stable_info = info.asset_infos[0].to_normal(deps.api)?;
    let stable_denom = match stable_info {
        AssetInfo::Token { .. } => String::default(),
        AssetInfo::NativeToken { denom } => denom,
    };
    let stable_amount = query_balance(&deps.querier, info.contract_addr.clone(), stable_denom)?;

    let aust_info = info.asset_infos[1].to_normal(deps.api)?;
    let aust_amount = aust_info.query_pool(&deps.querier, deps.api, info.contract_addr.clone())?;
    let aust_exchange_rate = query_aust_exchange_rate(
        env.clone(),
        deps,
        state.anchor_money_market_address.to_string(),
    )?;
    let aust_value_in_ust = aust_exchange_rate * aust_amount;

    let total_deposits_in_ust = stable_amount + aust_value_in_ust;
    Ok((total_deposits_in_ust, stable_amount, aust_value_in_ust))
}
/// compute total value of deposits in UST and return a tuple with those values.
/// (total, stable, aust)
compute total value of deposits in UST and return a tuple with those values.
(total, stable, aust)
compute total value of deposits in UST and return a tuple with those values . ( total stable aust )
pub fn compute_total_value(
    env: &Env,
    deps: Deps,
    info: &PoolInfoRaw,
) -> StdResult<(Uint128, Uint128, Uint128)> {
    let state = STATE.load(deps.storage)?;
    let stable_info = info.asset_infos[0].to_normal(deps.api)?;
    let stable_denom = match stable_info {
        AssetInfo::Token { .. } => String::default(),
        AssetInfo::NativeToken { denom } => denom,
    };
    let stable_amount = query_balance(&deps.querier, info.contract_addr.clone(), stable_denom)?;
    let aust_info = info.asset_infos[1].to_normal(deps.api)?;
    let aust_amount = aust_info.query_pool(&deps.querier, deps.api, info.contract_addr.clone())?;
    let aust_exchange_rate = query_aust_exchange_rate(
        env.clone(),
        deps,
        state.anchor_money_market_address.to_string(),
    )?;
    let aust_value_in_ust = aust_exchange_rate * aust_amount;
    let total_deposits_in_ust = stable_amount + aust_value_in_ust;
    Ok((total_deposits_in_ust, stable_amount, aust_value_in_ust))
}
pub fn compute_total_value ( env : & Env , deps : Deps , info : & PoolInfoRaw , ) -> StdResult < ( Uint128 , Uint128 , Uint128 ) > { let state = STATE . load ( deps . storage ) ? ; let stable_info = info . asset_infos [ 0 ] . to_normal ( deps . api ) ? ; let stable_denom = match stable_info { AssetInfo :: Token { .. } => String :: default ( ) , AssetInfo :: NativeToken { denom } => denom , } ; let stable_amount = query_balance ( & deps . querier , info . contract_addr . clone ( ) , stable_denom ) ? ; let aust_info = info . asset_infos [ 1 ] . to_normal ( deps . api ) ? ; let aust_amount = aust_info . query_pool ( & deps . querier , deps . api , info . contract_addr . clone ( ) ) ? ; let aust_exchange_rate = query_aust_exchange_rate ( env . clone ( ) , deps , state . anchor_money_market_address . to_string ( ) , ) ? ; let aust_value_in_ust = aust_exchange_rate * aust_amount ; let total_deposits_in_ust = stable_amount + aust_value_in_ust ; Ok ( ( total_deposits_in_ust , stable_amount , aust_value_in_ust ) ) }
compute total value of deposits in UST and return a tuple with those values.
compute total value of deposits in UST and return a tuple with those values .
env
&Env
deps
Deps
info
&PoolInfoRaw
env
&Env
deps
Deps
info
&PoolInfoRaw