A Solana-based implementation of the Boring Vault protocol, designed for secure and efficient asset management on the Solana Virtual Machine (SVM).
Get up and running in less than a minute!
- Rust: 1.81.0+
- Solana Tool Suite: Agave 2.0.15+
- Anchor: 0.32.1
- Yarn: 1.22+
We provide a unified script to start the local validator, build programs, deploy them, and run tests automatically.
./scripts/localnet-dev.shThis script will:
- Start a local Solana validator (if not already running).
- Build all Anchor programs.
- Deploy programs to the localnet.
- Initialize the environment.
- Run the full test suite.
The project is organized as a standard Anchor workspace with multiple interacting programs:
| Program | Directory | Description |
|---|---|---|
| Boring Vault | programs/boring-vault-svm |
Core vault logic. Manages deposits, withdrawals, and asset strategies. |
| Boring Queue | programs/boring-onchain-queue |
Manages asynchronous withdraw requests and fulfillment queues. |
| Share Mover | programs/layer-zero-share-mover |
Handles cross-chain share transfers via LayerZero (OApp). |
| Endpoint Mock | programs/endpoint-mock |
Mocks the LayerZero endpoint for local testing. |
| State Assert | programs/state-assert |
Utility program for asserting on-chain state during transactions. |
This project uses the latest Solana development stack:
- Solana Program:
v3.0.0(Latest major version) - Anchor:
v0.32.1 - Switchboard On-Demand:
v0.11.1(Oracle) - Pythnet SDK:
v2.3.1(Oracle)
Program IDs are synchronized between Anchor.toml and the rust declare_id! macros.
Important: If you change program IDs or deploy to a new cluster, you must sync the keys:
anchor keys syncThis ensures that the program IDs in your Rust code match the keys used by Anchor for deployment.
To run tests manually without the full dev script:
# Run all tests
anchor test
# Run specific test file
anchor test --file tests/boring-vault-svm.tsgraph TD
User[User]
subgraph "Boring Vault System"
Vault[Boring Vault]
Queue[Boring Queue]
ShareMover[Share Mover]
Strategies[Yield Strategies]
end
%% Deposit Flow (Green)
User -- "1. Deposit Assets" --> Vault
Vault -- "2. Mint Shares" --> User
Vault -- "3. Invest Assets" --> Strategies
Strategies -- "4. Yield" --> Vault
%% Withdraw Flow (Red)
User -- "1. Request Withdraw" --> Queue
Queue -- "2. Wait Maturity" --> Queue
Queue -- "3. Fulfill Request" --> Vault
Vault -- "4. Burn Shares" --> Vault
Vault -- "5. Return Assets" --> User
%% Cross Chain Flow (Blue)
User -- "1. Bridge Shares" --> ShareMover
ShareMover -- "2. LayerZero Message" --> OApp[Remote Chain OApp]
%% Styling
%% Deposit Flow: Links 0-3
linkStyle 0,1,2,3 stroke:#2ecc71,stroke-width:2px;
%% Withdraw Flow: Links 4-8
linkStyle 4,5,6,7,8 stroke:#e74c3c,stroke-width:2px;
%% Cross Chain Flow: Links 9-10
linkStyle 9,10 stroke:#3498db,stroke-width:2px;
- Deposits: Users deposit assets (SOL/SPL) into the Boring Vault.
- Shares: The vault mints share tokens representing the user's ownership.
- Strategies: The vault manager (strategist) can deploy assets into various strategies (e.g., JitoSOL staking) to earn yield.
- Withdrawals:
- Users request withdrawals via the Boring Queue.
- Requests enter a maturity period.
- After maturity, the request can be fulfilled, burning shares and returning assets.
- Cross-Chain: The Share Mover allows users to move their vault shares across different chains using LayerZero.
This project is licensed under the MIT License - see the LICENSE file for details.