> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exponent.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Policy

> Low-level instruction to update an existing Squads instruction constraint policy on the vault

# createUpdatePolicyInstruction

Builds a raw instruction to update an existing Squads instruction constraint policy on the vault. This replaces the policy's configuration with a new one, allowing changes to program targets, instruction discriminators, or account constraints. Requires the manager role.

## Usage

```typescript theme={null}
import { createUpdatePolicyInstruction } from "@exponent-labs/exponent-sdk/client/vaults";
import { PublicKey } from "@solana/web3.js";

const ix = createUpdatePolicyInstruction(
  {
    payer: wallet.publicKey,
    vault: vaultAddress,
    manager: managerPublicKey,
    squadsSettings: squadsSettingsPda,
    squadsSettingsTransaction: squadsSettingsTransactionPda,
    squadsProposal: squadsProposalPda,
    squadsPolicy: squadsPolicyPda,
    squadsProgram: SQUADS_PROGRAM_ID,
    systemProgram: SYSTEM_PROGRAM_ID,
  },
  {
    policyConfig: {
      programId: updatedProgramId,
      instructionDiscriminator: updatedDiscriminatorBytes,
      accountConstraints: [
        { index: 0, address: requiredAccountAddress },
      ],
    },
  }
);
```

## Accounts

| Name                        | Signer | Writable | Description                     |
| --------------------------- | ------ | -------- | ------------------------------- |
| `payer`                     | Yes    | Yes      | Fee payer for the transaction   |
| `vault`                     | No     | No       | The Strategy Vault account      |
| `manager`                   | Yes    | No       | The vault manager authority     |
| `squadsSettings`            | No     | Yes      | Squads settings account         |
| `squadsSettingsTransaction` | No     | Yes      | Squads settings transaction PDA |
| `squadsProposal`            | No     | Yes      | Squads proposal PDA             |
| `squadsPolicy`              | No     | Yes      | Squads policy PDA to update     |
| `squadsProgram`             | No     | No       | Squads v4 program               |
| `systemProgram`             | No     | No       | System program                  |

## Args

| Name           | Type           | Description                                                                               |
| -------------- | -------------- | ----------------------------------------------------------------------------------------- |
| `policyConfig` | `PolicyConfig` | The updated policy configuration defining program, discriminator, and account constraints |

## Returns

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