Skip to main content
VaultTransactionBuilder is the default high-level execution API for manager flows. It sits on top of the low-level sync transaction helpers and is the best choice when you want to sequence multiple strategy steps, mix standard vault actions with Loopscale responses, or let the SDK manage setup instructions, price refreshes, lookup tables, and Loopscale co-signing for you.
For pre-flight state checks before sending a transaction, see VaultAssertion. It returns an allow / warn / block report you can use to gate send() calls.
If you want low-level control instead of a builder:
  • Use createVaultSyncTransactions(...) when you want wrapped sync transaction results but still want the SDK to fan a logical action out into multiple sequential transactions when needed.
  • Use createVaultSyncTransaction(...) only when you specifically require exactly one sync transaction result.
For raw Loopscale response handling, see Loopscale Instructions.

Create a builder

The builder resolves the Squads vault PDA from vault.state.squadsVault.

Config fields

Add standard vault steps

Each addActions() call becomes a separate Squads sync transaction.
If you pass multiple actions in one addActions([...]) array, the builder packs them into one sync transaction. Large combinations can exceed Solana’s transaction size limit.
A single addActions([...]) step can still expand into multiple sequential transaction sets when the SDK has to split a smart Kamino Vault withdraw across reserve-specific sync transactions. That same fan-out is available at the low level through createVaultSyncTransactions(...).

Step options

StepOptions applies to addActions(...): LoopscaleStepOptions applies to addLoopscaleResponse(...): Loopscale steps only accept label. Compute overrides stay on the raw Loopscale response and are not reapplied by the builder.

AMM swap (Market Two)

marketTwoAction.tradePt, marketTwoAction.buyYt, and marketTwoAction.sellYt plug into the builder like any other standard vault step. Each addActions(...) call becomes its own Squads sync transaction.
See Exponent Core Instructions for the full Market Two surface and the matching createVaultSyncTransaction flow.

Kamino Vault to Kamino Farm sequence

Use the builder when you want to deposit into a Kamino Vault and then stake the resulting shares into a Kamino Farm.
This flow is sequential, not atomic. The deposit must land before the stake step runs, so the example sends one builder result, reloads the vault, and then sends the second builder result.
The builder defaults autoManagePositions to true. For this flow, that means the vault can track the minted Kamino Vault shares and the resulting Kamino Farm position automatically. Make sure the matching Kamino Vault and Kamino Farm policies already exist, and make sure the matching Exponent KaminoVault price entry already exists before you run the deposit step.

Mix standard steps with Loopscale

Use addLoopscaleResponse(...) when you already have a raw response from LoopscaleClient.
result.send(...) only calls Loopscale MPC co-signing for transaction sets that require it.

Manager: fill a withdrawal

managerAction.fillWithdrawal({...}) fills one depositor withdrawal account from the vault’s token entries. Use it to clear the withdrawal queue without leaving the builder pipeline.
Add multiple fillWithdrawal actions in one builder call to fill multiple withdrawal accounts in the same flow.

Build result

build() returns a VaultTransactionBuildResult: send() is sequential, not atomic. If a later transaction fails, earlier ones may already have landed.

Ephemeral ALT handling

If the vault’s existing lookup tables do not cover every account in the flow, send() can create an ephemeral address lookup table automatically. In that case, the returned SendResult includes:
When ephemeralAlt is non-null, you can deactivate and later close that lookup table to reclaim rent.