Byzantine Finance
Website - Home🖥️ For Developers
  • 👋Introduction
    • What is Byzantine Finance?
      • Permissionless strategy vaults
      • Strategy layer & infrastructure layer - Explain Like I'm 5
      • Architecture Overview
    • Explanation of terms
    • Restaking explained
  • Media kit
  • 🔑Byzantine Vaults
    • What are Byzantine vaults?
    • Features of Native Vaults
      • Byzantine Oracle
      • Best practices for Validator Managers
    • Types of Native Vaults
      • Solo Staker Vaults
      • Partner Validated Vaults
      • Distributed Validator Vaults
  • ↔️Vault Interaction
    • Deposit
      • Deposit to ERC20 Vaults
      • Deposit to Native Vaults
    • Withdraw
      • Withdraw from ERC20 Vaults
      • Withdraw from Native Vaults
    • Claim Rewards
      • Restaking Rewards
        • EigenLayer Rewards
        • Symbiotic Rewards
  • 🎛️Vault Creation
    • Overview
      • Vault Configuration Guide
      • Vault Parameters
        • Byzantine Vault Parameters
        • Native Vault Parameters
        • EigenLayer Parameters
        • Symbiotic Parameters
      • Roles
    • Single Protocol Vaults
      • EigenLayer Vault
        • Eigen ERC20 Vault
        • Eigen Native Vault
      • Symbiotic Vault
        • Sym ERC20 Vault
        • Sym Native Vault
    • Cross Protocol Vaults
      • Eigen Layer / Symbiotic ERC20 Vault
  • 🤖Curation
    • Overview
    • Curator Related Roles
    • Vault Management
    • Strategy Management
      • EigenLayer Strategy
      • Symbiotic Strategy
      • Cross Protocol Vault
    • Curation Fee Management
  • 🌐Node operators
    • Operators in the Byzantine ecosystem
    • Register as a Staking Operator
    • Staking
    • Restaking Operator
      • Symbiotic
      • EigenLayer
      • Allocation to existing Restaking Operators
      • Creation of on-demand Restaking Operators
  • Claiming DV operator fees
Powered by GitBook
On this page
  1. Vault Interaction
  2. Deposit

Deposit to ERC20 Vaults

PreviousDepositNextDeposit to Native Vaults

Last updated 3 days ago

This section explains how to deposit ERC20 tokens into any Byzantine ERC20-compatible vault, including SymByzVaults and EigenByzVaults.

Step-by-Step Process

1. Approve Token Transfer

Before depositing, the user must approve the vault to transfer tokens on their behalf:

token.approve(address(vault), amount);

2. Call deposit()

Use the following function to deposit ERC20 tokens into the vault:

function deposit(
    uint256 assets,         
    address receiver    
) external returns (uint256 shares);
  • assets: the amount of ERC20 tokens to deposit.

  • receiver: the address that will receive the newly minted vault shares.

The function returns the number of shares minted for the receiver, which represent a proportional claim on the vault’s assets.

Choose the method that best suits your setup to deposit in a vault:

const VAULT_ADDRESS = "0x40aba78dbb81dbef26d892b6bef4e5fc23736bf5";

// Deposit 0.2 wstETH
await client.depositToVault(VAULT_ADDRESS, 200000000000000000);
const receipt = await tx.wait();
console.log("Deposit hash:", receipt.hash);
  1. Go to the page of your vault

Example:

  1. Enter the amount you want to deposit

The app will automatically calculate and display the number of shares (Vaultshare) you'll receive.

  1. Approve & Deposit

Click the "Approve & Deposit" button. This will trigger two wallet confirmations:

  • One for the token approval

  • One for the actual deposit transaction

  1. Check your new balances.

After the transaction:

  • Your vault balance will increase

  • Your wallet balance will decrease accordingly Shares (Vaultshare) are minted and can be withdrawn at any time

3. Important Considerations

  • If the vault is permissioned (isPrivateVault = true), the caller must be whitelisted.

  • If a deposit limit is enabled (isDepositLimit = true), the total deposits must remain within the configured limit.

  • The vault uses the convertToShares() function to determine how many shares are minted.

Choose the method that best suits your setup to read those datas:

const VAULT_ADDRESS = "0x40aba78dbb81dbef26d892b6bef4e5fc23736bf5";

const isPrivate = await client.isVaultPrivate(VAULT_ADDRESS);
const isAddressWhitelisted = await client.isAddressWhitelisted(VAULT_ADDRESS, address);
const isThereALimit = await client.isDepositLimitEnabled(VAULT_ADDRESS);
const whatIsTheLimit = await client.getVaultDepositLimit(VAULT_ADDRESS);
  1. Get if the vault is private

  2. If you are connected and not whitelisted, you won't be able to deposit in the vault.

  3. The vault limit is defined here. If the limits are disabled, we'll write "No limit".

↔️
https://app.byzantine.fi/vault/0x40aba78dbb81dbef26d892b6bef4e5fc23736bf5