Summary
Solana staking integrations rely on core JSON-RPC methods to query stake accounts, validator vote accounts, epoch state, and to build and submit staking transactions. The most important methods are getStakeActivation (stake account lifecycle state), getVoteAccounts (validator and commission data), and getEpochInfo (epoch progress and timing). Production staking dApps typically extend this with simulateTransaction for preflight checks, getLatestBlockhash for transaction construction, sendTransaction for submission, and WebSocket account subscriptions for activation monitoring. Public endpoints such as https://api.mainnet-beta.solana.com and https://api.devnet.solana.com are useful for development, but rate limits and shared capacity make them unsuitable for user-facing staking features. Teams should evaluate RPC providers on support for these methods, clear commitment behavior, archive access for historical stake data, and whether the plan includes the Solana networks you need. Use the Solana devnet faucet at https://faucet.solana.com to obtain test SOL for integration testing before moving to mainnet.
Key Takeaways
- Solana staking integrations depend on getStakeActivation, getVoteAccounts, getEpochInfo, and reliable transaction simulation/submission.
- Public endpoints like api.mainnet-beta.solana.com are for development and testing; production apps need RPC infrastructure with predictable capacity and commitment options.
- Simulate staking transactions before signing, broadcast with confirmed or finalized commitment, and monitor epoch boundaries for activation state changes.
- Verify provider support for staking-specific RPC methods, WebSocket subscriptions, archive data, and devnet access before committing to a plan.
Staking integration workflow
A Solana staking integration reads validator data, resolves a user's stake accounts, constructs delegation or withdrawal instructions, broadcasts transactions, and tracks state changes across epochs. The core data flow typically follows this sequence:
- Query getVoteAccounts to populate validator selection.
- Query getStakeActivation for each user stake account to show active, activating, deactivating, or inactive states.
- Use getEpochInfo to calculate epoch boundaries and current slot.
- Build or simulate transactions with simulateTransaction and getLatestBlockhash.
- Sign locally with Solana CLI, a wallet adapter, or a JavaScript/TypeScript connection using your RPC URL.
- Broadcast with sendTransaction and subscribe to account updates over WebSocket to detect activation or deactivation completion.
getStakeActivation
getStakeActivation returns the activation state of a Solana stake account. It indicates whether the stake is inactive, activating, active, or deactivating, along with lamport amounts for active and inactive portions.
- Parameters: stake account public key, optional commitment and epoch.
- Result fields: state, active, inactive, activating, effective (for active stake at a given epoch).
- Use in dashboards to show current stake status and pending activation.
- Pair with accountSubscribe to receive real-time changes when the state transitions.
getVoteAccounts
getVoteAccounts returns the full list of validator vote accounts and their summarized state. It is the primary method for building validator selection UIs and for checking a validator's commission before delegating.
- Response includes current vote accounts and delinquent vote accounts.
- Each item contains votePubkey, nodePubkey, activatedStake, commission, epochVoteAccount, lastVote, and rootSlot.
- Use commission in the current epoch to estimate rewards and compare validators.
- For large dashboards, cache this response and refresh on epoch boundaries rather than every block.
getEpochInfo
getEpochInfo returns the current epoch, slot index, slots per epoch, and epoch schedule details. Staking state changes are epoch-bound, so this method is essential for timing delegation and reconciliation.
- Fields include epoch, slotIndex, slotsInEpoch, absoluteSlot, and blockHeight.
- Use slotIndex and slotsInEpoch to calculate epoch progress percentage.
- Use the epoch value to determine which activation epoch applies to a stake account and when deactivation completes.
- For reward reporting, run reconciliation at epoch boundaries using getEpochInfo to trigger data refresh.
Simulation, signing, and transaction submission
Transaction construction for staking should follow a simulate-then-send pattern. Simulate the transaction against a current blockhash, inspect the result, then sign and submit with an appropriate commitment level.
- Use getLatestBlockhash to obtain a recent blockhash for transaction construction; the blockhash expires after a few seconds.
- Use simulateTransaction with sigVerify true to catch invalid instructions, missing signatures, or insufficient balances before broadcast.
- Sign with Solana CLI, a wallet adapter, or a JavaScript/TypeScript connection using the provider's RPC URL.
- Submit with sendTransaction and monitor with confirmTransaction or WebSocket signature subscriptions.
- For staking operations, prefer confirmed or finalized commitment rather than processed to avoid acting on an unfinalized state.
Epoch-aware monitoring and reconciliation
Staking state changes in Solana are tied to epochs. Activation typically completes after the current epoch, and deactivation also spans epochs. Your integration should monitor epoch boundaries and reconcile stake state rather than assuming a transaction immediately changes activation.
- Poll or subscribe to epoch transitions using slot subscriptions or repeated getEpochInfo calls.
- On epoch change, refresh getStakeActivation for accounts in pending activation or deactivation states to update the UI.
- Use getVoteAccounts at epoch boundaries to update validator commission and stake for reward estimates.
- Store a basic ledger of observed states per epoch for reward audits and reconciliation; archive access can help retrieve historical account states.
Staking API integration checklist
Evaluate RPC providers for staking against the following criteria before building a user-facing feature. Use this checklist to avoid method-level surprises and capacity issues. For general Solana JSON-RPC calls and connection details, see /rpc-assistant/solana-api-guide. For current Solana endpoint details and archive availability, see /networks/solana.
Next steps: Reliable RPC for staking backends.
| Criterion | What to check | Why it matters |
|---|---|---|
| Staking RPC methods | Confirm getStakeActivation, getVoteAccounts, getEpochInfo, simulateTransaction, and sendTransaction are enabled on the target network. | A provider that exposes general JSON-RPC may still restrict staking-specific methods or require higher tiers. |
| Commitment levels | Support for processed, confirmed, finalized in both HTTP and WebSocket. | Staking UIs need confirmed for responsiveness and finalized for settlement. |
| Network coverage | Mainnet-beta and devnet access; testnet if your team needs validator testing. | You cannot safely test delegation flows without devnet test SOL. |
| WebSocket subscriptions | accountSubscribe, signatureSubscribe, slotSubscribe. | Real-time activation updates reduce polling and improve UX. |
| Archive data | Historical account state, reward data, or older slots if needed for reporting. | Reward reconciliation often requires historical stake state that recent-only nodes cannot serve. |
| Rate limits and plan terms | Request limits, query complexity restrictions for getProgramAccounts or getVoteAccounts, and any plan-specific caps. | Limits and plan terms can change; check current documentation so production traffic does not hit throttling. |
Frequently Asked Questions
Does every Solana RPC provider support getStakeActivation?
Not necessarily. Some API services restrict advanced methods to higher plans; verify current documentation and test against your endpoint.
Can I use public Solana endpoints for staking integrations?
Public endpoints such as https://api.mainnet-beta.solana.com and https://api.devnet.solana.com are rate-limited and shared. They are useful for development but not reliable for user-facing staking. Use an RPC provider for production.
How do I monitor stake activation without constant polling?
Use WebSocket accountSubscribe on the stake account public key and listen for state changes. Combine with epoch-boundary reconciliation for robust UI.
Why do I need getEpochInfo for staking?
Activation and deactivation complete at epoch boundaries. getEpochInfo provides current epoch and slot progress so you can time delegation, display pending states, and trigger reward reconciliation.
What should I look for in an RPC provider for Solana staking?
Verify support for staking RPC methods, commitment levels, WebSocket subscriptions, archive access for historical reward data, and devnet availability. Check current plan terms because limits can change.
Does OnFinality support Solana staking RPC methods?
OnFinality's Solana network page lists HTTPS and WebSocket endpoints with archive support for mainnet. Check /networks/solana for current network details and verify your plan includes the methods and regions you need.