Derby Finance Docs
  • Introduction
  • Products
    • Vaults
      • User interactions
        • Deposit
        • Withdraw
        • Relevant view functions
      • Deployed vaults
        • USDC_Low_Risk
      • Cross-chain implementation
      • Rebalancing
      • Gas efficiency
      • Currency swapping
      • Automatic yield harvesting
  • Game
    • User interactions
      • Mint new basket
      • Rebalance basket
      • Redeem rewards
      • Basket allocated tokens
      • Basket allocations in protocol
      • Basket redeemed rewards
      • Basket unredeemed rewards
    • DeFi yield optimization
    • The game
    • Formulas
    • Decentralized reputation
    • NFTs as user profiles
    • Delegation
  • Developers
    • Architecture
      • Single chain
      • Cross-chain
      • Other important flows
    • Contract overview
    • Deployed contract addresses
    • Security
  • DAO
    • Governance
    • The DRB token
    • Adding a new vault
    • Adding new protocols to an existing vault
    • Important parameters
    • Keeper
    • Guardian
  • Roadmap
    • Roadmap
Powered by GitBook
On this page
  1. Products
  2. Vaults
  3. User interactions

Relevant view functions

There are a few view functions that can be useful to the user.

function getVaultBalance() public virtual view returns(uint256)

Gives the balance of the vault (all deposits - withdrawals + liquidityPerc). The balance is the maximum what a user can withdraw without pulling funds from the underlying protocols.

savedTotalUnderlying()

The total amount of funds in the underlying protocols. Together with the balanceOf() this defines the maximum what a user can withdraw when also pulling from the underlying protocols. If a user wishes to withdraw more it should do so via a withdrawalRequest.

exchangeRate()

Defines the exchangeRate in vaultCurrency per LP token in the scale of the vaultCurrency. For example USDC/LPtoken with 6 decimals of scale (like USDC).

PreviousWithdrawNextDeployed vaults

Last updated 2 years ago