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

# Remove Spending Limit (Controlled Multisig)

## Overview

Remove a spending limit via Config Authority. This instruction allows the config authority to remove spending limits without going through the standard proposal process.

<Note>
  Can only be used with a [Controlled Multisig](/developers/reference/controlled-multisigs).
</Note>

## Prerequisites

* Multisig with Config Authority set
* Existing spending limit
* `@sqds/multisig` package installed
* Config Authority signer

## Quick Example

```typescript theme={null}
import * as multisig from "@sqds/multisig";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";

await multisig.rpc.multisigRemoveSpendingLimit({
  connection,
  multisigPda,
  spendingLimit: spendingLimitPda,
  configAuthority: configAuthority.publicKey,
  feePayer: feePayer,
  rentCollector: feePayer.publicKey,
  signers: [configAuthority],
});
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `connection` | `Connection` | Yes | Solana RPC connection |
| `feePayer` | `Keypair` | Yes | Transaction fee payer |
| `multisigPda` | `PublicKey` | Yes | PDA of the multisig |
| `spendingLimit` | `PublicKey` | Yes | Spending limit PDA to remove |
| `configAuthority` | `PublicKey` | Yes | Config authority public key |
| `rentCollector` | `PublicKey` | Yes | Account to receive reclaimed rent |
| `signers` | `Signer[]` | No | Additional signers. Pass the config authority here so it signs the transaction |

## Full Example

```typescript theme={null}
import * as multisig from "@sqds/multisig";

// Cluster Connection
const connection = new Connection("<your rpc url>");

// Fee payer is the a signer that pays the transaction fees
const feePayer = Keypair.generate();
// Replace with the keypair of the multisig's config authority
const configAuthority = Keypair.generate();

// Derive the multisig PDA
const multisigPda = multisig.getMultisigPda({
    // The createKey has to be a Public Key, see accounts reference for more info
    createKey,
})[0];

const spendingLimitPda = multisig.getSpendingLimitPda({
    multisigPda,
    createKey: spendingLimitCreateKey,
})[0];

await multisig.rpc.multisigRemoveSpendingLimit({
    connection,
    multisigPda,
    spendingLimit: spendingLimitPda,
    configAuthority: configAuthority.publicKey,
    feePayer: feePayer,
    rentCollector: feePayer.publicKey,
    // The config authority must sign the transaction
    signers: [configAuthority],
});
```

## Error Handling

| Error | Cause | Solution |
| - | - | - |
| Invalid config authority | Wrong or missing config authority | Verify config authority is set on multisig |
| Not a controlled multisig | Multisig has no config authority | Use Config Transaction instead |
| Spending limit not found | Invalid spending limit PDA | Verify the spending limit exists |

## See Also

* [Controlled Multisigs Reference](/developers/reference/controlled-multisigs)
* [Spending Limits Reference](/developers/reference/spending-limits)
* [Add Spending Limit](/developers/typescript-sdk/instructions/controlled-multisig/add-spending-limit)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.