Skip to main content

Documentation Index

Fetch the complete documentation index at: https://v2-docs.exponent.finance/llms.txt

Use this file to discover all available pages before exploring further.

createWrapperAddPolicyInstruction

Adds a Squads policy to the vault via self-CPI using the vault’s signer seeds. This instruction enforces that the vault has zero AUM (empty vault only), ensuring policies are configured before any deposits are accepted. Typically called during initial vault setup to establish the execution policies that govern strategy allocations. Once the vault holds depositor funds (AUM > 0), use a governance proposal with PolicyAction instead. See Propose Action.

Usage

import { createWrapperAddPolicyInstruction } from "@exponent-labs/exponent-sdk/client/vaults";
import { PublicKey, SystemProgram } from "@solana/web3.js";

const ix = createWrapperAddPolicyInstruction(
  {
    payer: payerKeypair.publicKey,
    vault: vaultAddress,
    squadsSettings: squadsSettingsAddress,
    squadsSettingsTransaction: squadsSettingsTransactionPda,
    squadsProposal: squadsProposalPda,
    squadsPolicy: squadsPolicyPda,
    squadsProgram: SQUADS_PROGRAM_ID,
    systemProgram: SystemProgram.programId,
  },
  {
    policyConfig: {
      threshold: 1,
      permissions: { execute: {} },
      members: [managerKeypair.publicKey],
    },
  }
);

Accounts

NameSignerWritableDescription
payerYesYesFee payer for account creation
vaultNoYesVault account (must have zero AUM)
squadsSettingsNoYesSquads multisig settings account
squadsSettingsTransactionNoYesSquads settings transaction account
squadsProposalNoYesSquads proposal account
squadsPolicyNoYesSquads policy account to create
squadsProgramNoNoSquads program
systemProgramNoNoSystem program

Args

NameTypeDescription
policyConfigPolicyConfigConfiguration for the new policy including threshold, permissions, and members

Returns

TransactionInstruction — a transaction instruction ready to be added to a transaction.