PolicyConfig objects for common strategy execution scenarios. A policy must exist onchain before any strategy instruction can be executed by the vault.
What is a Policy?
AprogramInteraction policy defines exactly which instructions the vault’s smart account is permitted to execute. It is enforced onchain by the Squads program when executeTransactionSync is called.
A policy consists of:
instructionsConstraints— a list ofInstructionConstraintobjects, each specifying:programId— which program is alloweddataConstraints— which instruction discriminators match (first 8 bytes of instruction data)accountConstraints— which specific public keys must be present
Adding a Policy to a Vault
Policies are added by the vault manager role:Exponent Core Policy
createCorePolicy builds a policy that permits strip and merge operations on the Exponent Core program (ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7).
Parameters
See Core Instructions for usage examples.
Exponent CLMM Policy
createClmmPolicy builds a policy that permits all CLMM operations on the Exponent CLMM program (XPC1MM4dYACDfykNuXYZ5una2DsMDWL24CrYubCvarC) — including providing liquidity, trading PT/YT, and claiming farm emissions.
Parameters
See CLMM Instructions for usage examples.
AMM Swap Policies
createMarketTwoTradePtPolicy, createMarketTwoBuyYtPolicy, and createMarketTwoSellYtPolicy build policies that authorize the corresponding swap operations on Market Two AMM markets through the exponent_core program. All three accept the same parameters; choose the builder that matches the swap direction the vault should be allowed to execute.
Parameters
See Exponent Core Instructions for usage examples.
Exponent Orderbook Policy
createOrderbookPolicy builds a policy that permits interacting with the Exponent Orderbook program (XPBookgQTN2p8Yw1C2La35XkPMmZTCEYH77AdReVvK1).
Parameters
See Orderbook Instructions for usage examples.
Kamino Lend Policies
Deposit Policy
createKaminoDepositPolicy builds a policy that permits calling depositReserveLiquidityAndObligationCollateral on the Kamino Lending program.
Parameters
Withdraw Policy
createKaminoWithdrawPolicy builds a policy that permits calling withdrawObligationCollateralAndRedeemReserveCollateral on the Kamino Lending program.
Parameters
Borrow Policy
createKaminoBorrowPolicy builds a policy that permits calling borrowObligationLiquidity on the Kamino Lending program.
Parameters
Repay Policy
createKaminoRepayPolicy builds a policy that permits calling repayObligationLiquidity on the Kamino Lending program.
Parameters
Full Access Policy
createKaminoFullAccessPolicy creates a single policy covering multiple Kamino actions. This is useful when a strategy requires deposit, withdraw, borrow, and repay on the same reserves.
Parameters
Unified Kamino Policy
createKaminoPolicy is a unified API that supports both allowedReserves and allowedDepositMints as optional constraints. This provides finer-grained control than createKaminoFullAccessPolicy — you can constrain by the liquidity mint in addition to (or instead of) the reserve address.
Parameters
See Kamino Lend Instructions for usage examples.
Kamino Vault policy
createKaminoVaultPolicy builds a policy for direct Kamino Vault deposits and withdrawals.
Parameters
See Kamino Vault Instructions for usage examples.
Kamino Farm policy
createKaminoFarmPolicy builds a policy for direct and delegated Kamino Farm actions.
Parameters
See Kamino Farm Instructions for usage examples.
Jupiter Lend Earn Policy
createJupiterEarnPolicy builds a policy that authorizes a chosen subset of Jupiter Lend Earn jlToken operations on the Jupiter Lend Earn program (jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9).
Parameters
See Jupiter Lend Earn Instructions for usage examples.
Jupiter Lend Borrow Policy
createJupiterBorrowPolicy builds a policy that authorizes a chosen subset of Jupiter Lend Borrow lifecycle and operate actions on the Jupiter Lend Borrow program (jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi). Operate actions encode signed newCol / newDebt deltas — the policy enforces the correct signs for each named action so a borrowDebt policy cannot execute a repayDebt instruction (and vice versa).
Parameters
See Jupiter Lend Borrow Instructions for usage examples.
Orca Whirlpool policy
createOrcaWhirlpoolPolicy builds a policy that permits vault-managed Orca Whirlpool V2 and token-extension instructions.
Parameters
Close-position instructions are not constrained by a Whirlpool account because the Orca close instruction has no Whirlpool account. The hook requires the position to be tracked and the authority and receiver to be the Squads vault.
Loopscale Policy
createLoopscalePolicy builds a policy that constrains lender-side strategy actions and borrower-side loan actions on the Loopscale program (1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78).
Parameters
See Loopscale Instructions for usage examples.
Titan Swap Policy
createTitanSwapPolicy builds a policy that permits calling SwapRouteV2 on the Titan program (T1TANpTeScyeqVzzgNViGDNrkQ6qHz9KrSBS4aNXvGT).
Parameters
See Titan Instructions for usage examples.