Solana program (Anchor) for the moneymentum fund/vault: depositors swap a quote
token (e.g. USDC) for share tokens, capital is deployed to Turnkey-controlled
trading wallets across venues, and on-chain internal accounting (total_assets,
with a tiered cross-chain NAV model for off-vault value) governs share pricing,
fees, and a two-phase withdrawal. It lives in its own repository because the
Solana toolchain pins versions the main monorepo can't use.
Note
Early development. The first instructions — create_fund and deposit —
and the design spec at programs/fund/SPEC.md are in review; withdraw, NAV
attestation, and fee collection are in progress.
The dev shell (Nix flake + devenv, auto-loaded via direnv) provides the Solana
toolchain, the offline cargo-build-sbf shim, and the GitButler CLI (but,
sourced from the but.nix flake
input — in review).
direnv allow # or: nix develop
anchor build # compile the on-chain program -> target/deploy/fund.so
cargo test # Rust testsRun anchor build before cargo test: litesvm integration tests under
programs/fund/tests/ include_bytes! the compiled fund.so (see the test
architecture section in AGENTS.md).
programs/fund/src/lib.rs--declare_id!and the#[program]module; each instruction is a thin delegate toinstructions::<name>::handler.programs/fund/src/instructions/-- one file per instruction.programs/fund/src/state.rs-- on-chain account state.programs/fund/src/constants.rs,error.rs-- shared constants and error codes.
CLAUDE.md-- repo conventions, the SBF toolchain shim, agent rules.docs/sealevel-attacks.md-- the security checklist every instruction is reviewed against before merge.docs/security-design.md-- fund security architecture; grounds the design against real DeFi incidents and tracks the open decisions that gate implementation.docs/anchor.mdandprograms/fund/SPEC.md-- Anchor essentials and the fund/vault design.adrs/-- architecture decision records: donation-resistant share pricing (0001), tiered off-Solana NAV inclusion (0002), permissionless NAV attestation (0003).