KhomDev Keep
// MULTI-STRATEGY YIELD VAULT · ERC-4626 · TRANCHING · VYPER 0.4
A professional-grade multi-strategy yield vault for USDC, inspired by Yearn V3. Features automated strategy routing across Aave, Compound, and Morpho, combined with a Senior/Junior tranching layer.
Vyper 0.4.0
ERC-4626
EIP-2612
Moccasin
Aave V3
Compound V3
Morpho Blue
Tranching
1,250
Lines of Vyper
112
Tests
4
Strategies
100%
Fuzz Coverage
Architecture
The system consists of a central MultiStrategyVault that manages deposits and distributions. It routes capital into modular strategy contracts that interface with top DeFi protocols. An Accountant contract handles management and performance fees using a High-Water Mark (HWM) mechanism.
- Yield Layer — AaveV3, CompoundV3, and Morpho Blue strategies provide base yield.
- Product Layer — TranchedVault wraps the base vault, issuing Senior (fixed APR) and Junior (variable yield) shares.
- Safety — Senior tranches are protected by Junior principal, acting as a first-loss buffer.
Core Contracts
| Contract |
Role |
Status |
| Vault | MultiStrategyVault.vy | ERC-4626 + Router |
| Tranche | TranchedVault.vy | Senior/Junior Logic |
| Strategy | AaveV3Strategy.vy | Supply-only |
| Strategy | CompoundV3Strategy.vy | Comet + Rewards |
| Fee | Accountant.vy | HWM + Fees |
Test Coverage
- test_vault.py — Core ERC-4626 functionality and share accounting.
- test_tranche.py — Maturity logic and senior interest accrual.
- test_strategies.py — Mainnet-fork integration tests for all protocols.
- test_fuzz.py — Hypothesis stateful fuzzer catching edge cases.
Key Features
- ERC-4626 compliant yield vault with EIP-2612 permit support.
- Flexible strategy routing with withdrawal queues and force-removal.
- Risk tranching: Senior shares get fixed APR, Junior shares get surplus yield.
- High-Water Mark performance fees and management fees.