Skip to main content
Enable the cpi feature to call Alpha Vault from another Anchor program:

CPI Pattern

Anchor generates a CPI module for the program instructions. Account structs use the same names as the instruction contexts in the Alpha Vault source.
Instructions marked with #[event_cpi] require the event-CPI accounts generated by Anchor. If you construct CPI calls manually, include the generated event authority and program accounts expected by the IDL.

Common CPI Calls

Account Requirements

Remaining Accounts

Common CPI Failures

Best Practices

Testing

Use the local Alpha Vault test suite as a reference for account metas and edge cases:
Add CPI caller tests that cover at least one successful path and one expected failure path for each vault mode, whitelist mode, and pool type your integration supports.