AeraVaultV1
API Documentation for `AeraVaultV1.sol` contract
Risk-managed treasury vault.
Managed n-asset vault that supports withdrawals in line with a pre-defined validator contract.
Vault owner is the asset owner.
function acceptOwnership() external nonpayable
Accept ownership
function bVault() external view returns (contract IBVault)
Balancer Vault.
Returns
Name | Type | Description |
---|---|---|
_0 | contract IBVault | undefined |
function cancelOwnershipTransfer() external nonpayable
Cancel current pending ownership transfer
function cancelWeightUpdates() external nonpayable
Cancel the active weight update schedule.
Keep calculated weights from the schedule at the time.
function claimGuardianFees() external nonpayable
Claim guardian fee.
This function shouldn't be called too frequently.
function claimRewards(IBMerkleOrchard.Claim[] claims, contract IERC20[] tokens) external nonpayable
Claim Balancer rewards.
It calls claimDistributions() function of Balancer MerkleOrchard. Once this function is called, the tokens will be transferred to the Vault and it can be distributed via sweep function.
Parameters
Name | Type | Description |
---|---|---|
claims | IBMerkleOrchard.Claim[] | An array of claims provided as a claim struct. See https://docs.balancer.fi/products/merkle-orchard/claiming-tokens#claiming-from-the-contract-directly. |
tokens | contract IERC20[] | An array consisting of tokens to be claimed. |
function deposit(IProtocolAPI.TokenValue[] tokenWithAmount) external nonpayable
Deposit tokens into vault.
It calls updateWeights() function which cancels current active weights change schedule.
Parameters
Name | Type | Description |
---|---|---|
tokenWithAmount | IProtocolAPI.TokenValue[] | Deposit tokens with amount. |
function depositIfBalanceUnchanged(IProtocolAPI.TokenValue[] tokenWithAmount) external nonpayable
Deposit tokens into vault.
It calls updateWeights() function which cancels current active weights change schedule. It reverts if balances were updated in the current block.
Parameters
Name | Type | Description |
---|---|---|
tokenWithAmount | IProtocolAPI.TokenValue[] | Deposit token with amount. |
function description() external view returns (string)
Describes vault purpose and modelling assumptions for differentiating between vaults
string cannot be immutable bytecode but only set in constructor
Returns
Name | Type | Description |
---|---|---|
_0 | string | undefined |
function disableTrading() external nonpayable
Disable swap.
function enableTradingRiskingArbitrage() external nonpayable
Enable swap with current weights.
function enableTradingWithWeights(IProtocolAPI.TokenValue[] tokenWithWeight) external nonpayable
Enable swap with updating weights.
These are checked by Balancer in internal transactions: If weight length and token length match. If total sum of weights is one. If weight is greater than minimum.
Parameters
Name | Type | Description |
---|---|---|
tokenWithWeight | IProtocolAPI.TokenValue[] | Tokens with new weights. |
function finalize() external nonpayable
Destroy vault and returns all funds to treasury owner.
function finalized() external view returns (bool)
Indicates that the Vault has been finalized
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function getHoldings() external view returns (uint256[] amounts)
Underlying token balances.
Returns
Name | Type | Description |
---|---|---|
amounts | uint256[] | Token balances in underlying pool |
function getNormalizedWeights() external view returns (uint256[])
Get token weights.
Returns
Name | Type | Description |
---|---|---|
_0 | uint256[] | Normalized weights of tokens on Balancer pool. |
function getSwapFee() external view returns (uint256)
Get swap fee.
Divide by 10**18 for decimal representation
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | Swap fee from underlying Balancer pool. |
function getTokens() external view returns (contract IERC20[] tokens)
Get IERC20 Tokens Balancer Pool.
Returns
Name | Type | Description |
---|---|---|
tokens | contract IERC20[] | IERC20 tokens of Balancer pool. |
function getTokensData() external view returns (contract IERC20[], uint256[], uint256)
Get Token Data of Balancer Pool.
Returns
Name | Type | Description |
---|---|---|
_0 | contract IERC20[] | IERC20 tokens of Balancer pool. |
_1 | uint256[] | Balances of tokens of Balancer pool. |
_2 | uint256 | Last updated Blocknumber. |
function holding(uint256 index) external view returns (uint256)
Balance of token with given index.
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | Token balance in underlying pool. |
function initialDeposit(IProtocolAPI.TokenValue[] tokenWithAmount) external nonpayable
Initialize Vault with first deposit.
Initial deposit must be performed before calling withdraw() or deposit() functions. It enables trading, so weights and balances should be in line with market spot prices, otherwise there is a significant risk of arbitrage. This is checked by Balancer in internal transactions: If token amount is not zero when join pool.
Parameters
Name | Type | Description |
---|---|---|
tokenWithAmount | IProtocolAPI.TokenValue[] | Deposit tokens with amount. |
function initialized() external view returns (bool)
Indicates that the Vault has been initialized
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function initiateFinalization() external nonpayable
Initiate vault destruction and return all funds to treasury owner.
function isSwapEnabled() external view returns (bool)
Check if vault trading is enabled.
Returns
Name | Type | Description |
---|---|---|
_0 | bool | If public swap is turned on, returns true, otherwise false. |
function lastFeeCheckpoint() external view returns (uint256)
Last timestamp where guardian fee index was locked.
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function lastSwapFeeCheckpoint() external view returns (uint256)
Last timestamp where swap fee was updated.
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function managementFee() external view returns (uint256)
Management fee earned proportion per second.
10**18 is 100%
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function guardian() external view returns (address)
Controls vault parameters.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
function guardiansFee(address, uint256) external view returns (uint256)
Fee earned amount by current guardian and previous guardians.
Parameters
Name | Type | Description |
---|---|---|
_0 | address | undefined |
_1 | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function guardiansFeeTotal(uint256) external view returns (uint256)
Total guardian fee earned amount
Parameters
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function merkleOrchard() external view returns (contract IBMerkleOrchard)
Balancer Merkle Orchard.
Returns
Name | Type | Description |
---|---|---|
_0 | contract IBMerkleOrchard | undefined |
function noticePeriod() external view returns (uint256)
Notice period for vault termination (in seconds).
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function noticeTimeoutAt() external view returns (uint256)
Timestamp when notice elapses or 0 if not yet set
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function owner() external view returns (address)
Returns the address of the current owner.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
function pendingOwner() external view returns (address)
Pending account to accept ownership of vault.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
function pool() external view returns (contract IBManagedPool)
Balancer Managed Pool.
Returns
Name | Type | Description |
---|---|---|
_0 | contract IBManagedPool | undefined |
function poolController() external view returns (contract IBManagedPoolController)
Balancer Managed Pool Controller.
Returns
Name | Type | Description |
---|---|---|
_0 | contract IBManagedPoolController | undefined |
function poolId() external view returns (bytes32)
Pool ID of Balancer pool on Vault.
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
function renounceOwnership() external nonpayable
Disable ownership renounceable
function setGuardian(address newGuardian) external nonpayable
Change guardian.
Parameters
Name | Type | Description |
---|---|---|
newGuardian | address | undefined |
function setSwapFee(uint256 newSwapFee) external nonpayable
Change swap fee.
These are checked by Balancer in internal transactions: If new swap fee is less than maximum. If new swap fee is greater than minimum.
Parameters
Name | Type | Description |
---|---|---|
newSwapFee | uint256 | undefined |
function sweep(address token, uint256 amount) external nonpayable
Withdraw any tokens accidentally sent to vault.
Parameters
Name | Type | Description |
---|---|---|
token | address | undefined |
amount | uint256 | undefined |
function transferOwnership(address newOwner) external nonpayable
Offer ownership to another address
It disables immediate transfer of ownership
Parameters
Name | Type | Description |
---|---|---|
newOwner | address | undefined |
function updateWeightsGradually(IProtocolAPI.TokenValue[] tokenWithWeight, uint256 startTime, uint256 endTime) external nonpayable
Initiate weight move to target in given update window.
These are checked by Balancer in internal transactions: If target weight length and token length match. If total sum of target weights is one. If target weight is greater than minimum.
Parameters
Name | Type | Description |
---|---|---|
tokenWithWeight | IProtocolAPI.TokenValue[] | Tokens with target weights. |
startTime | uint256 | Timestamp at which weight movement should start. |
endTime | uint256 | Timestamp at which the weights should reach target values. |
function validator() external view returns (contract IWithdrawalValidator)
Verifies withdraw limits.
Returns
Name | Type | Description |
---|---|---|
_0 | contract IWithdrawalValidator | undefined |
function withdraw(IProtocolAPI.TokenValue[] tokenWithAmount) external nonpayable
Withdraw tokens up to requested amounts.
It calls updateWeights() function which cancels current active weights change schedule.
Parameters
Name | Type | Description |
---|---|---|
tokenWithAmount | IProtocolAPI.TokenValue[] | Requested tokens with amount. |
function withdrawIfBalanceUnchanged(IProtocolAPI.TokenValue[] tokenWithAmount) external nonpayable
Withdraw tokens up to requested amounts.
It calls updateWeights() function which cancels current active weights change schedule. It reverts if balances were updated in the current block.
Parameters
Name | Type | Description |
---|---|---|
tokenWithAmount | IProtocolAPI.TokenValue[] | Requested tokens with amount. |
event CancelWeightUpdates(uint256[] weights)
Emitted when cancelWeightUpdates is called.
Parameters
Name | Type | Description |
---|---|---|
weights | uint256[] | Current weights of tokens. |
event Created(address indexed factory, string name, string symbol, contract IERC20[] tokens, uint256[] weights, uint256 swapFeePercentage, address indexed guardian, address indexed validator, uint256 noticePeriod, uint256 managementFee, address merkleOrchard, string description)
Emitted when the vault is created.
Parameters
Name | Type | Description |
---|---|---|
factory indexed | address | Balancer Managed Pool factory address. |
name | string | Name of Pool Token. |
symbol | string | Symbol of Pool Token. |
tokens | contract IERC20[] | Token addresses. |
weights | uint256[] | Token weights. |
swapFeePercentage | uint256 | Pool swap fee. |
guardian indexed | address | Vault guardian address. |
validator indexed | address | Withdrawal validator contract address. |
noticePeriod | uint256 | Notice period (in seconds). |
managementFee | uint256 | Management fee earned proportion per second. |
merkleOrchard | address | Merkle Orchard address. |
description | string | Vault description. |
event Deposit(uint256[] requestedAmounts, uint256[] amounts, uint256[] weights)
Emitted when tokens are deposited.
Parameters
Name | Type | Description |
---|---|---|