Skip to main content

VaultAdmin

VaultAdmin

onlyGovernorOrStrategist

modifier onlyGovernorOrStrategist()

Verifies that the caller is the Governor or Strategist.

setPriceProvider

function setPriceProvider(address _priceProvider) external

Set address of price provider.

Parameters

NameTypeDescription
_priceProvideraddressAddress of price provider

setRedeemFeeBps

function setRedeemFeeBps(uint256 _redeemFeeBps) external

Set a fee in basis points to be charged for a redeem.

Parameters

NameTypeDescription
_redeemFeeBpsuint256Basis point fee to be charged

setVaultBuffer

function setVaultBuffer(uint256 _vaultBuffer) external

Set a buffer of assets to keep in the Vault to handle most redemptions without needing to spend gas unwinding assets from a Strategy.

Parameters

NameTypeDescription
_vaultBufferuint256Percentage using 18 decimals. 100% = 1e18.

setAutoAllocateThreshold

function setAutoAllocateThreshold(uint256 _threshold) external

Sets the minimum amount of OTokens in a mint to trigger an automatic allocation of funds afterwords.

Parameters

NameTypeDescription
_thresholduint256OToken amount with 18 fixed decimals.

setRebaseThreshold

function setRebaseThreshold(uint256 _threshold) external

Set a minimum amount of OTokens in a mint or redeem that triggers a rebase

Parameters

NameTypeDescription
_thresholduint256OToken amount with 18 fixed decimals.

setStrategistAddr

function setStrategistAddr(address _address) external

Set address of Strategist

Parameters

NameTypeDescription
_addressaddressAddress of Strategist

setAssetDefaultStrategy

function setAssetDefaultStrategy(address _asset, address _strategy) external

Set the default Strategy for an asset, i.e. the one which the asset will be automatically allocated to and withdrawn from

Parameters

NameTypeDescription
_assetaddressAddress of the asset
_strategyaddressAddress of the Strategy

setNetOusdMintForStrategyThreshold

function setNetOusdMintForStrategyThreshold(uint256 _threshold) external

Set maximum amount of OTokens that can at any point be minted and deployed to strategy (used only by ConvexOUSDMetaStrategy for now).

Parameters

NameTypeDescription
_thresholduint256OToken amount with 18 fixed decimals.

swapCollateral

function swapCollateral(address _fromAsset, address _toAsset, uint256 _fromAssetAmount, uint256 _minToAssetAmount, bytes _data) external returns (uint256 toAssetAmount)

Strategist swaps collateral assets sitting in the vault.

Parameters

NameTypeDescription
_fromAssetaddressThe token address of the asset being sold by the vault.
_toAssetaddressThe token address of the asset being purchased by the vault.
_fromAssetAmountuint256The amount of assets being sold by the vault.
_minToAssetAmountuint256The minimum amount of assets to be purchased.
_databytesimplementation specific data. eg 1Inch swap data

Return Values

NameTypeDescription
toAssetAmountuint256The amount of toAssets that was received from the swap

setSwapper

function setSwapper(address _swapperAddr) external

Set the contract the performs swaps of collateral assets.

Parameters

NameTypeDescription
_swapperAddraddressAddress of the Swapper contract that implements the ISwapper interface.

swapper

function swapper() external view returns (address swapper_)

Contract that swaps the vault's collateral assets

setSwapAllowedUndervalue

function setSwapAllowedUndervalue(uint16 _basis) external

Set max allowed percentage the vault total value can drop below the OToken total supply in basis points when executing collateral swaps.

Parameters

NameTypeDescription
_basisuint16Percentage in basis points. eg 100 == 1%

allowedSwapUndervalue

function allowedSwapUndervalue() external view returns (uint256 value)

Max allowed percentage the vault total value can drop below the OToken total supply in basis points when executing a collateral swap. For example 100 == 1%

Return Values

NameTypeDescription
valueuint256Percentage in basis points.

setOracleSlippage

function setOracleSlippage(address _asset, uint16 _allowedOracleSlippageBps) external

Set the allowed slippage from the Oracle price for collateral asset swaps.

Parameters

NameTypeDescription
_assetaddressAddress of the asset token.
_allowedOracleSlippageBpsuint16allowed slippage from Oracle in basis points. eg 20 = 0.2%. Max 10%.

supportAsset

function supportAsset(address _asset, uint8 _unitConversion) external

Add a supported asset to the contract, i.e. one that can be to mint OTokens.

Parameters

NameTypeDescription
_assetaddressAddress of asset
_unitConversionuint8

cacheDecimals

function cacheDecimals(address _asset) external

Cache decimals on OracleRouter for a particular asset. This action is required before that asset's price can be accessed.

Parameters

NameTypeDescription
_assetaddressAddress of asset token

approveStrategy

function approveStrategy(address _addr) external

Add a strategy to the Vault.

Parameters

NameTypeDescription
_addraddressAddress of the strategy to add

removeStrategy

function removeStrategy(address _addr) external

Remove a strategy from the Vault.

Parameters

NameTypeDescription
_addraddressAddress of the strategy to remove

depositToStrategy

function depositToStrategy(address _strategyToAddress, address[] _assets, uint256[] _amounts) external

Deposit multiple assets from the vault into the strategy.

Parameters

NameTypeDescription
_strategyToAddressaddressAddress of the Strategy to deposit assets into.
_assetsaddress[]Array of asset address that will be deposited into the strategy.
_amountsuint256[]Array of amounts of each corresponding asset to deposit.

_depositToStrategy

function _depositToStrategy(address _strategyToAddress, address[] _assets, uint256[] _amounts) internal

withdrawFromStrategy

function withdrawFromStrategy(address _strategyFromAddress, address[] _assets, uint256[] _amounts) external

Withdraw multiple assets from the strategy to the vault.

Parameters

NameTypeDescription
_strategyFromAddressaddressAddress of the Strategy to withdraw assets from.
_assetsaddress[]Array of asset address that will be withdrawn from the strategy.
_amountsuint256[]Array of amounts of each corresponding asset to withdraw.

_withdrawFromStrategy

function _withdrawFromStrategy(address _recipient, address _strategyFromAddress, address[] _assets, uint256[] _amounts) internal

Parameters

NameTypeDescription
_recipientaddresscan either be a strategy or the Vault
_strategyFromAddressaddress
_assetsaddress[]
_amountsuint256[]

setMaxSupplyDiff

function setMaxSupplyDiff(uint256 _maxSupplyDiff) external

Sets the maximum allowable difference between total supply and backing assets' value.

setTrusteeAddress

function setTrusteeAddress(address _address) external

Sets the trusteeAddress that can receive a portion of yield. Setting to the zero address disables this feature.

setTrusteeFeeBps

function setTrusteeFeeBps(uint256 _basis) external

Sets the TrusteeFeeBps to the percentage of yield that should be received in basis points.

setOusdMetaStrategy

function setOusdMetaStrategy(address _ousdMetaStrategy) external

Set OToken Metapool strategy

Parameters

NameTypeDescription
_ousdMetaStrategyaddressAddress of OToken metapool strategy

pauseRebase

function pauseRebase() external

Set the deposit paused flag to true to prevent rebasing.

unpauseRebase

function unpauseRebase() external

Set the deposit paused flag to true to allow rebasing.

pauseCapital

function pauseCapital() external

Set the deposit paused flag to true to prevent capital movement.

unpauseCapital

function unpauseCapital() external

Set the deposit paused flag to false to enable capital movement.

transferToken

function transferToken(address _asset, uint256 _amount) external

Transfer token to governor. Intended for recovering tokens stuck in contract, i.e. mistaken sends.

Parameters

NameTypeDescription
_assetaddressAddress for the asset
_amountuint256Amount of the asset to transfer

withdrawAllFromStrategy

function withdrawAllFromStrategy(address _strategyAddr) external

Withdraws all assets from the strategy and sends assets to the Vault.

Parameters

NameTypeDescription
_strategyAddraddressStrategy address.

withdrawAllFromStrategies

function withdrawAllFromStrategies() external

Withdraws all assets from all the strategies and sends assets to the Vault.

_cacheDecimals

function _cacheDecimals(address token) internal