> ## 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.

# Sync helpers

> Return unsubmitted Squads execution instruction bundles.

Sync helpers resolve action descriptors and return instructions for your sender. They do not return signed transactions or a complete refresh-and-submission plan.

## From actions

Import both helpers from `@exponent-labs/exponent-sdk`.

| Function | Result |
| - | - |
| `createVaultSyncTransactions(params)` | `Promise<VaultSyncTransactionResult[]>`, preserving order for adapters that produce multiple results. |
| `createVaultSyncTransaction(params)` | One result; rejects if the action requires multiple results. |

| Input | Contract |
| - | - |
| `owner`, `connection`, `signer`, `instructions` | Protocol authority (normally `vault.state.squadsVault`), RPC connection, authorized public key, and `VaultInstruction[]`. |
| `vaultPda` | Defaults to `owner`; normally the vault's Squads smart account. |
| `policyPda` | Optional explicit policy address; otherwise resolve a matching installed policy using `vaultAddress`. |
| `vaultAddress` | Strategy Vault address; required for automatic policy matching. |
| `accountIndex`, `constraintIndices` | Index defaults to `0`; constraint indices follow inner instruction order and resolve automatically when omitted. |
| `leadingAccounts`, `preHookAccounts`, `postHookAccounts` | Optional `PublicKey[]` or `AccountMeta[]`; resolved from policy when omitted and `vaultAddress` is supplied. Empty arrays override resolution. Preserve required hooks. |
| `squadsProgram` | Defaults to the SDK Squads program ID. |
| `autoManagePositions` | Defaults to `false`. Keep `false` when tracking is already registered. It does not suppress all account setup or refresh preparation. |

```typescript theme={null}
import { createVaultSyncTransactions } from "@exponent-labs/exponent-sdk";

// Integration accounts, tracked positions, and valuation paths already exist.
const bundles = await createVaultSyncTransactions({
  owner: vault.state.squadsVault, connection, signer: manager.publicKey,
  vaultAddress: vault.selfAddress,
  instructions: actions,
  autoManagePositions: false,
});
```

A plural result does not promise to split arbitrary action arrays. Keep slippage-checked actions in their own call. Adapter-specific restrictions are listed in each [integration guide](https://docs.exponent.finance/developer-strategy-vaults/supported-integrations.md).

`createOrderbookSyncTransaction` accepts Order Book descriptors and the same execution-account inputs, plus optional `env`. It returns one bundle and has no `autoManagePositions` option.

## Result fields

| Field | Contract |
| - | - |
| `setupInstructions` | Account creation and supported registration/setup instructions. May need a separate transaction. |
| `preInstructions` | Instructions required before the wrapped execution, including protocol preparation. |
| `instruction` | Squads sync execution instruction. |
| `postInstructions` | Required follow-up instructions. |
| `signers` | Additional local signers, including generated position accounts. |
| `addressLookupTableAddresses` | Lookup table addresses to load for your v0 messages. |

Preserve each result's instruction order and the order between results. Your sender must refresh stale AUM, include same-slot price updates wherever AUM is recalculated, preserve protocol refresh ordering, load lookup tables, retain generated signers, submit, and confirm. Simply concatenating these fields can omit required refreshes or exceed transaction limits. See [Refresh AUM](https://docs.exponent.finance/developer-strategy-vaults/refresh-aum.md) for the shared refresh code, or use the [transaction builder](https://docs.exponent.finance/developer-strategy-vaults/vault-transaction-builder.md) to schedule supported preparation.

## From raw instructions

| Public helper | Purpose |
| - | - |
| `wrapInstructionsInSyncTransaction` | Wrap supplied instructions with an explicit policy, signer, and hook-account configuration. |
| `compileToSyncTransactionPayload` | Compile instructions against their deduplicated account list. |
| `buildSyncTransactionInstruction` | Encode the Squads instruction from the payload and execution accounts. |

`compileToSyncTransactionPayload({ vaultPda, signers, instructions, leadingAccounts?, preHookAccounts?, postHookAccounts?, additionalAccounts? })` returns `{ instructions: Uint8Array, accounts: AccountMeta[] }`.

`buildSyncTransactionInstruction({ policyPda, accountIndex, numSigners, payload, constraintIndices?, squadsProgram? })` returns a `TransactionInstruction`.

`wrapInstructionsInSyncTransaction({ policyPda, vaultPda, signer, instructions, accountIndex?, constraintIndices?, leadingAccounts?, preHookAccounts?, postHookAccounts?, additionalAccounts?, squadsProgram? })` compiles and wraps for one authorized signer; index defaults to `0`.

The four account arrays accept `PublicKey[]` or `AccountMeta[]`. Use metas when writable or signer privileges matter. `additionalAccounts` makes accounts available to validation without referencing them in an inner instruction.

These helpers require caller-selected constraints and execution accounts. [Build transactions manually](https://docs.exponent.finance/developer-strategy-vaults/reference/vault-sync-transactions.md) documents the wire format and required validation accounts.


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