The flow
validate CPI. Every fund movement is metered by a charge_fees CPI. The claim_fees path is a payout, not a charge.
The security triangle
A manager never signs as the vault. Instead:1
create_tx
The manager proposes a CPI (target program, accounts, data) stored in a Transaction PDA. The core fires
validate(Creation) — the policy can inspect the proposal before it’s allowed to exist.2
execute_tx
Asserts
did_execute == false (one-shot replay guard), fires validate(Execution), and only on approval replays the proposed CPI with invoke_signed under the vault’s authority PDA.Two PDAs, separate duties
Pluggability
A vault’s entire economic and authorization configuration is just two on-chain pubkeys plus their config accounts:policy_program— who may do whatfee_calc_program— how much is charged