Skip to main content

BPT Vault

Overview

The BPT Vault is a sub-vault of users' main vault. The BPT Vault manages Capped Collateral tokens by holding the capped token in the BPT vault. Deposits to the BPT vault are made via the CappedBptToken contract, and withdrawals occur at the main vault. The sub-vault provides additional functionality and acts as a conduit without requiring users to interact with it directly.

Each BPT Vault has the same owner and sub-vault ID as its parent vault. New vaults are made by the Voting Vault Controller, similar to the Vault Controller. Unlike the primary vault, users cannot send assets directly to the vault. Users should not interact with the vault contract directly, other than to stake their underlying tokens or to collect rewards.

NOTE

Any partial withdrawal or liquidation will unstake all of that token back to the underlying BPT. So if these tokens are to be staked again, it must be done manually via stakeAuraLP()

Constructor

  • uint256 id
    • The number of the vault. The same as the Parent.
  • address vault_address
    • The address of the primary vault.
  • address controller_address
    • where the vault references for access to the protocol.
  • address voting_controller_address
    • where the vault references for access to the protocol.

Modifier

  • onlyVotingVaultController
    • checks if _msgSender is the controller of the voting vault
  • onlyVaultController
    • checks if _msgSender is the controller of the vault
  • onlyMinter
    • check if _msgSender is the minter of the vault

Functions

  • function parentVault() external view returns (address)
    • return address(_parentVault)
  • function id() external view returns (uint96)
    • return _vaultInfo.id;
  • function stakeAuraLP(IERC20 lp) external returns (bool)
    • Stakes all lp into Aura rewards tokens via the Aura booster contract
    • If lp is AuraBal, stake occurs directly through rewards pool
  • function claimAuraLpRewards(IERC20 lp, bool claimExtra) external
    • Claim any rewards generated by the BPT
    • claimExtra should only be true if the LP offers extra rewards, as it uses more gas
    • Any unclaimed rewards are not included in the value of the BPT, and so do not contribute to borrowing power
  • function unstakeAuraLP(address lp) external onlyMinter
    • Allows the minter to unstake manually if desired
  • function controllerTransfer(address _token, address _to, uint256 _amount) external onlyVaultController
    • Allows the primary vault controller to transfer tokens (used for the liquidation)
  • function votingVaultControllerTransfer(address _token, address _to, uint256 _amount) external onlyVotingVaultController
    • Allows the voting vault controller to transfer tokens (used for the withdraw)