Skip to main content
Build vault execution transactions directly with Squads, without the Exponent SDK.

Transaction structure

Protocol instructions use the vault’s Squads smart account as their authority. The manager or allocator signs the outer transaction; Squads supplies the smart account’s signature during CPI. Register new positions and prepare the price, AUM, and protocol updates required by the integration. After execution, refresh AUM before the next operation that requires current accounting.

Build the Squads instruction

Payload. Use an installed ProgramInteraction 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:
  1. Authorized signers, counted by num_signers.
  2. Leading policy accounts, including the settings account if required for settings-state expiration.
  3. Pre-hook accounts, starting with the hook program ID, if configured.
  4. Post-hook accounts, starting with the hook program ID.
  5. The instruction-account list, including additional accounts needed by vault validation.
Compiled indices refer only to the final instruction-account list, excluding all preceding accounts.

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.
The instruction data starts with discriminator [90, 81, 187, 81, 39, 70, 128, 78], followed by these Borsh-encoded arguments:
The compiled instruction list is a SmallVec<u8, CompiledInstruction>:
  • Instruction count: u8.
  • Per instruction: u8 program index, account indices prefixed by a u8 count, then data prefixed by a little-endian u16 length.
These bytes sit inside the argument’s Borsh Vec<u8>.Squads’ Rust execution handler, policy payload definitions, and message compiler define the format and execution behavior.