RPC Guides
How to Use getStakeMinimumDelegation
Learn getStakeMinimumDelegation use cases, code examples, request parameters, response structure, and tips.
The getStakeMinimumDelegation
RPC method returns the current minimum amount of lamports required to create a new stake delegation on the Solana network. This value can change over time due to network governance or updates.
Common Use Cases
- Validating Stake Amounts: Before creating a new stake account or delegating stake, check this value to ensure the intended delegation meets the minimum requirement.
- Staking UI/UX: Displaying the minimum delegation amount to users in staking interfaces to guide their input.
- Automated Staking Scripts: Ensuring automated staking processes use a valid delegation amount.
Request Parameters
This method has one optional parameter:
config
(object, optional): Configuration object containing the following field:commitment
(string, optional): Specifies the commitment level to use when querying the value. If omitted, the default commitment of the RPC node is used (usuallyfinalized
).
Response Structure
The result
field of the JSON-RPC response is an RpcResponse
object containing:
context
(object): AnRpcResponseContext
object with the following field:slot
(u64
): The slot at which the data was retrieved.
value
(u64
): The minimum stake delegation amount in lamports.
Example Response:
Examples
1. Get the Current Stake Minimum Delegation
This example fetches the current minimum stake delegation amount using the default commitment.
2. Get Stake Minimum Delegation with Specific Commitment
Developer Tips
- Lamports vs. SOL: The returned value is in lamports. Remember that 1 SOL = 1,000,000,000 lamports.
- Dynamic Value: The minimum delegation amount is subject to change by network parameters. It’s advisable to query this value periodically or before critical operations rather than hardcoding it. Learn more about staking in our detailed guide.
- Commitment Levels: Using different commitment levels can affect how up-to-date the returned value is.
finalized
provides the most certainty, whileprocessed
might give a newer value that hasn’t been fully confirmed by the cluster.
This guide should help you effectively use the getStakeMinimumDelegation
RPC method to retrieve the minimum required stake delegation on Solana.