Learn getMinimumBalanceForRentExemption use cases, code examples, request parameters, response structure, and tips.
getMinimumBalanceForRentExemption
RPC method allows you to calculate this minimum lamport balance required for an account of a specific data size to become rent-exempt.
In Solana, accounts must maintain a minimum balance to cover storage costs over time, a concept known as rent. Accounts holding a balance equivalent to two years of rent payments are considered “rent-exempt” and do not have their balances depleted by rent.
dataLength
(usize
, required): The length of the account’s data in bytes. This is the primary factor determining the rent-exempt minimum.
165
(for a standard SPL Token account).commitment
(object
, optional): Specifies the commitment level for the query. If omitted, the default commitment of the RPC node is used.
commitment
(string): e.g., "finalized"
, "confirmed"
, or "processed"
.result
field of the JSON-RPC response will be a u64
(unsigned 64-bit integer) representing the minimum number of lamports required for an account with the specified dataLength
to be rent-exempt.
getMinimumBalanceForRentExemption
method will always return the current value based on the cluster’s state.getMinimumBalanceForRentExemption
RPC method to manage account rent effectively in your Solana applications.