> ## Documentation Index
> Fetch the complete documentation index at: https://pessoal-86816071.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Build a Bear Vault

> Overview of the Solana multi-strategy vault, its architecture, and its current MVP scope.

# Build a Bear Vault

Build a Bear Vault is a `USDC`-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 `Ranger` execution layer that builds and sends protocol transactions
* protocol adapters for `Drift`, `Kamino`, `MarginFi`, and `Perena`

## 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 `Drift` and `Kamino`
* Manifest-based path for `MarginFi` and `Perena`
* 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:

1. `Policy before optimization`
2. `Deterministic before adaptive`
3. `Proofs on-chain, heavy compute off-chain`

That means the solver does the expensive decision-making off-chain, while the on-chain program stores and enforces the result.

## 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

1. [Quickstart](./quickstart)
2. [Current Status](./current-status)
3. [Architecture Overview](./architecture/index)
4. [Solver Deep Dive](./architecture/solver)
5. [Business Overview](./business/index)
6. [Operations Overview](./operations/index)
7. [Testing Overview](./testing/index)

## 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 `MarginFi` and `Perena`
* 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

That distinction matters because the financial thesis is broader than the current fee logic implemented in code.
