AeraVaultV1
API Documentation for `AeraVaultV1.sol` contract
AeraVaultV1
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.
Methods
acceptOwnership
Accept ownership
bVault
Balancer Vault.
Returns
cancelOwnershipTransfer
Cancel current pending ownership transfer
cancelWeightUpdates
Cancel the active weight update schedule.
Keep calculated weights from the schedule at the time.
claimGuardianFees
Claim guardian fee.
This function shouldn't be called too frequently.
claimRewards
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
deposit
Deposit tokens into vault.
It calls updateWeights() function which cancels current active weights change schedule.
Parameters
depositIfBalanceUnchanged
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
description
Describes vault purpose and modelling assumptions for differentiating between vaults
string cannot be immutable bytecode but only set in constructor
Returns
disableTrading
Disable swap.
enableTradingRiskingArbitrage
Enable swap with current weights.
enableTradingWithWeights
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
finalize
Destroy vault and returns all funds to treasury owner.
finalized
Indicates that the Vault has been finalized
Returns
getHoldings
Underlying token balances.
Returns
getNormalizedWeights
Get token weights.
Returns
getSwapFee
Get swap fee.
Divide by 10**18 for decimal representation
Returns
getTokens
Get IERC20 Tokens Balancer Pool.
Returns
getTokensData
Get Token Data of Balancer Pool.
Returns
holding
Balance of token with given index.
Parameters
Returns
initialDeposit
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
initialized
Indicates that the Vault has been initialized
Returns
initiateFinalization
Initiate vault destruction and return all funds to treasury owner.
isSwapEnabled
Check if vault trading is enabled.
Returns
lastFeeCheckpoint
Last timestamp where guardian fee index was locked.
Returns
lastSwapFeeCheckpoint
Last timestamp where swap fee was updated.
Returns
managementFee
Management fee earned proportion per second.
10**18 is 100%
Returns
guardian
Controls vault parameters.
Returns
guardianFee
Fee earned amount by current guardian and previous guardians.
Parameters
Returns
guardiansFeeTotal
Total guardian fee earned amount
Parameters
Returns
merkleOrchard
Balancer Merkle Orchard.
Returns
noticePeriod
Notice period for vault termination (in seconds).
Returns
noticeTimeoutAt
Timestamp when notice elapses or 0 if not yet set
Returns
owner
Returns the address of the current owner.
Returns
pendingOwner
Pending account to accept ownership of vault.
Returns
pool
Balancer Managed Pool.
Returns
poolController
Balancer Managed Pool Controller.
Returns
poolId
Pool ID of Balancer pool on Vault.
Returns
renounceOwnership
Disable ownership renounceable
setGuardian
Change guardian.
Parameters
setSwapFee
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
sweep
Withdraw any tokens accidentally sent to vault.
Parameters
transferOwnership
Offer ownership to another address
It disables immediate transfer of ownership
Parameters
updateWeightsGradually
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
validator
Verifies withdraw limits.
Returns
withdraw
Withdraw tokens up to requested amounts.
It calls updateWeights() function which cancels current active weights change schedule.
Parameters
withdrawIfBalanceUnchanged
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
Events
CancelWeightUpdates
Emitted when cancelWeightUpdates is called.
Parameters
Created
Emitted when the vault is created.
Parameters
Deposit
Emitted when tokens are deposited.
Parameters
DistributeGuardianFees
Emitted when management fees are withdrawn.
Parameters
EnabledTradingWithWeights
Emitted when enableTradingWithWeights is called.
Parameters
FinalizationInitiated
Emitted when initiateFinalization is called.
Parameters
Finalized
Emitted when vault is finalized.
Parameters
GuardianChanged
Emitted when guardian is changed.
Parameters
OwnershipTransferCanceled
Emitted when cancelOwnershipTransfer is called.
Parameters
OwnershipTransferOffered
Emitted when transferOwnership is called.
Parameters
OwnershipTransferred
Parameters
SetSwapEnabled
Emitted when swap is enabled/disabled.
Parameters
SetSwapFee
Emitted when swap fee is updated.
Parameters
UpdateWeightsGradually
Emitted when updateWeightsGradually is called.
Parameters
Withdraw
Emitted when tokens are withdrawn.
Parameters
Errors
Aera__AmountExceedAvailable
Parameters
Aera__AmountIsBelowMin
Parameters
Aera__BalanceChangedInCurrentBlock
Aera__CallerIsNotGuardian
Aera__CallerIsNotOwnerOrGuardian
Aera__CannotSetSwapFeeBeforeCooldown
Aera__CannotSweepPoolToken
Aera__DescriptionIsEmpty
Aera__DifferentTokensInPosition
Parameters
Aera__FinalizationNotInitiated
Aera__ManagementFeeIsAboveMax
Parameters
Aera__GuardianIsOwner
Parameters
Aera__GuardianIsZeroAddress
Aera__NoAvailableFeeForCaller
Parameters
Aera__NoPendingOwnershipTransfer
Aera__NotPendingOwner
Aera__NoticePeriodIsAboveMax
Parameters
Aera__NoticeTimeoutNotElapsed
Parameters
Aera__OwnerIsZeroAddress
Aera__PoolSwapIsAlreadyEnabled
Aera__SwapFeePercentageChangeIsAboveMax
Parameters
Aera__ValidatorIsNotMatched
Parameters
Aera__ValidatorIsNotValid
Parameters
Aera__ValueLengthIsNotSame
ERRORS ///
Parameters
Aera__VaultIsAlreadyFinalized
Aera__VaultIsAlreadyInitialized
Aera__VaultIsFinalizing
Aera__VaultIsNotRenounceable
Aera__VaultNotInitialized
Aera__WeightChangeDurationIsBelowMin
Parameters
Aera__WeightChangeEndBeforeStart
Aera__WeightChangeEndTimeIsAboveMax
Parameters
Aera__WeightChangeRatioIsAboveMax
Parameters
Aera__WeightChangeStartTimeIsAboveMax
Parameters
Aera__WeightIsAboveMax
Parameters
Aera__WeightIsBelowMin
Parameters
Last updated