What Does Withdraw Excess Lamports Do?
WithdrawExcessLamports moves SOL held by a Token Program account above its
rent-exempt minimum to a destination account. Token balances and mint supply are
untouched — only the surplus lamports move.
This recovers SOL that was previously stranded: lamports sent to a token account, mint, or multisig (all owned by the Token Program) could not otherwise be moved.
Source Reference
| Item | Description | Source |
|---|---|---|
WithdrawExcessLamports | The instruction (discriminator 38). | Source |
process_withdraw_excess_lamports | Processor logic and authority checks. | Source |
Accounts
| Account | Description |
|---|---|
source | Writable. The token account, mint, or multisig to withdraw from. |
destination | Writable. Receives the excess lamports. |
authority | Signs based on the source account type (see below). |
Who Can Sign
The required signer depends on the type of the source account:
| Source account | Signer |
|---|---|
| Token account | The token account owner (or its multisig signers). |
| Mint with a mint authority | The mint authority. |
| Mint without a mint authority | The mint account itself must sign (see the note below). |
| Multisig | The configured M-of-N signers. |
The "mint without a mint authority" case is uncommon. When it applies, the mint account is the signer: a program-owned (off-curve) mint signs via a CPI from its owning program, and a keypair (on-curve) mint signs with its key.
Native (wrapped SOL) token accounts are not supported and return
NativeNotSupported. The withdrawal cannot drop the source account below
its rent-exempt minimum.
How to Withdraw Excess Lamports
The example uses a configured
@solana/kit client — see
Transfer Tokens for client setup.
import { getWithdrawExcessLamportsInstruction } from "@solana-program/token";// source/destination: addresses of the account to drain and the lamport recipient.// authority: a TransactionSigner that signs per the source account type.const instruction = getWithdrawExcessLamportsInstruction({source,destination,authority});await client.sendTransaction([instruction]);
For a multisig authority, pass the co-signers with multiSigners.
Is this page helpful?