Getting Vault Information
This page describes methods for retrieving information about HYSP vaults, including balances, fees, and liquidity.
Get Instant Redeem Liquidity
getInstantRedeemLiquidityAmount(outTokenAddress?)
: Retrieves the liquidity available for instant redemption in the redemption vault contract.
ts
import { HYSP } from "@everstake/wallet-sdk-hysp";
const hysp = new HYSP();
await hysp.init("eth_mainnet", "mmev");
const usdcAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48";
const liquidity = await hysp.getInstantRedeemLiquidityAmount(usdcAddress);
console.log("Available liquidity:", liquidity.toString());
Get Minimum Redeem Amount
minRedeemAmount(outTokenAddress?)
: Retrieves the minimum redeem amount from the redemption vault contract.
ts
const minAmount = await hysp.minRedeemAmount(usdcAddress);
console.log("Minimum redeem amount:", minAmount.toString());
Get Instant Deposit Fee
getInstantDepositFee()
: Retrieves the instant deposit fee from the issuance vault contract.
ts
const depositFee = await hysp.getInstantDepositFee();
console.log("Instant deposit fee:", depositFee, "%");
Get Instant Redeem Fee
getInstantRedeemFee()
: Retrieves the instant redeem fee from the redemption vault contract.
ts
const redeemFee = await hysp.getInstantRedeemFee();
console.log("Instant redeem fee:", redeemFee, "%");
Get Oracle Price
getPrice()
: Retrieves the price from the oracle contract.
ts
const price = await hysp.getPrice();
console.log("Oracle price:", price.toString());
Get Token Balance
balanceOf(address, erc20contractAddress?)
: Retrieves the balance of ERC20 token associated with vault or collateral token.
ts
const walletAddress = "0x...";
// Get USDC balance
const usdcBalance = await hysp.balanceOf(walletAddress, usdcAddress);
console.log("USDC balance:", usdcBalance.toString());
// Get collateral token balance (default)
const collateralBalance = await hysp.balanceOf(walletAddress);
console.log("Collateral balance:", collateralBalance.toString());