Skip to content

How to Reclaim Excess SOL After Solana’s Rent Reduction

Solana’s rent reduction can leave token accounts and mints with excess SOL. Learn how to identify eligible accounts, reclaim lamports safely, and update program logic.

How to Reclaim Excess SOL After Solana’s Rent Reduction

On this page

Solana has reduced the amount of SOL that accounts need to remain rent-exempt, which means some existing token accounts and mints can now hold more lamports than their new minimum requires. The Solana Foundation says those excess lamports can be reclaimed without closing the account, and this guide shows how the mechanism works and what users and developers need to check before moving funds. 

Why Solana accounts can now contain excess SOL

Solana uses lamports, the smallest unit of SOL, to fund the storage associated with an account. Accounts that must remain permanently available are normally funded above a minimum balance so they stay rent-exempt. The recent rent reduction lowered that required reserve, leaving some existing accounts with more lamports than they now need. The important detail is that the excess is not part of the token balance stored in the account; it is SOL held alongside the account's data. 

This changes the practical economics of accounts that were created under the previous requirement. Instead of closing an account to recover its SOL, the new Token Program instruction can withdraw only the amount above the current rent-exempt floor. The account remains open and usable afterward. That makes the feature particularly useful for token accounts and mints that users need to keep active.

Check what kind of account holds the excess

Before attempting a withdrawal, identify who owns the account. The new withdrawal instruction applies to accounts owned by Solana's Token Program, including token accounts, token mints, and multisignature accounts supported by that program. Program-derived addresses, commonly called PDAs, are different because they belong to the application that created them rather than to the Token Program. The correct recovery method therefore depends on account ownership, not simply on how much SOL the account contains. 

  1. Identify the account that may contain excess lamports.
  2. Check which on-chain program owns that account.
  3. Confirm whether the account is a Token Program account or an account owned by your own program.
  4. Determine which authority is allowed to authorize the withdrawal.

If the account is owned by the Token Program, you can use its dedicated excess-lamport instruction. If your own program owns the account, the reclaim operation has to be implemented by that program. This distinction prevents a common mistake: trying to use an ordinary SOL transfer to withdraw funds from an account controlled by another program. 

Use WithdrawExcessLamports for Token Program accounts

The Token Program now provides an instruction called WithdrawExcessLamports. It calculates the account's current rent-exempt minimum and moves only the lamports above that amount to a destination account. Because the account itself is not closed, its token balance and account functionality remain intact.

The authorization depends on the account type. For a token account, the owner authorizes the withdrawal; for a mint, the mint authority does so. The Solana Foundation also documents a special case for a mint whose authority has been revoked, where the mint account itself can provide the required signature. 

Reclaim excess SOL from a token account

If you are building a TypeScript client, the Solana Foundation documents the withdrawal instruction through the @solana-program/token package. The important values are the source account, the destination account, and the authority that signs the transaction. The instruction determines the reclaimable amount from the current rent requirement instead of asking you to calculate and hard-code the amount yourself. 

import { getWithdrawExcessLamportsInstruction } from "@solana-program/token";

const instruction = getWithdrawExcessLamportsInstruction({
source: sourceAddress,
destination: destinationAddress,
authority: authoritySigner
});

After adding the instruction to your transaction, send it using the normal Solana transaction flow for your application. The expected result is that the destination receives the excess lamports while the source account keeps the amount required by the current rent-exempt calculation. The account should therefore remain open instead of becoming an empty closed account. 

Do not confuse excess SOL with the token balance

A token account can contain two very different things: the tokens it tracks and the SOL held to satisfy account-storage requirements. Withdrawing excess lamports changes the second one, not the first. That means reclaiming excess SOL should not reduce the number of tokens represented by the token account. 

This distinction matters when testing a recovery tool. A successful transaction should show a change in the account's lamport balance while the token amount remains unchanged. If an implementation closes the token account or changes the token balance, it is performing a different operation and should not be treated as a simple excess-rent withdrawal.

Reclaiming SOL from your own program-owned accounts works differently

Developers who operate DeFi positions, escrow accounts, configuration accounts, or other PDAs cannot use the Token Program's withdrawal instruction unless the account is actually owned by that program. Instead, the program itself must calculate the current rent-exempt minimum and move the excess lamports from the program-owned account to an authorized destination. Solana's guidance recommends reading the current rent data rather than embedding a fixed rent constant in the program. 

The basic sequence is straightforward: verify account ownership, verify the authority, read the current rent requirement, calculate the excess, and move only that excess. The program must debit the source and credit the destination while preserving the required reserve. This approach works with different Solana development stacks because the essential operation is account ownership and lamport accounting rather than a framework-specific feature. 

let rent_exempt_reserve =
Rent::get()?.minimum_balance(target_account.data_len());

let excess = target_account
.lamports()
.saturating_sub(rent_exempt_reserve);

if excess > 0 {
**destination.try_borrow_mut_lamports()? += excess;
**target_account.try_borrow_mut_lamports()? -= excess;
}

The critical line is the calculation of the current minimum balance. Reading the rent information at runtime means the program can follow future changes to the rent schedule instead of becoming incorrect when another phase of the reduction takes effect. Solana's current rollout is being introduced in phases, so hard-coded assumptions are particularly risky. 

Why hard-coded rent values are a bad idea

A developer might be tempted to store a known lamports-per-byte value in the program and use it for every calculation. That approach can become wrong when Solana changes the rent parameters again. The official guidance instead recommends obtaining the current rent-exempt amount from the runtime or querying the network for the minimum balance associated with a particular account data size. 

For example, Solana's RPC method getMinimumBalanceForRentExemption accepts an account data length and returns the minimum balance required for rent exemption. The value is therefore tied to the current network rules and the amount of data the account stores. For developers, that is safer than copying a number from an old tutorial and assuming it will remain valid. 

What users should check before reclaiming SOL

The safest approach is to verify the account type and authority before signing anything. A normal wallet, token account, mint, multisignature account, and program-derived address can all hold lamports, but they do not necessarily support the same withdrawal path. If an application offers a button to recover excess SOL, inspect what account it targets and what instruction the transaction contains before approving it.

  • Confirm that the source account is the one you intended to modify.
  • Check that the account is still needed and should remain open.
  • Verify that the destination address belongs to you or the intended treasury.
  • Confirm the transaction does not include unrelated token transfers or approvals.
  • Keep enough SOL in the wallet to pay the transaction fee.

For developers, the same checks belong in the program itself rather than being left to the front end. The program should validate ownership and authorization before changing lamport balances, and it should move only the calculated excess. That turns the rent reduction from a one-time migration task into a reusable account-management feature. 

What changes for Solana users and developers next

The immediate benefit is that previously required SOL reserves can become usable without forcing users to close accounts that still contain tokens or application state. For developers, the bigger change is architectural: account creation and resizing logic should treat rent as a value obtained from the current network state rather than a permanent constant. Solana's documentation says the current reduction is only the first phase of a five-phase rollout, so applications that calculate account funding should be designed to adapt as the remaining phases arrive. 

If you hold Solana tokens, the practical next step is to identify accounts that may now be over-funded and verify whether their owner supports an excess-lamport withdrawal. If you build Solana programs, update account funding and reclaim logic before the next rent change exposes another hard-coded assumption. The useful part of this upgrade is not simply recovering a few extra lamports today; it is making account management respond to Solana's current rules instead of yesterday's numbers.

H

Written by

Hamza Tariq

I’m interested in blockchain technology, cryptocurrencies, and the ideas behind decentralized applications and digital assets. I enjoy following new developments, understanding how blockchain projects work, and separating useful technology from unnecessary hype. I like explaining crypto and blockchain concepts in a straightforward way.

50 posts published

All posts by this author

0 Comments

No comments yet. Be the first to share your thoughts.

Join the conversation

Log in or create a free account to leave a comment. You can edit or delete your own comments any time.