Check a new Solana stake account against the delegation minimum
A newly funded stake account must cover its rent-exempt reserve as well as the minimum delegation. Testing the total balance against the delegation floor alone can accept an underfunded request.
Read the current cluster minimum
Query the cluster where the delegation will execute and read result.value in lamports. Keep context.slot with the quote. Calculate the rent-exempt reserve for the new account’s actual data length with getMinimumBalanceForRentExemption.
{
"jsonrpc": "2.0",
"id": 1,
"method": "getStakeMinimumDelegation",
"params": [
{
"commitment": "finalized"
}
]
}
Validate the delegatable amount
For illustration, if the minimum is 1000000 lamports and the reserve is 200000, a fresh account funded with 1100000 has 900000 available for delegation. It is short by 100000. Use the current values from the cluster and keep the fee payer’s transaction fee separate from these two components.
This calculation targets a freshly initialized stake account. Existing accounts involved in split, merge or redelegation operations may have activation state and other constraints that require checking the specific instruction.