# getStakeMinimumDelegation

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**.

```json
{}
```

***

#### 📦 Response Structure

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

```json
{
  "result": 10000000
}
```

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

***

#### 🧪 Example

**Get Current Minimum Stake Amount**

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

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

***

**Code Examples**

{% tabs %}
{% tab title="Nodejs" %}

```javascript
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);
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def get_stake_minimum_delegation(rpc_url):
    try:
        response = requests.post(
            rpc_url,
            headers={
                'Content-Type': 'application/json',
            },
            json={
                'jsonrpc': '2.0',
                'id': 1,
                'method': 'getStakeMinimumDelegation',
                'params': [
                    {
                        'commitment': 'confirmed'
                    }
                ]
            }
        )
        
        data = response.json()
        
        # Print the exact full response
        print('Full RPC Response:')
        print(json.dumps(data, indent=2))
        
        return data
        
    except Exception as error:
        print(f'Error getting health: {error}')
        return None

# Example usage
RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key'
get_stake_minimum_delegation(RPC_URL)
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "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**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coinvera.io/integration/solana/rpc/getstakeminimumdelegation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
