Build a Bear Vault
Build a Bear Vault is aUSDC-denominated multi-strategy vault for Solana.
The project combines:
- an on-chain Anchor program that enforces vault state, policies, shares, withdrawals, and rebalance proofs
- an off-chain deterministic solver that computes target allocations
- a
Rangerexecution layer that builds and sends protocol transactions - protocol adapters for
Drift,Kamino,MarginFi, andPerena
What this repo already includes
- Anchor program for vault state, policy controls, share minting, and rebalance proof storage
- Deterministic solver and backtester in TypeScript
- Real SDK-backed execution bundle builders for
DriftandKamino - Manifest-based path for
MarginFiandPerena - Vault bootstrap, admin, user, and status CLIs
- Offline test suite for solver, adapters, vault serialization, and operator CLIs
Core design
The vault follows three strong rules:Policy before optimizationDeterministic before adaptiveProofs on-chain, heavy compute off-chain
Main components
On-chain
- Vault accounts and policies
- Share mint and vault treasury
- Strategy registry and allocation state
- Withdrawal queue
- Rebalance plan proof and execution proof
Off-chain
- Strategy adapters
- Allocation solver
- Ranger transaction dispatcher
- COBO MPC simulation layer
- Historical backtest runner
Supported strategies in the MVP
| Strategy | Role | Current implementation status |
|---|---|---|
drift-reserve | Liquid reserve and low-complexity carry | Real SDK bundle builder |
kamino-stable-carry | Main carry sleeve | Real SDK bundle builder |
marginfi-canary | Canary sleeve with capped exposure | Manifest or static fallback |
perena-exotic | Exotic / RWA sleeve | Manifest or static fallback |
Recommended reading order
- Quickstart
- Current Status
- Architecture Overview
- Solver Deep Dive
- Business Overview
- Operations Overview
- Testing Overview
Repository map
| Area | Purpose |
|---|---|
programs/multi_strategy_vault/ | Anchor program |
services/adapters/ | Protocol integration layer |
services/solver/ | Deterministic optimizer and backtester |
services/ranger/ | Execution runtime and operator CLIs |
services/shared/ | Shared types, math, config, hashing, env loading |
tests/offchain/ | Offline validation suite |
config/ | Sample policies, registry, strategy manifests |
Current reality
The repo is code-complete for the MVP scaffold, but production operation still depends on external steps:- deploying the Anchor program to a real cluster
- funding the operator wallets
- bootstrapping the vault on-chain
- providing real manifests for
MarginFiandPerena - optionally replacing the simulated COBO layer with a real MPC integration
Business note
The documentation now separates:- implemented protocol and solver economics
- proposed business-model and revenue assumptions