Parameters
Configuration object containing:Commitment level (processed, confirmed, finalized)
Response
Minimum stake delegation amount in lamports
Code Examples
Basic Request
curl https://rpc.orbitflare.com -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getStakeMinimumDelegation",
"params": []
}'
Using web3.js
import { Connection } from '@solana/web3.js';
const connection = new Connection('https://rpc.orbitflare.com');
// Get minimum stake delegation
const minDelegation = await connection.getStakeMinimumDelegation();
console.log('Minimum stake delegation:', minDelegation);
// Get minimum stake delegation with analysis
async function getStakeMinimumDelegationWithAnalysis(
config?: { commitment?: string }
) {
const minDelegation = await connection.getStakeMinimumDelegation(config);
return {
minDelegation,
analysis: {
inSOL: minDelegation / 1e9, // Convert lamports to SOL
metadata: {
timestamp: Date.now(),
commitment: config?.commitment
}
}
};
}
Notes
- Returns the minimum stake delegation amount in lamports
- The minimum delegation amount is set by the network
- The response is immediate as it reads from the current state
- The minimum delegation amount can change with network upgrades
- This value is important for determining valid stake amounts
Best Practices
- Use appropriate commitment level based on your needs
- Cache results when appropriate to reduce RPC load
- Monitor for changes in the minimum delegation amount
- Consider using websocket subscription for real-time updates
- Handle network errors and retry when appropriate
Common Errors
Code | Message | Solution |
---|
-32601 | Method not found | Verify you’re connected to a Solana RPC node |
-32602 | Invalid params | Check configuration parameters |
-32007 | Minimum delegation information unavailable | Node may be bootstrapping or syncing |
Use Cases
-
Stake Delegation Analysis
interface StakeDelegationAnalysis {
minDelegation: number;
metrics: {
inSOL: number;
recommendedMinimum: number;
};
metadata: {
timestamp: number;
commitment?: string;
};
}
class StakeDelegationAnalyzer {
private readonly recommendedMultiplier = 1.1; // 10% above minimum
async analyzeStakeDelegation(
config?: { commitment?: string }
): Promise<StakeDelegationAnalysis> {
const minDelegation = await connection.getStakeMinimumDelegation(config);
return {
minDelegation,
metrics: {
inSOL: minDelegation / 1e9,
recommendedMinimum: minDelegation * this.recommendedMultiplier
},
metadata: {
timestamp: Date.now(),
commitment: config?.commitment
}
};
}
}
-
Stake Delegation Monitoring
interface StakeDelegationChange {
previousMinDelegation: number;
currentMinDelegation: number;
change: number;
metadata: {
timestamp: number;
};
}
class StakeDelegationMonitor {
private previousMinDelegation: number | null = null;
async monitorStakeDelegation(
config?: { commitment?: string }
): Promise<StakeDelegationChange | null> {
const currentMinDelegation = await connection.getStakeMinimumDelegation(config);
if (this.previousMinDelegation === null) {
this.previousMinDelegation = currentMinDelegation;
return null;
}
if (this.previousMinDelegation !== currentMinDelegation) {
const change: StakeDelegationChange = {
previousMinDelegation: this.previousMinDelegation,
currentMinDelegation,
change: currentMinDelegation - this.previousMinDelegation,
metadata: {
timestamp: Date.now()
}
};
this.previousMinDelegation = currentMinDelegation;
return change;
}
return null;
}
}
-
Stake Delegation Planning
interface StakeDelegationPlan {
minDelegation: number;
recommendations: Array<{
amount: number;
description: string;
inSOL: number;
}>;
metadata: {
timestamp: number;
};
}
class StakeDelegationPlanner {
private readonly tiers = [
{ multiplier: 1.1, description: 'Minimum recommended' },
{ multiplier: 2, description: 'Standard' },
{ multiplier: 5, description: 'Premium' }
];
async planStakeDelegation(
config?: { commitment?: string }
): Promise<StakeDelegationPlan> {
const minDelegation = await connection.getStakeMinimumDelegation(config);
const recommendations = this.tiers.map(tier => ({
amount: minDelegation * tier.multiplier,
description: tier.description,
inSOL: (minDelegation * tier.multiplier) / 1e9
}));
return {
minDelegation,
recommendations,
metadata: {
timestamp: Date.now()
}
};
}
}