MultiStrategyVault¶
API reference: MultiStrategyVault
ELI5: The main USDC vault — holds cash and sends it to strategies, tracks shares so everyone gets a fair slice of yield (or loss).
What you can do¶
| Function | Who |
|---|---|
deposit / withdraw |
Users |
rebalance |
Keeper / manager |
report / harvest |
Keeper |
add_strategy / set_allocations |
STRATEGY_MANAGER / ALLOCATOR |
Flywheel fit¶
Central USDC sink for Coil fees + TARE emission. Feeds CoilMakerStrategy first.
Contract walkthrough¶
MultiStrategyVault.vy key design:
total_idle: uint256 # USDC in vault
total_debt: uint256 # USDC deployed to strategies
# totalAssets = total_idle + total_debt (NOT balanceOf — anti-donation)
Roles:
| Role | Powers |
|---|---|
DEFAULT_ADMIN_ROLE |
Governance |
STRATEGY_MANAGER_ROLE |
Add/remove strategies, weights, buffer |
ALLOCATOR_ROLE |
Only set_allocations (GaugeWeightRouter) |
EMERGENCY_ROLE |
Pause deposits (not withdrawals) |
Smart router: when enabled, rebalance() allocates by each strategy's getApr() vs manual target_weight_bps.
Withdrawal path: drain total_idle first, then pull from strategies in list order. Strategy shortfall → loss socialized.
flowchart TD
User[USDC deposit] --> Vault[MultiStrategyVault]
Vault --> Idle[total_idle]
Vault --> Debt[total_debt]
Debt --> S1[CoilMaker P0]
Debt --> S2[Fallbacks]
What can go wrong¶
Risks
- Strategy manager compromise → malicious strategy / misallocation.
- Strategy loss → all shareholders absorb via lower share price.
pauseblocks deposits only.
Deep dive: DECIMALS_OFFSET
Virtual shares (offset 6) resist first-depositor inflation attacks. See test_vault_inflation.py.
Source: khomdev-keep/src/MultiStrategyVault.vy