Skip to main content

createWrapperRemovePolicyInstruction

Removes a Squads policy from the vault via self-CPI using the vault’s signer seeds. This instruction enforces that the vault has zero AUM (empty vault only), preventing policy removal while depositor funds are at risk. The manager must sign to authorize the removal. Once the vault holds depositor funds (AUM > 0), use a governance proposal with PolicyAction instead. See Propose Action.

Usage

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

const ix = createWrapperRemovePolicyInstruction({
  payer: payerKeypair.publicKey,
  vault: vaultAddress,
  manager: managerKeypair.publicKey,
  squadsSettings: squadsSettingsAddress,
  squadsSettingsTransaction: squadsSettingsTransactionPda,
  squadsProposal: squadsProposalPda,
  squadsPolicy: squadsPolicyPda,
  squadsProgram: SQUADS_PROGRAM_ID,
  systemProgram: SystemProgram.programId,
});

Accounts

NameSignerWritableDescription
payerYesYesFee payer for the transaction
vaultNoNoVault account (must have zero AUM)
managerYesNoVault manager authorizing the removal
squadsSettingsNoYesSquads multisig settings account
squadsSettingsTransactionNoYesSquads settings transaction account
squadsProposalNoYesSquads proposal account
squadsPolicyNoYesSquads policy account to remove
squadsProgramNoNoSquads program
systemProgramNoNoSystem program

Args

This instruction takes no arguments.

Returns

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