Transaction structure
Build the Squads instruction
Payload. Use an installedProgramInteraction policy belonging to the vault. Match each inner instruction to a policy constraint and include those constraint indices in instruction order. Set account_index to 0 in both the outer arguments and the inner sync payload.
Compile program IDs and account references against one deduplicated instruction-account list. Preserve writable and signer privileges, but mark the smart account as a non-signer in the outer instruction.
Accounts. Start with the policy (consensus_account, writable) and the Squads program. Append:
- Authorized signers, counted by
num_signers. - Leading policy accounts, including the settings account if required for settings-state expiration.
- Pre-hook accounts, starting with the hook program ID, if configured.
- Post-hook accounts, starting with the hook program ID.
- The instruction-account list, including additional accounts needed by vault validation.
Required validation accounts
The installed policy must use the Exponent Vaults post-hook with instruction data[21], numExtraAccounts: 7, and passInnerInstructions: true. The outer caller must be the standard Squads program (SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG), executing sync-v2 at account index 0. Its policy must belong to vault.squadsSettings.
Supply this post-hook prefix in order:
Include every tracked reserve ATA and token-position balance ATA in the final instruction-account list, even if no inner instruction references it. These must be canonical Squads-owned accounts. Include protocol position and valuation accounts required by the action. The SDK raw compiler’s
additionalAccounts parameter serves this purpose.
If an action closes a tracked non-native ATA, also include that account writable, its mint, the Squads vault, Associated Token Program, and its Token or Token-2022 program so validation can recreate the empty ATA. Closing a tracked native SOL ATA is rejected.
Execution requires fresh AUM and an unblocked NAV/AUM circuit breaker. Validation checks position changes and reserve limits, synchronizes tracked token balances, and marks AUM stale after nonempty execution. Include same-slot price updates wherever accounting is recalculated. Isolate slippage-checked operations in their own execution.
Encoding details
Encoding details
The instruction data starts with discriminator The compiled instruction list is a
[90, 81, 187, 81, 39, 70, 128, 78], followed by these Borsh-encoded arguments:SmallVec<u8, CompiledInstruction>:- Instruction count:
u8. - Per instruction:
u8program index, account indices prefixed by au8count, then data prefixed by a little-endianu16length.
Vec<u8>.Squads’ Rust execution handler, policy payload definitions, and message compiler define the format and execution behavior.