> loading_
# Walkthrough: Inspecting how rent-adjusted stake delegations affect your accounts
# This isn't new API surface — it's a change in on-chain behavior. Here's how to observe it.
# 1. Fetch a stake account and inspect the delegation vs. lamport balance
# Using @solana/web3.js v2 (or v1 — the concept is identical)
import { Connection, PublicKey } from '@solana/web3.js';
import { StakeProgram } from '@solana/web3.js';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const stakeAccountPubkey = new PublicKey('YOUR_STAKE_ACCOUNT_ADDRESS');
# 2. Get the parsed stake account data
const accountInfo = await connection.getParsedAccountInfo(stakeAccountPubkey);
const parsedData = accountInfo.value?.data?.parsed;
# 3. Compare delegation stake vs. actual lamports
# Pre-SIMD-0392: these could diverge after rent deduction
# Post-SIMD-0392: delegation.stake is adjusted downward to match post-rent balance
const delegationStake = parsedData?.info?.stake?.delegation?.stake; // in lamports
const accountLamports = accountInfo.value?.lamports;
const rentExemptMin = await connection.getMinimumBalanceForRentExemption(
StakeProgram.space
);
console.log(`Delegation stake: ${delegationStake}`);
console.log(`Account lamports: ${accountLamports}`);
console.log(`Rent-exempt min: ${rentExemptMin}`);
console.log(`Non-stake balance: ${accountLamports - delegationStake}`);
# 4. For validator operators / staking infra:
# If you track effective stake per epoch for reward estimation,
# ensure your snapshots are taken AFTER rewards distribution completes.
# The rewards payout now internally adjusts delegation before calculating payouts.
# 5. For analytics / LST protocols:
# Verify that your reward-per-epoch calculation accounts for the possibility
# that delegation.stake < previous_delegation.stake even without an explicit
# deactivation — rent adjustment is now a valid cause of delegation decrease.
# Key RPC calls to audit your integration:
# - getStakeActivation(pubkey) → effective stake may be slightly lower
# - getInflationReward([pubkey]) → rewards now computed on rent-adjusted stake
# - getAccountInfo(pubkey) → delegation.stake field reflects post-rent value