Skip to main content
Managers and allocators can rebalance the vault’s token balances and tracked strategy positions through installed policies. Each policy must authorize the signer and the actions it executes. Every execution must respect the reserve target. Actions can draw down reserves only by the value above that target; below target, they must preserve or increase reserves.

Choose the actions

Use the relevant integration page to choose an action and its inputs. The examples below deposit 1 SOL into Kamino’s SOL/BTC market, identified as KaminoMarket.MAIN in the SDK. They assume the vault already has a Kamino lending account and a tracked SOL position there.

Execute the action

Choose whether the SDK or the application assembles and sends the transactions. Both APIs take the same actions and find a matching installed policy.
Use the transaction builder to let the SDK assemble and execute the sequence, including supported position registrations and required refreshes.build() returns an execution plan. Its ordered transactionSets contain the instructions, additional signers, and lookup table addresses for each transaction.Call the plan’s send method to handle lookup tables, simulate, and submit the transaction sets in order. Use its simulate method for a dry run.

Withdraw and rebalance

To withdraw 0.5 SOL from the Kamino lending position, replace the deposit action with:
For a rebalance that withdraws from one position and allocates to another, chain separate addActions calls for the two steps. Each call defines a separate policy execution. With the sync helpers, prepare and execute the withdrawal before preparing the allocation.

Build transactions manually

To build transactions without the Exponent SDK, construct the Squads execution instruction directly:
  1. Build the protocol instructions with the vault’s Squads smart account as the authority.
  2. Package the vault-signed instructions in execute_transaction_sync_v2, using an installed ProgramInteraction policy and smart-account index 0. Include the authorized signer, matching policy constraint indices, and the policy’s hook accounts.
  3. Keep required setup and price or protocol refresh instructions at the top level, around the Squads instruction. Include the accounts needed by vault validation to check tracked positions and reserve limits.
The manual transaction reference describes transaction structure, payload, and account ordering. Squads’ Rust execution implementation shows how the program validates and dispatches the payload.