> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exponent.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Build transactions manually

> Assemble protocol instructions for execution through Squads policies.

Build vault execution transactions directly with Squads, without the Exponent SDK.

## Transaction structure

```text theme={null}
Solana transaction
  Setup and refresh instructions
  Squads execute_transaction_sync_v2
    Check signer and policy constraints
    Invoke protocol instructions
    Run Exponent's validation hook
  Required post-execution updates
```

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](https://docs.exponent.finance/developer-strategy-vaults/supported-integrations.md). After execution, [refresh AUM](https://docs.exponent.finance/developer-strategy-vaults/refresh-aum.md) 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:

| Account | Privileges |
| - | - |
| Exponent Vaults program | Read-only. |
| Strategy Vault | Writable. |
| Exponent prices PDA | Read-only. |
| Vault LP mint | Read-only. |
| Payer | Writable signer; covers any required reallocations or rent. |
| System Program | Read-only. |
| Instructions sysvar | Read-only. |
| Exact Squads policy used by this execution | Read-only. |

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.

> [accordion] Encoding details
>
> The instruction data starts with discriminator `[90, 81, 187, 81, 39, 70, 128, 78]`, followed by these Borsh-encoded arguments:
>
> ```text theme={null}
> SyncTransactionArgs
>   account_index: 0
>   num_signers: authorized signer count
>   payload: Policy
>     ProgramInteraction
>       instruction_constraint_indices: Some(indices)
>       transaction_payload: SyncTransaction
>         account_index: 0
>         instructions: compiled instruction bytes
> ```
>
> 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](https://github.com/Squads-Protocol/smart-account-program/blob/main/programs/squads_smart_account_program/src/instructions/transaction_execute_sync.rs), [policy payload definitions](https://github.com/Squads-Protocol/smart-account-program/blob/main/programs/squads_smart_account_program/src/state/policies/implementations/program_interaction.rs), and [message compiler](https://github.com/Squads-Protocol/smart-account-program/blob/main/sdk/smart-account/src/utils/compileToSynchronousMessageV2.ts) define the format and execution behavior.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.