Skip to main content
These conventions apply to the public program instructions. Account order and privileges are specific to each instruction.

Encoding and PDAs

The vault program is sVau1tXvayVWfotzm9Ahcv2qfnnfRWttt78BCnNC6dD. Instructions use a one-byte discriminator followed by Borsh arguments. Accounts use an eight-byte discriminator followed by their Borsh fields. Integers are little-endian; vector lengths are u32; enums use a u8 variant tag.

Token programs

LP mint, escrow, voting, and fee operations use the original SPL Token program. A deposit’s asset token_program may be Token or Token-2022; its separate token_program_lp remains SPL Token. Claim and instant withdrawal supply both SPL Token and Token-2022 in their named fixed slots.

Valuation inputs

Full AUM calculation needs all current reserve accounts and protocol-specific tracked-position accounts. Lookup is by public key, but action-specific positional prefixes and suffixes still have to appear in their documented order. Fixed instruction accounts may also need to appear in the valuation slice. Use await vault.getResolvedAumRemainingAccountMetas(extras) for derivable accounts. Resolving addresses does not update prices or protocol state. Keep price updates in the same slot as the calculation and preserve source dependencies. See Refresh AUM. An optional account’s None value uses the vault program ID as a read-only placeholder; do not simply remove a positional slot unless the instruction explicitly permits it.