fn after_successful_trade_callback(deps: DepsMut, env: Env) -> VaultResult {
    let state = STATE.load(deps.storage)?;
    let stable_denom = ARB_BASE_ASSET.load(deps.storage)?.get_denom()?;
    let stables_in_contract =
        query_balance(&deps.querier, env.contract.address, stable_denom.clone())?;

    // Send asset back to vault
    let repay_asset = Asset {
        info: AssetInfo::NativeToken {
            denom: stable_denom,
        },
        amount: stables_in_contract,
    };

    Ok(Response::new().add_message(CosmosMsg::Bank(BankMsg::Send {
        to_address: state.vault_address.to_string(),
        amount: vec![repay_asset.deduct_tax(&deps.querier)?],
    })))
}
// After the arb this function returns the funds to the vault.
After the arb this function returns the funds to the vault.
After the arb this function returns the funds to the vault .
fn after_successful_trade_callback(deps: DepsMut, env: Env) -> VaultResult {
    let state = STATE.load(deps.storage)?;
    let stable_denom = ARB_BASE_ASSET.load(deps.storage)?.get_denom()?;
    let stables_in_contract =
        query_balance(&deps.querier, env.contract.address, stable_denom.clone())?;
    // Send asset back to vault
    let repay_asset = Asset {
        info: AssetInfo::NativeToken {
            denom: stable_denom,
        },
        amount: stables_in_contract,
    };
    Ok(Response::new().add_message(CosmosMsg::Bank(BankMsg::Send {
        to_address: state.vault_address.to_string(),
        amount: vec![repay_asset.deduct_tax(&deps.querier)?],
    })))
}
fn after_successful_trade_callback ( deps : DepsMut , env : Env ) -> VaultResult { let state = STATE . load ( deps . storage ) ? ; let stable_denom = ARB_BASE_ASSET . load ( deps . storage ) ? . get_denom ( ) ? ; let stables_in_contract = query_balance ( & deps . querier , env . contract . address , stable_denom . clone ( ) ) ? ; // Send asset back to vault let repay_asset = Asset { info : AssetInfo :: NativeToken { denom : stable_denom , } , amount : stables_in_contract , } ; Ok ( Response :: new ( ) . add_message ( CosmosMsg :: Bank ( BankMsg :: Send { to_address : state . vault_address . to_string ( ) , amount : vec ! [ repay_asset deduct_tax ( deps querier ) ] , } ) ) ) }
After the arb this function returns the funds to the vault.
After the arb this function returns the funds to the vault .
deps
DepsMut
env
Env
deps
DepsMut
env
Env