> ## 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.

# Set Rent Collector (Controlled Multisig)

## Overview

Edit the rent collector address via Config Authority. This instruction allows the config authority to change where reclaimed rent is sent 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
* `@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";

const signature = await multisig.rpc.multisigSetRentCollector({
  connection,
  multisigPda,
  feePayer,
  configAuthority: configAuthority.publicKey,
  newRentCollector,
  rentPayer: feePayer.publicKey,
  programId,
  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 |
| `configAuthority` | `PublicKey` | Yes | Config authority public key |
| `newRentCollector` | `PublicKey \| null` | Yes | New rent collector address. Set to `null` to turn off rent reclamation |
| `rentPayer` | `PublicKey` | Yes | Account for rent adjustments |
| `programId` | `PublicKey` | No | Squads program ID |
| `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();

// 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 transactionIndex = 1n;

const newRentCollector = Keypair.generate().publicKey;

const signature = await multisig.rpc.multisigSetRentCollector({
      connection,
      multisigPda,
      feePayer,
      configAuthority: configAuthority.publicKey,
      newRentCollector,
      rentPayer: feePayer.publicKey,
      programId,
      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 |

## See Also

* [Controlled Multisigs Reference](/developers/reference/controlled-multisigs)
* [Close Vault Transaction Account](/developers/typescript-sdk/instructions/close-vault-transaction-account)
* [Multisig Account](/developers/typescript-sdk/accounts/multisig)


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