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
  • 0. Preview the Withdrawal
  • 1. Call withdraw() or redeem()
  • 2. Wait for the Withdrawal Delay
  • 3. Call completeWithdrawal()
  1. Vault Interaction
  2. Withdraw

Withdraw from ERC20 Vaults

This section outlines the operational steps for initiating and completing a withdrawal from an ERC20-based Byzantine Vault.

0. Preview the Withdrawal

Estimate how many shares are needed or what amount you’ll receive using:

function previewWithdraw(uint256 assets) external view returns (uint256 shares);
function previewRedeem(uint256 shares) external view returns (uint256 assets);

This step helps avoid errors and ensures correct share approvals.

1. Call withdraw() or redeem()

This function initiates the withdrawal and locks the shares in the vault while the protocol processes the request.

You can call 2 functions :

  • withdraw() is used when the user specifies the amount of assets they want to withdraw, and the contract calculates the corresponding number of shares to redeem.

  • redeem() is used when the user specifies the number of shares they want to redeem, and the contract calculates the amount of assets they will receive. In both cases, the function locks the shares in the vault while the protocol processes the request.

function withdraw(
    uint256 assets,
    address receiver,
    address owner
) external returns (uint256 shares);

function redeem(
    uint256 shares,
    address receiver,
    address owner
) external returns (uint256 assets);
  • assets / shares: Amount you wish to withdraw/redeem

  • receiver: Address to receive the tokens once the withdrawal is completed

  • owner: Owner of the vault shares

Shares are transferred from the owner to the vault but not burned at this stage.

const VAULT_ADDRESS = "0x40aba78dbb81dbef26d892b6bef4e5fc23736bf5";

// Withdraw 0.2 $wstETH
const withdrawTx = await client.withdrawFromVault(VAULT_ADDRESS, 200000000000000000); 

// Redeem 0.2 $byzShare
const redeemTx = await client.redeemSharesFromVault(VAULT_ADDRESS, 200000000000000000); 
  1. Go to the page of your vault

  1. Enter the amount you want to withdraw/redeem

Depending on the last div you edited, the button will change from Withdraw to Redeem, and call up the corresponding function.

  1. Go to the next step to see your withdrawals history.

This might take a few seconds to appear. Don't hesitate to refresh the page.

2. Wait for the Withdrawal Delay

Withdrawals require a waiting period, usually determined by the underlying restaking protocol. Slashing may occur during this time.

3. Call completeWithdrawal()

After the delay, finalize your withdrawal:

function completeWithdrawal(uint256 requestId) external;

This transfers the tokens to the receiver. The vault burns the shares at this point.

const VAULT_ADDRESS = "0x40aba78dbb81dbef26d892b6bef4e5fc23736bf5";
const REQUEST_ID = "0xBBB5C00413D3D0541A8B48189AA3652F4F3A2AAA820FD9ED044F9B83503F4A1B";

// Check if the requestId is claimable
const claimable = await client.isClaimable(VAULT_ADDRESS, REQUEST_ID);

// If yes, you can claim it
const tx = await client.completeWithdrawal(VAULT_ADDRESS, REQUEST_ID);
await tx.wait();
  1. Go to your vault page and open the “Withdrawals history” tab

You will see your pending withdrawal requests listed.

  1. Wait until the Time before claim is done. Once the Time before claim reaches 0, the status will update.

  2. Click on "Claim withdrawal"

The Pending button will change to Claim withdrawal, you can now click it to receive your tokens.

  1. See the updated status.

Once claimed, the status will display Already claimed along with the claim date.

PreviousWithdrawNextWithdraw from Native Vaults

Last updated 3 days ago

Example:

↔️
https://app.byzantine.fi/vault/0x40aba78dbb81dbef26d892b6bef4e5fc23736bf5
Last edit in the upper div
Last edit in the lower div