BufferVault
Pooled capital vault for institutional-grade automated position protection.
The BufferVault is Aquarius's pooled capital protection mechanism. It solves a critical problem in DeFi risk mitigation: when a position needs protection, the capital to protect it must already be available.
In traditional DeFi, users facing liquidation must manually source funds, pay gas, and execute transactions under time pressure. The BufferVault eliminates this by pre-positioning mitigation capital in a shared pool that the Aqua Agent can draw from instantly.
BufferVault.sol is a share-based vault that integrates directly with Aave V3:
contract BufferVault {
IERC20 public asset; // Underlying collateral token
IPool public pool; // Aave V3 Pool
address public agent; // Authorized Aqua Agent
mapping(address => uint256) public aqShares;
uint256 public totalShares;
function deposit(uint256 amount) external returns (uint256 shares);
function withdraw(uint256 shares) external returns (uint256 amount);
function injectLiquidity(
address beneficiary,
address debtAsset,
uint256 amount
) external onlyAgent;
}When a user deposits into the vault, they receive aqShares proportional to their contribution relative to the total pool:
If totalShares == 0:
shares = depositAmount
Otherwise:
shares = (depositAmount * totalShares) / totalAssets
This ensures that:
Users can withdraw their proportional share of the vault at any time:
withdrawAmount = (userShares * totalAssets) / totalShares
Withdrawal Availability
Vault withdrawals may be temporarily limited during active mitigation events to prevent pool depletion. This constraint ensures that mitigation capital remains available when needed.
When the Aqua Agent detects a critical risk event and selects vault-backed mitigation, it calls injectLiquidity():
function injectLiquidity(
address beneficiary,
address debtAsset,
uint256 amount
) external onlyAgent {
asset.approve(address(pool), amount);
pool.repay(debtAsset, amount, 2, beneficiary);
emit LiquidityInjected(beneficiary, debtAsset, amount);
}This function:
The onlyAgent modifier ensures that only the registered Aqua Agent can trigger liquidity injection. No other address — including vault depositors — can initiate this operation.
aqShares represent:
| Property | Description |
|---|---|
| Claims on pool | Each share represents a proportional claim on the underlying vault assets |
| Yield-bearing | As the vault earns protocol fees or incentives, share value increases |
| Mitigation backing | Shares represent participation in the collective protection pool |
| Transferable | Shares can be transferred between addresses (future: ERC-20 wrapping) |
If the vault processes multiple simultaneous mitigation events, the available capital may be temporarily reduced. Aquarius mitigates this through:
The BufferVault is isolated from other Aquarius contracts:
injectLiquidity(), not withdraw()Institutional Design
The vault architecture is designed for institutional participation. A fund manager can deposit treasury assets once and rely on automated protection without ongoing operational overhead.
The CRE workflow selects vault-backed mitigation when:
The decision is deterministic — no manual approval is required once the position is registered for vault protection.