The Stake-Vault project is a two-tier system that funnels SOL deposits into Jito’s SPL Stake-Pool, keeps the liquid-staking yield inside the vault, and lets a designated authority periodically skim rewards or pro-actively eject user deposits.
Key moving parts:
• On-chain Anchor program (programs/stake-vault
): owns all state and enforces rules.
• Off-chain TypeScript client (app/…
) & Mocha tests (tests/…
): drive transactions, derive PDAs, and fork mainnet for realistic tests. ->> NOT PART OF THE AUDIT
• Utility script (fanout.ts
): optional; redistributes harvested JITO tokens to a hard-coded member list. ->> NOT PART OF THE AUDIT
Complexities & critical calculations:
- Pool-token ↔ SOL math mirrors SPL-Stake-Pool’s dynamic exchange rate. Functions
calc_pool_tokens_for_deposit_with_fees
,calc_pool_tokens_required_for_withdrawal
, andcalc_lamports_for_token_withdrawal_with_fees
must stay bit-exact or withdrawals revert (TokenMismatch
,InsufficientSolReceived
). - Rounding & gr