Skip to content
You are reading the development version documentation and some displayed features may not be available in the stable release. You can switch to stable version using the version box at screen bottom.
Last update: October 8, 2021

VaultAPI

Functions

name

  function name(
  ) external returns (string)

symbol

  function symbol(
  ) external returns (string)

decimals

  function decimals(
  ) external returns (uint256)

apiVersion

  function apiVersion(
  ) external returns (string)

permit

  function permit(
  ) external returns (bool)

deposit

  function deposit(
  ) external returns (uint256)

deposit

  function deposit(
  ) external returns (uint256)

deposit

  function deposit(
  ) external returns (uint256)

withdraw

  function withdraw(
  ) external returns (uint256)

withdraw

  function withdraw(
  ) external returns (uint256)

withdraw

  function withdraw(
  ) external returns (uint256)

token

  function token(
  ) external returns (address)

strategies

  function strategies(
  ) external returns (struct StrategyParams)

pricePerShare

  function pricePerShare(
  ) external returns (uint256)

totalAssets

  function totalAssets(
  ) external returns (uint256)

depositLimit

  function depositLimit(
  ) external returns (uint256)

maxAvailableShares

  function maxAvailableShares(
  ) external returns (uint256)

creditAvailable

  function creditAvailable(
  ) external returns (uint256)
View how much the Vault would increase this Strategy’s borrow limit, based on its present performance (since its last report). Can be used to determine expectedReturn in your Strategy.

debtOutstanding

  function debtOutstanding(
  ) external returns (uint256)
View how much the Vault would like to pull back from the Strategy, based on its present performance (since its last report). Can be used to determine expectedReturn in your Strategy.

expectedReturn

  function expectedReturn(
  ) external returns (uint256)
View how much the Vault expect this Strategy to return at the current block, based on its present performance (since its last report). Can be used to determine expectedReturn in your Strategy.

report

  function report(
  ) external returns (uint256)
This is the main contact point where the Strategy interacts with the Vault. It is critical that this call is handled as intended by the Strategy. Therefore, this function will be called by BaseStrategy to make sure the integration is correct.

revokeStrategy

  function revokeStrategy(
  ) external
This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into “Emergency Exit” mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered “critical” that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency.

governance

  function governance(
  ) external returns (address)
View the governance address of the Vault to assert privileged functions can only be called by governance. The Strategy serves the Vault, so it is subject to governance defined by the Vault.

management

  function management(
  ) external returns (address)
View the management address of the Vault to assert privileged functions can only be called by management. The Strategy serves the Vault, so it is subject to management defined by the Vault.

guardian

  function guardian(
  ) external returns (address)
View the guardian address of the Vault to assert privileged functions can only be called by guardian. The Strategy serves the Vault, so it is subject to guardian defined by the Vault.

Questions or feedback? You can discuss issues and obtain free support on Yearn Vaults chat channel.
For SushiSwap community support, join the Discord Server None