User Operations

Deposit Flow

Purpose: Deposit ERC20 assets into the vault to receive BrinkVault shares.

Steps:

  1. Check Allowance Ensure the vault has permission to transfer your tokens.

const allowance = await asset.allowance(userAddress, brinkVaultAddress);
  1. Approve the Vault (if needed) If allowance is lower than the amount you want to deposit:

await asset.approve(brinkVaultAddress, depositAmount);
  1. Deposit Tokens

Returns the number of shares minted.

await brinkVault.deposit(depositAmount, userAddress);
  1. View Balance

const shares = await brinkVault.balanceOf(userAddress);

Withdraw Flow

Purpose: Withdraw ERC20 assets by burning vault shares.

Steps:

or to redeem by shares:

View Functions

Function
Description

asset()

Returns the underlying ERC20 asset address.

totalAssets()

Returns total asset amount managed by the vault.

balanceOf(address)

Returns the user’s vault share balance.

convertToShares(assets)

Converts asset amount to equivalent shares.

convertToAssets(shares)

Converts shares back to equivalent asset amount.

previewDeposit(assets)

Estimates how many shares will be minted for a deposit.

previewWithdraw(assets)

Estimates how many shares will be burned for a withdrawal.

depositLimit()

Shows the maximum total assets allowed in the vault.

getBrinkVaultData()

Returns all configured strategies and their current weights.

getWhitelist()

Returns the current list of whitelisted strategies.

Last updated