getStakeMinimumDelegation

Learn getStakeMinimumDelegation use cases, code examples, request parameters, response structure, and tips.

The getStakeMinimumDelegation RPC method in CoinVera returns the minimum amount of SOL required to create or maintain a delegated stake account. This minimum is defined by the network and may change over time based on network parameters or updates.


✅ Common Use Cases

  • Creating Stake Accounts Ensure users or applications allocate at least the minimum required SOL before attempting to delegate stake.

  • Staking UI Validation Display appropriate warnings or disable staking options if the user's balance is below the threshold.

  • Programmatic Checks Prevent transaction failures by validating stake amounts before submitting stake instructions.


🧾 Request Parameters

This method takes no parameters.

{}

📦 Response Structure

Returns a single number representing the minimum required stake in lamports (1 SOL = 1,000,000,000 lamports):

{
  "result": 10000000
}

In this example, the minimum stake required is 0.01 SOL.


🧪 Example

Get Current Minimum Stake Amount

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getStakeMinimumDelegation"
}

// Response
{
  "jsonrpc": "2.0",
  "result": 10000000,
  "id": 1
}

Code Examples

const fetch = require('node-fetch');

async function getStakeMinimumDelegation(rpcUrl) {
  try {
    const response = await fetch(rpcUrl, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'getStakeMinimumDelegation',
        "params": [
            {
              "commitment": "confirmed"
            }
          ]
      }),
    });

    const data = await response.json();
    
    // Print the exact full response
    console.log('Full RPC Response:');
    console.log(JSON.stringify(data, null, 2));
    
    return data;
  } catch (error) {
    console.error('Error getting health:', error.message);
    return null;
  }
}

// Example usage
const RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';

getStakeMinimumDelegation(RPC_URL);

Example Response

{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "2.2.16",
      "slot": 355399228
    },
    "value": 1
  },
  "id": 1
}

💡 Developer Tips

  • Always Use This Before Delegating Especially if users are staking small amounts—this avoids failed transactions due to insufficient delegation.

  • Lamports, Not SOL Remember that the response is in lamports. Convert to SOL for display (e.g., divide by 1e9).

  • Minimum May Change The network may update this threshold over time. Always retrieve it dynamically instead of hardcoding a value.

  • Useful for Cold Wallet Staking Interfaces Ensures users don’t lock SOL into undelegatable stake accounts, which would otherwise need to be withdrawn and re-staked.


The getStakeMinimumDelegation method is a straightforward but essential RPC call for any staking-enabled interface or automation built on CoinVera.

Last updated